cluster

package
v0.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultTopologyKey

func DefaultTopologyKey(plat string) string

DefaultTopologyKey returns the network topology label for the detected platform.

func DiscoverGPUNodes

func DiscoverGPUNodes(
	ctx context.Context, c client.Client, target *nvcrev1alpha1.TargetSpec,
) ([]corev1.Node, string, error)

DiscoverGPUNodes discovers GPU nodes matching a target, validates that all nodes share the same nvidia.com/gpu.product, and returns them with the product string. If target is nil all GPU nodes are selected.

func NewCommand

func NewCommand() *cobra.Command

NewCommand returns the "cluster" cobra command.

func UniformGPUProduct

func UniformGPUProduct(nodes []corev1.Node) (string, error)

UniformGPUProduct returns the nvidia.com/gpu.product label shared by all nodes, or an error when the label is missing or heterogeneous.

Types

type ClusterInfo

type ClusterInfo struct {
	Platform        string `json:"platform"`
	GPUArchitecture string `json:"gpuArchitecture"`
	GPUProduct      string `json:"gpuProduct"`
	// GpusPerNode is the smallest GPU count any discovered node reports. A job
	// asks for the same count on every node, so the smallest node sets what
	// the cluster can run.
	GpusPerNode int32 `json:"gpusPerNode"`
	// CatalogGpusPerNode is what the catalog assumes for this architecture. It
	// can differ from GpusPerNode, for example on a workstation or a partly
	// drained node, and then a certification must set gpusPerNode itself.
	CatalogGpusPerNode int32         `json:"catalogGpusPerNode"`
	TotalNodes         int           `json:"totalNodes"`
	TotalGPUs          int           `json:"totalGPUs"`
	Nodes              []NodeInfo    `json:"nodes"`
	Topology           *TopologyInfo `json:"topology,omitempty"`
}

ClusterInfo is the JSON/YAML output structure for nvcrectl cluster info.

type NodeInfo

type NodeInfo struct {
	Name string `json:"name"`
	// GPUs is the node's allocatable nvidia.com/gpu count. It is 0 when the
	// device plugin has not advertised the resource yet.
	GPUs  int32  `json:"gpus"`
	Ready bool   `json:"ready"`
	Rack  string `json:"rack,omitempty"`
}

NodeInfo describes a single GPU node.

type RackInfo

type RackInfo struct {
	Name      string   `json:"name"`
	Nodes     []string `json:"nodes"`
	NodeCount int      `json:"nodeCount"`
}

RackInfo describes a single topology domain (rack / T1 leaf switch).

type TopologyInfo

type TopologyInfo struct {
	Key   string     `json:"key"`
	Racks []RackInfo `json:"racks"`
}

TopologyInfo describes the network topology grouping.

Jump to

Keyboard shortcuts

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