Documentation ¶
Index ¶
- func BuildNode(name string, alloc v1.ResourceList, labels map[string]string) *v1.Node
- func BuildPod(namespace, name, nodename string, p v1.PodPhase, req v1.ResourceList, ...) *v1.Pod
- func BuildResourceList(cpu string, memory string) v1.ResourceList
- func BuildResourceListWithGPU(cpu string, memory string, GPU string) v1.ResourceList
- func CalculateNumOfFeasibleNodesToFind(numAllNodes int32) (numNodes int32)
- func GetMinInt(vals ...int) int
- func GetNodeList(nodes map[string]*api.NodeInfo, nodeList []string) []*api.NodeInfo
- func PrioritizeNodes(task *api.TaskInfo, nodes []*api.NodeInfo, batchFn api.BatchNodeOrderFn, ...) map[float64][]*api.NodeInfo
- func SelectBestNode(nodeScores map[float64][]*api.NodeInfo) *api.NodeInfo
- func SortNodes(nodeScores map[float64][]*api.NodeInfo) []*api.NodeInfo
- func ValidateVictims(preemptor *api.TaskInfo, node *api.NodeInfo, victims []*api.TaskInfo) error
- type FakeBinder
- type FakeEvictor
- type FakeStatusUpdater
- type FakeVolumeBinder
- func (fvb *FakeVolumeBinder) AllocateVolumes(task *api.TaskInfo, hostname string, podVolumes *volumescheduling.PodVolumes) error
- func (fvb *FakeVolumeBinder) BindVolumes(task *api.TaskInfo, podVolumes *volumescheduling.PodVolumes) error
- func (fvb *FakeVolumeBinder) GetPodVolumes(task *api.TaskInfo, node *v1.Node) (*volumescheduling.PodVolumes, error)
- type PredicateHelper
- type PriorityQueue
- type ResourceReservation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPod ¶
func BuildPod(namespace, name, nodename string, p v1.PodPhase, req v1.ResourceList, groupName string, labels map[string]string, selector map[string]string) *v1.Pod
BuildPod builts Pod object
func BuildResourceList ¶
func BuildResourceList(cpu string, memory string) v1.ResourceList
BuildResourceList builts resource list object
func BuildResourceListWithGPU ¶
func BuildResourceListWithGPU(cpu string, memory string, GPU string) v1.ResourceList
BuildResourceListWithGPU builts resource list with GPU
func CalculateNumOfFeasibleNodesToFind ¶
CalculateNumOfFeasibleNodesToFind returns the number of feasible nodes that once found, the scheduler stops its search for more feasible nodes.
func GetNodeList ¶
GetNodeList returns values of the map 'nodes'
func PrioritizeNodes ¶
func PrioritizeNodes(task *api.TaskInfo, nodes []*api.NodeInfo, batchFn api.BatchNodeOrderFn, mapFn api.NodeOrderMapFn, reduceFn api.NodeOrderReduceFn) map[float64][]*api.NodeInfo
PrioritizeNodes returns a map whose key is node's score and value are corresponding nodes
func SelectBestNode ¶
SelectBestNode returns best node whose score is highest, pick one randomly if there are many nodes with same score.
Types ¶
type FakeBinder ¶
FakeBinder is used as fake binder
func (*FakeBinder) Bind ¶
func (fb *FakeBinder) Bind(kubeClient *kubernetes.Clientset, tasks []*api.TaskInfo) ([]*api.TaskInfo, error)
Bind used by fake binder struct to bind pods
type FakeEvictor ¶
type FakeEvictor struct { sync.Mutex Channel chan string // contains filtered or unexported fields }
FakeEvictor is used as fake evictor
func (*FakeEvictor) Evict ¶
func (fe *FakeEvictor) Evict(p *v1.Pod, reason string) error
Evict is used by fake evictor to evict pods
func (*FakeEvictor) Evicts ¶
func (fe *FakeEvictor) Evicts() []string
Evicts returns copy of evicted pods.
type FakeStatusUpdater ¶
type FakeStatusUpdater struct { }
FakeStatusUpdater is used for fake status update
func (*FakeStatusUpdater) UpdatePodCondition ¶
func (ftsu *FakeStatusUpdater) UpdatePodCondition(pod *v1.Pod, podCondition *v1.PodCondition) (*v1.Pod, error)
UpdatePodCondition is a empty function
func (*FakeStatusUpdater) UpdatePodGroup ¶
UpdatePodGroup is a empty function
type FakeVolumeBinder ¶
type FakeVolumeBinder struct { }
FakeVolumeBinder is used as fake volume binder
func (*FakeVolumeBinder) AllocateVolumes ¶
func (fvb *FakeVolumeBinder) AllocateVolumes(task *api.TaskInfo, hostname string, podVolumes *volumescheduling.PodVolumes) error
AllocateVolumes is a empty function
func (*FakeVolumeBinder) BindVolumes ¶
func (fvb *FakeVolumeBinder) BindVolumes(task *api.TaskInfo, podVolumes *volumescheduling.PodVolumes) error
BindVolumes is a empty function
func (*FakeVolumeBinder) GetPodVolumes ¶ added in v1.3.0
func (fvb *FakeVolumeBinder) GetPodVolumes(task *api.TaskInfo, node *v1.Node) (*volumescheduling.PodVolumes, error)
GetPodVolumes is a empty function
type PredicateHelper ¶ added in v1.5.0
type PredicateHelper interface {
PredicateNodes(task *api.TaskInfo, nodes []*api.NodeInfo, fn api.PredicateFn) ([]*api.NodeInfo, *api.FitErrors)
}
func NewPredicateHelper ¶ added in v1.5.0
func NewPredicateHelper() PredicateHelper
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
PriorityQueue implements a scheduling queue.
func NewPriorityQueue ¶
func NewPriorityQueue(lessFn api.LessFn) *PriorityQueue
NewPriorityQueue returns a PriorityQueue
func (*PriorityQueue) Pop ¶
func (q *PriorityQueue) Pop() interface{}
Pop pops element in the priority Queue
func (*PriorityQueue) Push ¶
func (q *PriorityQueue) Push(it interface{})
Push pushes element in the priority Queue
type ResourceReservation ¶ added in v1.1.0
ResourceReservation is struct used for resource reservation
var Reservation *ResourceReservation
Reservation is used to record target job and locked nodes
func NewResourceReservation ¶ added in v1.1.0
func NewResourceReservation() *ResourceReservation
NewResourceReservation is used to create global instance