deviceplugin

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckPointFileName = "kubelet_internal_checkpoint"

	ContainerNameLabelKey = "io.kubernetes.container.name"
	PodNamespaceLabelKey  = "io.kubernetes.pod.namespace"
	PodNameLabelKey       = "io.kubernetes.pod.name"
	PodUIDLabelKey        = "io.kubernetes.pod.uid"
)
View Source
const (
	HostProcPath             = "/proc"
	ManagerDirectoryPath     = "/etc/vgpu-manager"
	ContainerConfigPath      = ManagerDirectoryPath + "/config"
	ContainerProcPath        = ManagerDirectoryPath + "/host_proc"
	ContainerCgroupPath      = ManagerDirectoryPath + "/host_cgroup"
	LdPreLoadFileName        = "ld.so.preload"
	ContainerPreloadPath     = "/etc/" + LdPreLoadFileName
	HostPreloadPath          = ManagerDirectoryPath + "/" + LdPreLoadFileName
	VGPUControlFileName      = "libvgpu-control.so"
	ContainerVGPUControlPath = ManagerDirectoryPath + "/driver/" + VGPUControlFileName
	HostVGPUControlPath      = ManagerDirectoryPath + "/" + VGPUControlFileName
	VGPUConfigFileName       = "vgpu.config"
	DeviceListFileName       = "devices.json"

	NvidiaDeviceFilePrefix = "/dev/nvidia"
	NvidiaCTLFilePath      = "/dev/nvidiactl"
	NvidiaUVMFilePath      = "/dev/nvidia-uvm"
	NvidiaUVMToolsFilePath = "/dev/nvidia-uvm-tools"
)

Variables

This section is empty.

Functions

func CycleCleanupNodeResources

func CycleCleanupNodeResources(kubeClient *kubernetes.Clientset, nodeName string, resources []string)

CycleCleanupNodeResources Loop cleaning until the resource names on the node are completely deleted.

func GetDeviceMinorMap

func GetDeviceMinorMap(gpus []manager.GPUDevice) map[string]int

func GetHostManagerDirectoryPath

func GetHostManagerDirectoryPath(podUID types.UID, containerName string) string

Types

type Checkpoint

type Checkpoint struct {
	PodDeviceEntries  []PodDevicesEntry
	RegisteredDevices map[string][]string
}

func GetCheckpointData

func GetCheckpointData(devicePluginPath string) (*Checkpoint, error)

type CheckpointData

type CheckpointData struct {
	Data *Checkpoint `json:"Data"`
}

type CheckpointDataNUMA

type CheckpointDataNUMA struct {
	Data *CheckpointNUMA `json:"Data"`
}

type CheckpointNUMA

type CheckpointNUMA struct {
	PodDeviceEntries  []PodDevicesEntryNUMA
	RegisteredDevices map[string][]string
}

type DevicePlugin

type DevicePlugin interface {
	pluginapi.DevicePluginServer
	// Name return device plugin name.
	Name() string
	// Start the plugin.
	Start() error
	// Stop the plugin.
	Stop() error
	// Devices return device list.
	Devices() []*pluginapi.Device
}

func InitDevicePlugins

func InitDevicePlugins(opt *options.Options, devManager *manager.DeviceManager,
	clusterManager ctrm.Manager, kubeClient *kubernetes.Clientset) []DevicePlugin

func NewVCoreDevicePlugin

func NewVCoreDevicePlugin(resourceName, socket string, manager *manager.DeviceManager) DevicePlugin

NewVCoreDevicePlugin returns an initialized vcoreDevicePlugin

func NewVMemoryDevicePlugin

func NewVMemoryDevicePlugin(resourceName, socket string, manager *manager.DeviceManager) DevicePlugin

NewVMemoryDevicePlugin returns an initialized vmemoryDevicePlugin

func NewVNumberDevicePlugin

func NewVNumberDevicePlugin(resourceName, socket string, manager *manager.DeviceManager,
	kubeClient *kubernetes.Clientset, cache cache.Cache) DevicePlugin

NewVNumberDevicePlugin returns an initialized vnumberDevicePlugin

type DevicesPerNUMA

type DevicesPerNUMA map[int64][]string

type PodDevicesEntry

type PodDevicesEntry struct {
	PodUID        string
	ContainerName string
	ResourceName  string
	DeviceIDs     []string
	AllocResp     []byte
}

type PodDevicesEntryNUMA

type PodDevicesEntryNUMA struct {
	PodUID        string
	ContainerName string
	ResourceName  string
	DeviceIDs     DevicesPerNUMA
	AllocResp     []byte
}

Jump to

Keyboard shortcuts

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