topology

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyEngine = "engine"

	KeyUID               = "uid"
	KeyNamespace         = "namespace"
	KeyPodSelector       = "podSelector"
	KeyTopoConfigPath    = "topologyConfigPath"
	KeyTopoConfigmapName = "topologyConfigmapName"
	KeyBlockSizes        = "block_sizes"

	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 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, normalize bool) (*Vertex, error)

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
	BlockID        string
	BlockName      string // optional
	SpineID        string
	SpineName      string // optional
	DatacenterID   string
	DatacenterName 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]string `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 string, creds map[string]string, eng string, params map[string]any) *Request

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