Documentation
¶
Index ¶
- Constants
- Variables
- func CheckHealth(devType string, n *corev1.Node) (bool, bool)
- func DecodeNodeDevices(str string) ([]*api.DeviceInfo, error)
- func EncodeContainerDeviceType(cd ContainerDevices, t string) string
- func EncodeContainerDevices(cd ContainerDevices) string
- func EncodeNodeDevices(dlist []*api.DeviceInfo) string
- func EncodePodDevices(checklist map[string]string, pd PodDevices) map[string]string
- func EncodePodSingleDevice(pd PodSingleDevice) string
- func EraseNextDeviceTypeFromAnnotation(dtype string, p corev1.Pod) error
- func GetAllocatePodByNode(ctx context.Context, nodeName string) (*corev1.Pod, error)
- func GetContainerDeviceStrArray(c ContainerDevices) []string
- func GetNode(nodename string) (*corev1.Node, error)
- func GetPendingPod(ctx context.Context, node string) (*corev1.Pod, error)
- func InitKlogFlags() *flag.FlagSet
- func MarkAnnotationsToDelete(devType string, nn string) error
- func MarshalNodeDevices(dlist []*api.DeviceInfo) string
- func PatchNodeAnnotations(node *corev1.Node, annotations map[string]string) error
- func PatchPodAnnotations(pod *corev1.Pod, annotations map[string]string) error
- func UnMarshalNodeDevices(str string) ([]*api.DeviceInfo, error)
- type ContainerDevice
- type ContainerDeviceRequest
- type ContainerDeviceRequests
- type ContainerDevices
- type DeviceConfig
- type DeviceInfo
- type DevicePluginConfigs
- type DeviceUsage
- type NodeInfo
- type PodDeviceRequests
- type PodDevices
- type PodSingleDevice
Constants ¶
View Source
const ( //ResourceName = "nvidia.com/gpu" //ResourceName = "hami.io/vgpu". AssignedTimeAnnotations = "hami.io/vgpu-time" AssignedNodeAnnotations = "hami.io/vgpu-node" BindTimeAnnotations = "hami.io/bind-time" DeviceBindPhase = "hami.io/bind-phase" DeviceBindAllocating = "allocating" DeviceBindFailed = "failed" DeviceBindSuccess = "success" DeviceLimit = 100 BestEffort string = "best-effort" Restricted string = "restricted" Guaranteed string = "guaranteed" // NodeNameEnvName define env var name for use get node name. NodeNameEnvName = "NODE_NAME" )
View Source
const ( // OneContainerMultiDeviceSplitSymbol this is when one container use multi device, use : symbol to join device info. OneContainerMultiDeviceSplitSymbol = ":" // OnePodMultiContainerSplitSymbol this is when one pod having multi container and more than one container use device, use ; symbol to join device info. OnePodMultiContainerSplitSymbol = ";" )
Variables ¶
Functions ¶
func DecodeNodeDevices ¶
func DecodeNodeDevices(str string) ([]*api.DeviceInfo, error)
func EncodeContainerDeviceType ¶
func EncodeContainerDeviceType(cd ContainerDevices, t string) string
func EncodeContainerDevices ¶
func EncodeContainerDevices(cd ContainerDevices) string
func EncodeNodeDevices ¶
func EncodeNodeDevices(dlist []*api.DeviceInfo) string
func EncodePodDevices ¶
func EncodePodDevices(checklist map[string]string, pd PodDevices) map[string]string
func EncodePodSingleDevice ¶
func EncodePodSingleDevice(pd PodSingleDevice) string
func GetAllocatePodByNode ¶
func GetContainerDeviceStrArray ¶
func GetContainerDeviceStrArray(c ContainerDevices) []string
func InitKlogFlags ¶
func MarkAnnotationsToDelete ¶
func MarshalNodeDevices ¶
func MarshalNodeDevices(dlist []*api.DeviceInfo) string
func PatchNodeAnnotations ¶
func PatchPodAnnotations ¶
func UnMarshalNodeDevices ¶
func UnMarshalNodeDevices(str string) ([]*api.DeviceInfo, error)
Types ¶
type ContainerDevice ¶
type ContainerDevice struct { // TODO current Idx cannot use, because EncodeContainerDevices method not encode this filed. Idx int UUID string Type string Usedmem int32 Usedcores int32 }
type ContainerDevices struct { Devices []string `json:"devices,omitempty"` }
type PodDevices struct { Containers []ContainerDevices `json:"containers,omitempty"` }
type ContainerDeviceRequest ¶
type ContainerDeviceRequests ¶
type ContainerDeviceRequests map[string]ContainerDeviceRequest
type ContainerDevices ¶
type ContainerDevices []ContainerDevice
func DecodeContainerDevices ¶
func DecodeContainerDevices(str string) (ContainerDevices, error)
func GetNextDeviceRequest ¶
type DeviceInfo ¶
type DevicePluginConfigs ¶
type DevicePluginConfigs struct { Nodeconfig []struct { Name string `json:"name"` Devicememoryscaling float64 `json:"devicememoryscaling"` Devicecorescaling float64 `json:"devicecorescaling"` Devicesplitcount uint `json:"devicesplitcount"` Migstrategy string `json:"migstrategy"` } `json:"nodeconfig"` }
type DeviceUsage ¶
type NodeInfo ¶
type NodeInfo struct { ID string Devices []DeviceInfo }
type PodDeviceRequests ¶
type PodDeviceRequests []ContainerDeviceRequests
type PodSingleDevice ¶
type PodSingleDevice []ContainerDevices
type ContainerAllDevices map[string]ContainerDevices.
Click to show internal directories.
Click to hide internal directories.