deviceplugin

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: Apache-2.0 Imports: 34 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 (
	VGPUConfigDirName        = "config"
	HostProcDirectoryPath    = "/proc"
	ContManagerDirectoryPath = "/etc/vgpu-manager"
	ContConfigDirectoryPath  = ContManagerDirectoryPath + "/" + VGPUConfigDirName
	ContProcDirectoryPath    = ContManagerDirectoryPath + "/.host_proc"
	ContCGroupDirectoryPath  = ContManagerDirectoryPath + "/.host_cgroup"

	VGPULockDirName  = "vgpu_lock"
	ContVGPULockPath = "/tmp/." + VGPULockDirName

	LdPreLoadFileName       = "ld.so.preload"
	ContPreLoadFilePath     = "/etc/" + LdPreLoadFileName
	VGPUControlFileName     = "libvgpu-control.so"
	ContVGPUControlFilePath = ContManagerDirectoryPath + "/driver/" + VGPUControlFileName

	VGPUConfigFileName = "vgpu.config"
	DeviceListFileName = "devices.json"

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

Variables

View Source
var (
	HostManagerDirectoryPath = os.Getenv("HOST_MANAGER_DIR")
	HostPreLoadFilePath      = HostManagerDirectoryPath + "/" + LdPreLoadFileName
	HostVGPUControlFilePath  = HostManagerDirectoryPath + "/" + VGPUControlFileName
)

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 GetContManagerDirectoryPath added in v0.3.0

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

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