ascend

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConfig

func ParseConfig(fs *flag.FlagSet)

Types

type Config

type Config struct {
	VNPUs []VNPUConfig `json:"vnpus"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

type Devices

type Devices struct {
	// contains filtered or unexported fields
}

func InitDevices

func InitDevices() []*Devices

func (*Devices) CheckHealth

func (dev *Devices) CheckHealth(devType string, n *corev1.Node) (bool, bool)

func (*Devices) CheckType

func (dev *Devices) CheckType(annos map[string]string, d util.DeviceUsage, n util.ContainerDeviceRequest) (bool, bool, bool)

func (*Devices) CheckUUID

func (dev *Devices) CheckUUID(annos map[string]string, d util.DeviceUsage) bool

func (*Devices) CommonWord

func (dev *Devices) CommonWord() string

func (*Devices) GenerateResourceRequests

func (dev *Devices) GenerateResourceRequests(ctr *corev1.Container) util.ContainerDeviceRequest

func (*Devices) GetNodeDevices

func (dev *Devices) GetNodeDevices(n corev1.Node) ([]*api.DeviceInfo, error)

func (*Devices) LockNode

func (dev *Devices) LockNode(n *corev1.Node, p *corev1.Pod) error

func (*Devices) MutateAdmission

func (dev *Devices) MutateAdmission(ctr *corev1.Container) (bool, error)

func (*Devices) NodeCleanUp

func (dev *Devices) NodeCleanUp(nn string) error

func (*Devices) PatchAnnotations

func (dev *Devices) PatchAnnotations(annoInput *map[string]string, pd util.PodDevices) map[string]string

func (*Devices) ReleaseNodeLock

func (dev *Devices) ReleaseNodeLock(n *corev1.Node, p *corev1.Pod) error

type RuntimeInfo

type RuntimeInfo struct {
	UUID string `json:"UUID,omitempty"`
	Temp string `json:"temp,omitempty"`
}

type Template

type Template struct {
	Name   string `json:"name"`
	Memory int64  `json:"memory"`
	AICore int32  `json:"aiCore,omitempty"`
	AICPU  int32  `json:"aiCPU,omitempty"`
}

type VNPUConfig

type VNPUConfig struct {
	CommonWord         string     `json:"commonWord"`
	ChipName           string     `json:"chipName"`
	ResourceName       string     `json:"resourceName"`
	ResourceMemoryName string     `json:"resourceMemoryName"`
	MemoryAllocatable  int64      `json:"memoryAllocatable"`
	MemoryCapacity     int64      `json:"memoryCapacity"`
	AICore             int32      `json:"aiCore"`
	AICPU              int32      `json:"aiCPU"`
	Templates          []Template `json:"templates"`
}

Jump to

Keyboard shortcuts

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