Documentation ¶
Index ¶
- Constants
- Variables
- func AssignedNonTerminatedPod(pod *v1.Pod) bool
- func GeneratePodKey(pod *v1.Pod) string
- func GeneratePodKeyByName(namespace, name string) string
- func GetCreationTimeFromPodAnnotation(p *v1.Pod) (t *time.Time)
- func GetDeletionTimeFromPodAnnotation(p *v1.Pod) (t *time.Time)
- func GetGpuAffinityFromPodAnnotation(p *v1.Pod) (affinity string)
- func GetGpuCountFromPodAnnotation(pod *v1.Pod) (gpuCount int)
- func GetGpuCountOfNode(node *v1.Node) int
- func GetGpuIdFromAnnotation(pod *v1.Pod) (id string)
- func GetGpuIdListFromAnnotation(pod *v1.Pod) (idl []int, err error)
- func GetGpuMilliFromPodAnnotation(pod *v1.Pod) (gpuMilli int64)
- func GetGpuMilliOfNode(node *v1.Node) int
- func GetGpuModelFromPodAnnotation(pod *v1.Pod) (gpuType string)
- func GetGpuModelOfNode(node *v1.Node) string
- func GpuIdStrToIntList(id string) (idl []int, err error)
- func IsCompletePod(pod *v1.Pod) bool
- func IsGpuSharingNode(node *v1.Node) bool
- func RemovePodDeviceAnnoSpec(oldPod *v1.Pod) (newPod *v1.Pod)
- func UpdatePodDeviceAnnoSpec(oldPod *v1.Pod, devId string) (newPod *v1.Pod)
Constants ¶
const ( ResourceName = "alibabacloud.com/gpu-milli" // GPU milli, i.e., 1000 == 1 GPU, for pod only, node is 1000 by default CountName = "alibabacloud.com/gpu-count" // GPU number request (or allocatable), for pod and node DeviceIndex = "alibabacloud.com/gpu-index" // Exists when the pod are assigned/predefined to a GPU device ModelName = "alibabacloud.com/gpu-card-model" // GPU card model, for pod and node AssumeTime = "alibabacloud.com/assume-time" // To retrieve the scheduling latency CreationTime = "alibabacloud.com/creation-time" // creation timestamp DeletionTime = "alibabacloud.com/deletion-time" // deletion timestamp PodNsNameSep = "/" DevIdSep = "-" MILLI = 1000 MaxSpecCpu = 128000 // CPU MILLI MaxSpecMem = 1048576 // Mem MiB MaxSpecGpu = 8000 // GPU MILLI NoGpuTag = "no-gpu" )
Variables ¶
var MapGpuTypeMemoryMiB = map[string]int64{ "P4": int64(7980711936 / 1024 / 1024), "2080": int64(11554258944 / 1024 / 1024), "1080": int64(11720982528 / 1024 / 1024), "M40": int64(12004098048 / 1024 / 1024), "T4": int64(15842934784 / 1024 / 1024), "V100M16": int64(16944988160 / 1024 / 1024), "P100": int64(17070817280 / 1024 / 1024), "A10": int64(23835181056 / 1024 / 1024), "3090": int64(25446842368 / 1024 / 1024), "V100M32": int64(34089205760 / 1024 / 1024), "A100": int64(85198045184 / 1024 / 1024), "G1": int64(1048576000 / 1024 / 1024), "G2": int64(20971520000 / 1024 / 1024), "G3": int64(31457280000 / 1024 / 1024), }
Functions ¶
func AssignedNonTerminatedPod ¶
AssignedNonTerminatedPod selects pods that are assigned and non-terminal (scheduled and running).
func GeneratePodKey ¶
func GeneratePodKeyByName ¶
func GetGpuAffinityFromPodAnnotation ¶
GetGpuAffinityFromPodAnnotation returns the gpu affinity of the pod
func GetGpuCountFromPodAnnotation ¶
GetGpuCountFromPodAnnotation gets the GPU Count of the pod
func GetGpuCountOfNode ¶
GetGpuCountOfNode Get the GPU count of the node
func GetGpuIdFromAnnotation ¶
GetGpuIdFromAnnotation gets GPU ID from Annotation, could be "1" or "0-1-2-3" for multi-GPU allocations
func GetGpuIdListFromAnnotation ¶
GetGpuIdListFromAnnotation gets GPU ID List from Annotation, could be [1] or [0, 1, 2, 3] for multi-GPU allocations
func GetGpuMilliFromPodAnnotation ¶
GetGpuMilliFromPodAnnotation gets the GPU (in Milli) of the pod, range: 0-1000
func GetGpuMilliOfNode ¶
GetGpuMilliOfNode Get the GPU Milli of the node (0-8000 at most)
func GetGpuModelOfNode ¶
GetGpuModelOfNode Get the GPU Model of the node, see MapGpuTypeMemoryMiB
func GpuIdStrToIntList ¶
GpuIdStrToIntList follows the string formed in func (n *GpuNodeInfo) AllocateGpuId
func IsCompletePod ¶
IsCompletePod determines if the pod is complete
func IsGpuSharingNode ¶
IsGpuSharingNode Is the Node for GPU sharing
Types ¶
This section is empty.