topology

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyEngine = "engine"

	KeyUID               = "uid"
	KeyNamespace         = "namespace"
	KeyPodSelector       = "podSelector"
	KeyNodeSelector      = "nodeSelector"
	KeyTopologies        = "topologies"
	KeyTopoConfigPath    = "topologyConfigPath"
	KeyTopoConfigmapName = "topologyConfigmapName"
	KeyBlockSizes        = "blockSizes"
	KeyTrimTiers         = "trimTiers"

	KeyPlugin     = "plugin"
	TopologyTree  = "topology/tree"
	TopologyBlock = "topology/block"
	TopologyFlat  = "topology/flat"
	NoTopology    = "no-topology"

	KeyNodeInstance  = "topograph.nvidia.com/instance"
	KeyNodeRegion    = "topograph.nvidia.com/region"
	KeyNodeClusterID = "topograph.nvidia.com/cluster-id"

	// ConfigMap annotation keys for metadata tracking
	KeyConfigMapEngine            = "topograph.nvidia.com/engine"
	KeyConfigMapTopologyManagedBy = "topograph.nvidia.com/topology-managed-by"
	KeyConfigMapLastUpdated       = "topograph.nvidia.com/last-updated"
	KeyConfigMapPlugin            = "topograph.nvidia.com/plugin"
	KeyConfigMapBlockSizes        = "topograph.nvidia.com/block-sizes"
	KeyConfigMapNamespace         = "topograph.nvidia.com/slurm-namespace"

	//Slinky specific annotations and labels
	KeySlinkyTopologySpec = "topology.slinky.slurm.net/spec"
	KeySlurmNodeName      = "slurm.node.name"
)

Variables

This section is empty.

Functions

func GetHash added in v0.3.0

func GetHash(obj any) (string, error)

func GetNodeNameList

func GetNodeNameList(cis []ComputeInstances) []string

GetNodeNameList retrieves all the nodenames

func GetNodeNameMap

func GetNodeNameMap(cis []ComputeInstances) map[string]bool

GetNodeNameMap retrieves all the nodenames

Types

type ClusterTopology

type ClusterTopology struct {
	Instances []*InstanceTopology
}

func NewClusterTopology

func NewClusterTopology() *ClusterTopology

func (*ClusterTopology) Append

func (c *ClusterTopology) Append(inst *InstanceTopology)

func (*ClusterTopology) Len

func (c *ClusterTopology) Len() int

func (*ClusterTopology) Normalize

func (c *ClusterTopology) Normalize()

func (*ClusterTopology) ToThreeTierGraph

func (c *ClusterTopology) ToThreeTierGraph(provider string, cis []ComputeInstances, trimTiers int, normalize bool) *Graph

type ComputeInstances

type ComputeInstances struct {
	Region    string            `json:"region"`
	Instances map[string]string `json:"instances"` // <instance ID>:<node name> map
}

type DomainMap

type DomainMap map[string]map[string]string

DomainMap maps domain name to a map of hostname:instance

func NewDomainMap

func NewDomainMap() DomainMap

func (DomainMap) AddHost

func (m DomainMap) AddHost(domain, instance, host string)

func (DomainMap) String

func (m DomainMap) String() string

type Engine

type Engine struct {
	Name   string         `json:"name"`
	Params map[string]any `json:"params"`
}

type Graph added in v0.4.0

type Graph struct {
	Tiers   *Vertex
	Domains DomainMap
}

Graph is the canonical scheduler-agnostic topology representation. Tiers is the root of the switch hierarchy. Domains maps accelerator/block domains to hosts and carries the finalized enumerated domain ID.

type InstanceTopology

type InstanceTopology struct {
	InstanceID    string
	LeafID        string
	LeafName      string // optional
	SpineID       string
	SpineName     string // optional
	CoreID        string
	CoreName      string // optional
	AcceleratorID string
}

func (*InstanceTopology) String

func (inst *InstanceTopology) String() string

type Merger

type Merger struct {
	// contains filtered or unexported fields
}

Merger finds and merges similar vertices in a graph representing N-tier hierarchy

func NewMerger

func NewMerger(top []*Vertex) *Merger

func (*Merger) Merge

func (m *Merger) Merge()

func (*Merger) TopTier

func (m *Merger) TopTier() []*Vertex

type Provider

type Provider struct {
	Name   string         `json:"name"`
	Creds  map[string]any `json:"creds"` // access credentials
	Params map[string]any `json:"params"`
}

type Request

type Request struct {
	Provider Provider           `json:"provider"`
	Engine   Engine             `json:"engine"`
	Nodes    []ComputeInstances `json:"nodes"`
}

func GetTopologyRequest

func GetTopologyRequest(body []byte) (*Request, error)

func NewRequest

func NewRequest(prv Provider, eng Engine) *Request

func (*Request) Hash added in v0.3.0

func (p *Request) Hash() (string, error)

func (*Request) String

func (p *Request) String() string

type Vertex

type Vertex struct {
	Name     string
	ID       string
	Vertices map[string]*Vertex
}

Vertex is a tree node, representing a compute node or a network switch, where - Name is a compute node name - ID is an CSP defined instance ID of switches and compute nodes - Vertices is a list of connected compute nodes or network switches

func (*Vertex) String

func (v *Vertex) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL