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 GetNodeList(nodes map[string]*api.NodeInfo) []*api.NodeInfo
- func PredicateNodes(task *api.TaskInfo, nodes []*api.NodeInfo, fn api.PredicateFn) []*api.NodeInfo
- func SelectBestNode(priorityList HostPriorityList) string
- func SortNodes(priorityList HostPriorityList, nodesInfo map[string]*api.NodeInfo) []*api.NodeInfo
- type FakeBinder
- type FakeEvictor
- type FakeStatusUpdater
- type FakeVolumeBinder
- type HostPriority
- type HostPriorityList
- type PriorityQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPod ¶ added in v0.5.0
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 ¶ added in v0.5.0
func BuildResourceList(cpu string, memory string) v1.ResourceList
BuildResourceList builts resource list object
func BuildResourceListWithGPU ¶ added in v0.5.0
func BuildResourceListWithGPU(cpu string, memory string, GPU string) v1.ResourceList
BuildResourceListWithGPU builts resource list with GPU
func GetNodeList ¶ added in v0.5.0
GetNodeList returns values of the map 'nodes'
func PredicateNodes ¶ added in v0.5.0
PredicateNodes returns nodes that fit task
func SelectBestNode ¶ added in v0.4.1
func SelectBestNode(priorityList HostPriorityList) string
SelectBestNode returns best node whose score is highest, pick one randomly if there are many nodes with same score.
Types ¶
type FakeBinder ¶ added in v0.5.0
FakeBinder is used as fake binder
type FakeEvictor ¶ added in v0.5.0
FakeEvictor is used as fake evictor
type FakeStatusUpdater ¶ added in v0.5.0
type FakeStatusUpdater struct { }
FakeStatusUpdater is used for fake status update
func (*FakeStatusUpdater) UpdatePodCondition ¶ added in v0.5.0
func (ftsu *FakeStatusUpdater) UpdatePodCondition(pod *v1.Pod, podCondition *v1.PodCondition) (*v1.Pod, error)
UpdatePodCondition is a empty function
func (*FakeStatusUpdater) UpdatePodGroup ¶ added in v0.5.0
UpdatePodGroup is a empty function
type FakeVolumeBinder ¶ added in v0.5.0
type FakeVolumeBinder struct { }
FakeVolumeBinder is used as fake volume binder
func (*FakeVolumeBinder) AllocateVolumes ¶ added in v0.5.0
func (fvb *FakeVolumeBinder) AllocateVolumes(task *api.TaskInfo, hostname string) error
AllocateVolumes is a empty function
func (*FakeVolumeBinder) BindVolumes ¶ added in v0.5.0
func (fvb *FakeVolumeBinder) BindVolumes(task *api.TaskInfo) error
BindVolumes is a empty function
type HostPriority ¶ added in v0.5.0
type HostPriority struct { // Name of the host Host string // Score associated with the host Score float64 }
HostPriority represents the priority of scheduling to a particular host, higher priority is better.
type HostPriorityList ¶ added in v0.5.0
type HostPriorityList []HostPriority
HostPriorityList declares a []HostPriority type.
func PrioritizeNodes ¶ added in v0.5.0
func PrioritizeNodes( task *api.TaskInfo, filterNodes []*api.NodeInfo, priorityConfigs []algorithm.PriorityConfig, ) (HostPriorityList, error)
PrioritizeNodes returns a map whose key is node's score and value are corresponding nodes
func (HostPriorityList) Len ¶ added in v0.5.0
func (h HostPriorityList) Len() int
func (HostPriorityList) Less ¶ added in v0.5.0
func (h HostPriorityList) Less(i, j int) bool
func (HostPriorityList) Swap ¶ added in v0.5.0
func (h HostPriorityList) Swap(i, j int)
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