cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OptimisticLockErrorMsg = "the object has been modified; please apply your changes to the latest version and try again"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceInfo

type DeviceInfo struct {
	// contains filtered or unexported fields
}

func (*DeviceInfo) GetPods

func (d *DeviceInfo) GetPods() []*v1.Pod

func (*DeviceInfo) GetTotalGPUMemory

func (d *DeviceInfo) GetTotalGPUMemory() uint

func (*DeviceInfo) GetUsedGPUMemory

func (d *DeviceInfo) GetUsedGPUMemory() (gpuMem uint)

type NodeInfo

type NodeInfo struct {
	// contains filtered or unexported fields
}

NodeInfo is node level aggregated information.

func NewNodeInfo

func NewNodeInfo(node *v1.Node) *NodeInfo

Create Node Level

func (*NodeInfo) Allocate

func (n *NodeInfo) Allocate(clientset *kubernetes.Clientset, pod *v1.Pod) (err error)

func (*NodeInfo) Assume

func (n *NodeInfo) Assume(pod *v1.Pod) (allocatable bool)

check if the pod can be allocated on the node

func (*NodeInfo) GetDevs

func (n *NodeInfo) GetDevs() []*DeviceInfo

func (*NodeInfo) GetGPUCount

func (n *NodeInfo) GetGPUCount() int

func (*NodeInfo) GetName

func (n *NodeInfo) GetName() string

func (*NodeInfo) GetNode

func (n *NodeInfo) GetNode() *v1.Node

func (*NodeInfo) GetTotalGPUMemory

func (n *NodeInfo) GetTotalGPUMemory() int

type SchedulerCache

type SchedulerCache struct {
	// contains filtered or unexported fields
}

func NewSchedulerCache

func NewSchedulerCache(nLister corelisters.NodeLister, pLister corelisters.PodLister) *SchedulerCache

func (*SchedulerCache) AddOrUpdatePod

func (cache *SchedulerCache) AddOrUpdatePod(pod *v1.Pod) error

func (*SchedulerCache) BuildCache

func (cache *SchedulerCache) BuildCache() error

build cache when initializing

func (*SchedulerCache) GetNodeInfo

func (cache *SchedulerCache) GetNodeInfo(name string) (*NodeInfo, error)

Get or build nodeInfo if it doesn't exist

func (*SchedulerCache) GetNodeinfos

func (cache *SchedulerCache) GetNodeinfos() []*NodeInfo

func (*SchedulerCache) GetPod

func (cache *SchedulerCache) GetPod(name, namespace string) (*v1.Pod, error)

func (*SchedulerCache) KnownPod

func (cache *SchedulerCache) KnownPod(podUID types.UID) bool

Get known pod from the pod UID

func (*SchedulerCache) RemovePod

func (cache *SchedulerCache) RemovePod(pod *v1.Pod)

The lock is in cacheNode

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL