Documentation ¶
Index ¶
- Constants
- Variables
- type DeviceInfo
- type DeviceInfoBrief
- type GpuNodeInfo
- func (n *GpuNodeInfo) Allocate(clientset *kubernetes.Clientset, pod *v1.Pod) (err error)
- func (n *GpuNodeInfo) AllocateGpuId(pod *v1.Pod) (candDevId string, found bool)
- func (n *GpuNodeInfo) Assume(pod *v1.Pod) (allocatable bool)
- func (n *GpuNodeInfo) ExportGpuNodeInfoAsNodeGpuInfo() *NodeGpuInfo
- func (n *GpuNodeInfo) GetDevByDevId(devId int) (*DeviceInfo, bool)
- func (n *GpuNodeInfo) GetDevs() []*DeviceInfo
- func (n *GpuNodeInfo) GetGpuCount() int
- func (n *GpuNodeInfo) GetName() string
- func (n *GpuNodeInfo) GetNode() *v1.Node
- func (n *GpuNodeInfo) GetTotalGpuMemory() int64
- func (n *GpuNodeInfo) Reset(node *v1.Node)
- type NodeGpuInfo
- type NodePodGetter
- type SchedulerCache
- func (cache *SchedulerCache) AddOrUpdatePod(pod *v1.Pod) error
- func (cache *SchedulerCache) BuildCacheFromPodList(podList []*v1.Pod) error
- func (cache *SchedulerCache) ExportGpuNodeInfoAsNodeGpuInfo(nodeName string) (*NodeGpuInfo, error)
- func (cache *SchedulerCache) GetGpuNodeInfo(name string) (*GpuNodeInfo, error)
- func (cache *SchedulerCache) GetGpuNodeinfos() []*GpuNodeInfo
- func (cache *SchedulerCache) GetPod(name, namespace string) (*v1.Pod, error)
- func (cache *SchedulerCache) KnownPod(podUID types.UID) bool
- func (cache *SchedulerCache) RemovePod(pod *v1.Pod)
Constants ¶
View Source
const (
OptimisticLockErrorMsg = "the object has been modified; please apply your changes to the latest version and try again"
)
Variables ¶
View Source
var ( ConfigMapLister corelisters.ConfigMapLister ConfigMapInformerSynced clientgocache.InformerSynced )
Functions ¶
This section is empty.
Types ¶
type DeviceInfo ¶
type DeviceInfo struct {
// contains filtered or unexported fields
}
func (*DeviceInfo) ExportDeviceInfoBrief ¶
func (d *DeviceInfo) ExportDeviceInfoBrief() *DeviceInfoBrief
func (*DeviceInfo) GetPods ¶
func (d *DeviceInfo) GetPods() []*v1.Pod
func (*DeviceInfo) GetTotalGpuMemory ¶
func (d *DeviceInfo) GetTotalGpuMemory() int64
func (*DeviceInfo) GetUsedGpuMemory ¶
func (d *DeviceInfo) GetUsedGpuMemory() (gpuMem int64)
type DeviceInfoBrief ¶
type GpuNodeInfo ¶
type GpuNodeInfo struct {
// contains filtered or unexported fields
}
GpuNodeInfo is node level aggregated information.
func NewGpuNodeInfo ¶
func NewGpuNodeInfo(node *v1.Node) *GpuNodeInfo
NewGpuNodeInfo creates Node Level
func (*GpuNodeInfo) Allocate ¶
func (n *GpuNodeInfo) Allocate(clientset *kubernetes.Clientset, pod *v1.Pod) (err error)
func (*GpuNodeInfo) AllocateGpuId ¶
func (n *GpuNodeInfo) AllocateGpuId(pod *v1.Pod) (candDevId string, found bool)
AllocateGpuId is the key of GPU allocating; it assigns the GPU ID to the pod
func (*GpuNodeInfo) Assume ¶
func (n *GpuNodeInfo) Assume(pod *v1.Pod) (allocatable bool)
Assume checks if the pod can be allocated on the node
func (*GpuNodeInfo) ExportGpuNodeInfoAsNodeGpuInfo ¶
func (n *GpuNodeInfo) ExportGpuNodeInfoAsNodeGpuInfo() *NodeGpuInfo
func (*GpuNodeInfo) GetDevByDevId ¶
func (n *GpuNodeInfo) GetDevByDevId(devId int) (*DeviceInfo, bool)
func (*GpuNodeInfo) GetDevs ¶
func (n *GpuNodeInfo) GetDevs() []*DeviceInfo
func (*GpuNodeInfo) GetGpuCount ¶
func (n *GpuNodeInfo) GetGpuCount() int
func (*GpuNodeInfo) GetName ¶
func (n *GpuNodeInfo) GetName() string
func (*GpuNodeInfo) GetNode ¶
func (n *GpuNodeInfo) GetNode() *v1.Node
func (*GpuNodeInfo) GetTotalGpuMemory ¶
func (n *GpuNodeInfo) GetTotalGpuMemory() int64
func (*GpuNodeInfo) Reset ¶
func (n *GpuNodeInfo) Reset(node *v1.Node)
Reset only updates the devices when the length of devs is 0
type NodeGpuInfo ¶
type NodePodGetter ¶
type SchedulerCache ¶
type SchedulerCache struct {
// contains filtered or unexported fields
}
func NewSchedulerCache ¶
func NewSchedulerCache(getter NodePodGetter) *SchedulerCache
func (*SchedulerCache) AddOrUpdatePod ¶
func (cache *SchedulerCache) AddOrUpdatePod(pod *v1.Pod) error
func (*SchedulerCache) BuildCacheFromPodList ¶
func (cache *SchedulerCache) BuildCacheFromPodList(podList []*v1.Pod) error
func (*SchedulerCache) ExportGpuNodeInfoAsNodeGpuInfo ¶
func (cache *SchedulerCache) ExportGpuNodeInfoAsNodeGpuInfo(nodeName string) (*NodeGpuInfo, error)
func (*SchedulerCache) GetGpuNodeInfo ¶
func (cache *SchedulerCache) GetGpuNodeInfo(name string) (*GpuNodeInfo, error)
Get or build nodeInfo if it doesn't exist
func (*SchedulerCache) GetGpuNodeinfos ¶
func (cache *SchedulerCache) GetGpuNodeinfos() []*GpuNodeInfo
func (*SchedulerCache) GetPod ¶
func (cache *SchedulerCache) GetPod(name, namespace string) (*v1.Pod, error)
func (*SchedulerCache) KnownPod ¶
func (cache *SchedulerCache) KnownPod(podUID types.UID) bool
KnownPod Get known pod from the pod UID
func (*SchedulerCache) RemovePod ¶
func (cache *SchedulerCache) RemovePod(pod *v1.Pod)
The lock is in cacheNode
Click to show internal directories.
Click to hide internal directories.