Documentation ¶
Index ¶
- Constants
- func GetDevices() ([]*pluginapi.Device, map[uint]string)
- func NewFileWatcher(files ...string) (*fsnotify.Watcher, error)
- func NewOSWatcher(sigs ...os.Signal) chan os.Signal
- type KubeMessenger
- type NvidiaDevicePlugin
- func (p *NvidiaDevicePlugin) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (p *NvidiaDevicePlugin) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (p *NvidiaDevicePlugin) GetPreferredAllocation(context.Context, *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
- func (p *NvidiaDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (p *NvidiaDevicePlugin) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (p *NvidiaDevicePlugin) Register(resourceName string) error
- func (p *NvidiaDevicePlugin) Serve() error
- func (p *NvidiaDevicePlugin) Start() error
- func (p *NvidiaDevicePlugin) Stop() error
Constants ¶
View Source
const ( ServerSock = pluginapi.DevicePluginPath + "doslab.sock" ResourceName = "doslab.io/gpu-memory" ResourceCount = "doslab.io/gpu-count" ResourceCore = "doslab.io/gpu-core" AnnResourceAssumeTime = "doslab.io/gpu-assume-time" AnnAssignedFlag = "doslab.io/gpu-assigned" AnnResourceUUID = "doslab.io/gpu-uuid" AnnVCUDAReady = "doslab.io/vcuda" NvidiaCtlDevice = "/dev/nvidiactl" NvidiaUVMDevice = "/dev/nvidia-uvm" DriverLibraryPath = "/etc/kube-gpu/vdriver/nvidia" VirtualManagerPath = "/etc/kube-gpu/vm" VCUDA_MOUNTPOINT = "/etc/vcuda" EnvResourceUUID = "DOSLAB_IO_GPU_UUID" EnvResourceUsedByPod = "DOSLAB_IO_GPU_RESOURCE_USED_BY_POD" EnvResourceUsedByContainer = "DOSLAB_IO_GPU_RESOURCE_USED_BY_CONTAINER" EnvResourceTotal = "DOSLAB_IO_GPU_RESOURCE_TOTAL" EnvNvidiaGPU = "NVIDIA_VISIBLE_DEVICES" EnvPodName = "POD_NAME" EnvNvidiaDriverCapabilities = "NVIDIA_DRIVER_CAPABILITIES" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KubeMessenger ¶
type KubeMessenger struct {
// contains filtered or unexported fields
}
KubeMessenger is used to communicate with api server
func NewKubeMessenger ¶
func NewKubeMessenger(client *kubesys.KubernetesClient, nodeName string) *KubeMessenger
func (*KubeMessenger) GetPendingPodsOnNode ¶
func (m *KubeMessenger) GetPendingPodsOnNode() []*v1.Pod
func (*KubeMessenger) GetPodOnNode ¶
func (m *KubeMessenger) GetPodOnNode(podName, namespace string) *v1.Pod
func (*KubeMessenger) PatchGPUCount ¶
func (m *KubeMessenger) PatchGPUCount(count, core uint) error
func (*KubeMessenger) UpdatePodAnnotations ¶
func (m *KubeMessenger) UpdatePodAnnotations(pod *v1.Pod) error
type NvidiaDevicePlugin ¶
type NvidiaDevicePlugin struct {
// contains filtered or unexported fields
}
NvidiaDevicePlugin implements the Kubernetes device plugin API
func NewNvidiaDevicePlugin ¶
func NewNvidiaDevicePlugin(client *kubesys.KubernetesClient, nodeName string) *NvidiaDevicePlugin
func (*NvidiaDevicePlugin) Allocate ¶
func (p *NvidiaDevicePlugin) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
func (*NvidiaDevicePlugin) GetDevicePluginOptions ¶
func (p *NvidiaDevicePlugin) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
func (*NvidiaDevicePlugin) GetPreferredAllocation ¶
func (p *NvidiaDevicePlugin) GetPreferredAllocation(context.Context, *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
func (*NvidiaDevicePlugin) ListAndWatch ¶
func (p *NvidiaDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
func (*NvidiaDevicePlugin) PreStartContainer ¶
func (p *NvidiaDevicePlugin) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
func (*NvidiaDevicePlugin) Register ¶
func (p *NvidiaDevicePlugin) Register(resourceName string) error
func (*NvidiaDevicePlugin) Serve ¶
func (p *NvidiaDevicePlugin) Serve() error
func (*NvidiaDevicePlugin) Start ¶
func (p *NvidiaDevicePlugin) Start() error
Start mainly starts the gRPC server and register the device plugin to Kubelet
func (*NvidiaDevicePlugin) Stop ¶
func (p *NvidiaDevicePlugin) Stop() error
Click to show internal directories.
Click to hide internal directories.