topology

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 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"
	KeyTopoConfigPath    = "topologyConfigPath"
	KeyTopoConfigmapName = "topologyConfigmapName"
	KeyBlockSizes        = "block_sizes"
	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"
)

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) *Vertex

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

func (DomainMap) ToBlocks

func (m DomainMap) ToBlocks() *Vertex

type Engine

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

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
	Metadata map[string]string
}

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