mlu

package
v0.0.0-...-93b9226 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DsmluLockTime           = "cambricon.com/dsmlu.lock"
	DsmluProfile            = "CAMBRICON_DSMLU_PROFILE"
	DsmluProfileAndInstance = "CAMBRICON_DSMLU_PROFILE_INSTANCE"
	DsmluResourceAssigned   = "CAMBRICON_DSMLU_ASSIGHED"
)
View Source
const (
	Default       pluginMode = "default"
	DynamicSmlu   pluginMode = "dynamic-smlu"
	EnvShare      pluginMode = "env-share"
	Mim           pluginMode = "mim"
	TopologyAware pluginMode = "topology-aware"
)

Variables

This section is empty.

Functions

func GetDevices

func GetDevices(o Options) (map[string][]*pluginapi.Device, map[string]map[string]*cndev.Device)

func GetProfileFromAnnotation

func GetProfileFromAnnotation(pod *v1.Pod) (*cndev.DsmluProfile, error)

Types

type CambriconDevicePlugin

type CambriconDevicePlugin struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

CambriconDevicePlugin implements the Kubernetes device plugin API

func NewCambriconDevicePlugin

func NewCambriconDevicePlugin(o Options, profile string, devs []*pluginapi.Device, devsInfo map[string]*cndev.Device) *CambriconDevicePlugin

NewCambriconDevicePlugin returns an initialized CambriconDevicePlugin

func (*CambriconDevicePlugin) Allocate

Allocate which return list of devices.

func (*CambriconDevicePlugin) GetDevicePluginOptions

func (*CambriconDevicePlugin) GetDeviceUUIDByIndex

func (m *CambriconDevicePlugin) GetDeviceUUIDByIndex(index uint) (uuid string, found bool)

func (*CambriconDevicePlugin) ListAndWatch

ListAndWatch lists devices and update that list according to the health status

func (*CambriconDevicePlugin) PrepareResponse

func (*CambriconDevicePlugin) Register

func (m *CambriconDevicePlugin) Register(kubeletEndpoint, resourceName string) error

Register registers the device plugin for the given resourceName with Kubelet.

func (*CambriconDevicePlugin) Serve

func (m *CambriconDevicePlugin) Serve() error

Serve starts the gRPC server and register the device plugin to Kubelet

func (*CambriconDevicePlugin) Start

func (m *CambriconDevicePlugin) Start() error

Start starts the gRPC server of the device plugin

func (*CambriconDevicePlugin) Stop

func (m *CambriconDevicePlugin) Stop() error

Stop stops the gRPC server

type Options

type Options struct {
	CnmonPath            string     `long:"cnmon-path" description:"host cnmon path" json:"cnmonPath,omitempty"`
	DisableHealthCheck   bool       `long:"disable-health-check" description:"disable MLU health check" json:"disableHealthCheck,omitempty"`
	EnableConsole        bool       `long:"enable-console" description:"enable UART console device(/dev/ttyMS) in container" json:"enableConsole,omitempty"`
	EnableDeviceType     bool       `long:"enable-device-type" description:"enable device registration with type info" json:"enableDeviceType,omitempty"`
	LogLevel             string     `` /* 126-byte string literal not displayed */
	MinDsmluUnit         int        `` /* 152-byte string literal not displayed */
	MLULinkPolicy        string     `` /* 173-byte string literal not displayed */
	Mode                 pluginMode `` /* 179-byte string literal not displayed */
	MountRPMsg           bool       `long:"mount-rpmsg" description:"mount RPMsg directory, will be deprecated in the near future" json:"mountRPMsg,omitempty"`
	NodeName             string     `long:"node-name" description:"host node name" env:"NODE_NAME" json:"nodeName,omitempty"`
	Version              bool       `long:"version" description:"print out version"`
	VirtualizationNum    int        `` /* 179-byte string literal not displayed */
	AbnormalXIDErrorList []string   `` /* 198-byte string literal not displayed */
	ConfigFile           string     `long:"config-file" description:"config file" env:"CONFIG_FILE"`
}

func LoadConfig

func LoadConfig() Options

Jump to

Keyboard shortcuts

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