models

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LabelTopologyRegion = "topology.kubernetes.io/region"
	LabelTopologyZone   = "topology.kubernetes.io/zone"
)

Variables

This section is empty.

Functions

func InstanceID added in v1.0.0

func InstanceID(hostName string) string

InstanceID returns the simulated instance ID for a model hostname.

Types

type CapacityBlock

type CapacityBlock struct {
	Switch      string            `yaml:"switch"`
	Nodes       []string          `yaml:"nodes"`
	Labels      map[string]string `yaml:"labels"`
	Annotations map[string]string `yaml:"annotations"`
}

CapacityBlock is the blocks entry shape in simulation model YAML.

type Model

type Model struct {
	Switches       map[string]*Switch `yaml:"switches"`
	Nodes          map[string]*Node   `yaml:"-"`
	CapacityBlocks []CapacityBlock    `yaml:"blocks"`

	// derived
	Instances []topology.ComputeInstances `yaml:"-"`
}

func NewModelFromData added in v0.3.0

func NewModelFromData(data []byte, fname string) (*Model, error)

func NewModelFromFile

func NewModelFromFile(fname string) (*Model, error)

func (*Model) InstanceMap added in v0.5.0

func (model *Model) InstanceMap(computeInstances []topology.ComputeInstances) map[string]topology.Instance

func (*Model) ToGraph

func (model *Model) ToGraph(instances []topology.ComputeInstances) (*topology.Graph, map[string]string)

func (*Model) UnmarshalYAML added in v0.4.0

func (m *Model) UnmarshalYAML(value *yaml.Node) error

type Node

type Node struct {
	topology.Instance
	Annotations map[string]string `yaml:"annotations"`
}

Node is a compute instance in a simulation model. Annotations hold provider-specific test inputs and are not exported as topology labels.

func (*Node) AcceleratorDomain added in v1.0.0

func (node *Node) AcceleratorDomain() string

AcceleratorDomain returns the simulated accelerator-domain identifier.

func (*Node) AcceleratorSubDomain added in v1.0.0

func (node *Node) AcceleratorSubDomain() string

AcceleratorSubDomain returns the simulated accelerator sub-domain identifier.

type Switch

type Switch struct {
	Name        string            `yaml:"name,omitempty"`
	Labels      map[string]string `yaml:"labels"`
	Annotations map[string]string `yaml:"annotations"`
	Switches    []string          `yaml:"switches"`
	Nodes       []string          `yaml:"-"`
}

Switch is a switch vertex in a simulation model YAML tree (tests/models).

Jump to

Keyboard shortcuts

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