Documentation ¶
Index ¶
- Constants
- func GetDevices(o Options) (map[string][]*pluginapi.Device, map[string]map[string]*cndev.Device)
- func GetProfileFromAnnotation(pod *v1.Pod) (*cndev.DsmluProfile, error)
- type CambriconDevicePlugin
- func (m *CambriconDevicePlugin) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (m *CambriconDevicePlugin) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (m *CambriconDevicePlugin) GetDeviceUUIDByIndex(index uint) (uuid string, found bool)
- func (m *CambriconDevicePlugin) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
- func (m *CambriconDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (m *CambriconDevicePlugin) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (m *CambriconDevicePlugin) PrepareResponse(uuids []string) pluginapi.ContainerAllocateResponse
- func (m *CambriconDevicePlugin) Register(kubeletEndpoint, resourceName string) error
- func (m *CambriconDevicePlugin) Serve() error
- func (m *CambriconDevicePlugin) Start() error
- func (m *CambriconDevicePlugin) Stop() error
- type Options
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" Mim pluginMode = "mim" TopologyAware pluginMode = "topology-aware" )
Variables ¶
This section is empty.
Functions ¶
func GetDevices ¶
func GetProfileFromAnnotation ¶
func GetProfileFromAnnotation(pod *v1.Pod) (*cndev.DsmluProfile, error)
Types ¶
type CambriconDevicePlugin ¶
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 ¶
func (m *CambriconDevicePlugin) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
Allocate which return list of devices.
func (*CambriconDevicePlugin) GetDevicePluginOptions ¶
func (m *CambriconDevicePlugin) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
func (*CambriconDevicePlugin) GetDeviceUUIDByIndex ¶
func (m *CambriconDevicePlugin) GetDeviceUUIDByIndex(index uint) (uuid string, found bool)
func (*CambriconDevicePlugin) GetPreferredAllocation ¶
func (m *CambriconDevicePlugin) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
func (*CambriconDevicePlugin) ListAndWatch ¶
func (m *CambriconDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
ListAndWatch lists devices and update that list according to the health status
func (*CambriconDevicePlugin) PreStartContainer ¶
func (m *CambriconDevicePlugin) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
func (*CambriconDevicePlugin) PrepareResponse ¶
func (m *CambriconDevicePlugin) PrepareResponse(uuids []string) pluginapi.ContainerAllocateResponse
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
Click to show internal directories.
Click to hide internal directories.