Documentation ¶
Index ¶
- Constants
- Variables
- func CreateDockerClient(endpoint string) libdocker.Interface
- func GetCheckpointData(devicePluginPath string) (*types.Checkpoint, error)
- func GetContainerIndexByName(pod *v1.Pod, containerName string) (int, error)
- func GetGPUData(annotations map[string]string) (gpuUtil int64, gpuMemory int64, deviceNames []string)
- func GetGPUMinorID(path string) (int, error)
- func GetGPUResourceOfContainer(container *v1.Container, resourceName v1.ResourceName) uint
- func GetGPUResourceOfPod(pod *v1.Pod, resourceName v1.ResourceName) uint
- func GetPredicateTimeOfPod(pod *v1.Pod) (predicateTime uint64)
- func IsGPUAssignedPod(pod *v1.Pod) bool
- func IsGPUPredicatedPod(pod *v1.Pod) (predicated bool)
- func IsGPURequiredContainer(c *v1.Container) bool
- func IsGPURequiredPod(pod *v1.Pod) bool
- func IsStringSliceEqual(a, b []string) bool
- func IsValidGPUPath(path string) bool
- func MakeContainerNamePrefix(containerName string) string
- func NewCgroupProcs(cgroupMountPoint, cgroupDriver string) *linuxCgroupProcs
- func NewFSWatcher(files ...string) (*fsnotify.Watcher, error)
- func ShouldDelete(pod *v1.Pod) bool
- func ShouldRetry(err error) bool
- func TruncateContainerName(name string) string
- func UnixDial(addr string, timeout time.Duration) (net.Conn, error)
- func WaitForServer(socket string) error
- type CgroupProcsReader
- type CgroupProcsWriter
Constants ¶
View Source
const (
TruncateLen = 31
)
constants used in this package
Variables ¶
View Source
var ( //DefaultDialOptions contains default dial options used in grpc dial DefaultDialOptions = []grpc.DialOption{grpc.WithInsecure(), grpc.WithDialer(UnixDial), grpc.WithBlock()} )
Functions ¶
func CreateDockerClient ¶
func GetCheckpointData ¶
func GetCheckpointData(devicePluginPath string) (*types.Checkpoint, error)
func GetContainerIndexByName ¶
func GetGPUData ¶
func GetGPUData(annotations map[string]string) (gpuUtil int64, gpuMemory int64, deviceNames []string)
GetGPUData get cores, memory and device names from annotations
func GetGPUMinorID ¶
GetGPUMinorID returns id in Nvidia GPU device path
func GetGPUResourceOfContainer ¶
func GetGPUResourceOfContainer(container *v1.Container, resourceName v1.ResourceName) uint
func GetGPUResourceOfPod ¶
func GetGPUResourceOfPod(pod *v1.Pod, resourceName v1.ResourceName) uint
func GetPredicateTimeOfPod ¶
func IsGPUAssignedPod ¶
Check if pod has already been assigned
func IsGPUPredicatedPod ¶
func IsGPURequiredContainer ¶
func IsGPURequiredPod ¶
func IsStringSliceEqual ¶
func IsValidGPUPath ¶
IsValidGPUPath checks if path is valid Nvidia GPU device path
func MakeContainerNamePrefix ¶
func NewCgroupProcs ¶
func NewCgroupProcs(cgroupMountPoint, cgroupDriver string) *linuxCgroupProcs
func NewFSWatcher ¶
NewFSWatcher returns a file watcher created by fsnotify.NewWatcher
func ShouldDelete ¶
func ShouldRetry ¶
func TruncateContainerName ¶
TruncateContainerName truncate container names to name[:TruncateLen] if len(name) > TruncateLen
func WaitForServer ¶
WaitForServer checks if grpc server is alive by making grpc blocking connection to the server socket
Types ¶
type CgroupProcsReader ¶
type CgroupProcsWriter ¶
Click to show internal directories.
Click to hide internal directories.