utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OneContainerMultiDeviceSplitSymbol this is when one container use multi device, use : symbol to join device info.
	OneContainerMultiDeviceSplitSymbol = ":"

	// OnePodMultiContainerSplitSymbol this is when one pod having multi container and
	// more than one container use device, use ; symbol to join device info.
	OnePodMultiContainerSplitSymbol = ";"
)

Variables

This section is empty.

Functions

func EncodeNodeDevices

func EncodeNodeDevices(dlist []*DeviceInfo) string

Types

type ContainerDevice

type ContainerDevice struct {
	UUID      string
	Type      string
	Usedmem   int32
	Usedcores int32
}

type ContainerDevices

type ContainerDevices []ContainerDevice

func DecodeContainerDevices

func DecodeContainerDevices(str string) (ContainerDevices, error)

type DeviceInfo

type DeviceInfo struct {
	Index                int        `json:"index,omitempty"`
	Id                   string     `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Count                int32      `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
	Devmem               int32      `protobuf:"varint,3,opt,name=devmem,proto3" json:"devmem,omitempty"`
	Type                 string     `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
	Health               bool       `protobuf:"varint,5,opt,name=health,proto3" json:"health,omitempty"`
	Mode                 string     `json:"mode,omitempty"`
	MIGTemplate          []Geometry `json:"migtemplate,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func DecodeNodeDevices

func DecodeNodeDevices(str string) ([]*DeviceInfo, error)

type Geometry added in v0.1.1

type Geometry struct {
	Group     string        `yaml:"group"`
	Instances []MigTemplate `yaml:"geometries"`
}

type MigTemplate added in v0.1.1

type MigTemplate struct {
	Name   string `yaml:"name"`
	Memory int32  `yaml:"memory"`
	Count  int32  `yaml:"count"`
}

type PodDevices

type PodDevices map[string]PodSingleDevice

func DecodePodDevices

func DecodePodDevices(checkList map[string]string, annos map[string]string) (PodDevices, error)

type PodSingleDevice

type PodSingleDevice []ContainerDevices

Jump to

Keyboard shortcuts

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