coscheduling

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the name of the plugin used in Registry and configurations.
	Name = "Coscheduling"
)

Variables

This section is empty.

Functions

func New

func New(obj runtime.Object, handle framework.Handle) (framework.Plugin, error)

New initializes and returns a new Coscheduling plugin.

Types

type Coscheduling

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

Coscheduling is a plugin that schedules pods in a group.

func (*Coscheduling) EventsToRegister

func (cs *Coscheduling) EventsToRegister() []framework.ClusterEvent

func (*Coscheduling) Less

func (cs *Coscheduling) Less(podInfo1, podInfo2 *framework.QueuedPodInfo) bool

Less is sorting pods in the scheduling queue in the following order. Firstly, compare the priorities of the two pods, the higher priority (if pod's priority is equal,then compare their KoordinatorPriority at labels )is at the front of the queue, Secondly, compare Gang group ID of the two pods, pods that NOT belong to a Gang will have higher priority than pods that belongs to a Gang, Thirdly, compare the creationTimestamp of two pods, if pod belongs to a Gang, then we compare creationTimestamp of the Gang, the one created first will be at the front of the queue Finally, compare pod's namespaced name.

func (*Coscheduling) Name

func (cs *Coscheduling) Name() string

Name returns name of the plugin. It is used in logs, etc.

func (*Coscheduling) NewControllers added in v1.0.0

func (cs *Coscheduling) NewControllers() ([]frameworkext.Controller, error)

func (*Coscheduling) Permit

func (cs *Coscheduling) Permit(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (*framework.Status, time.Duration)

Permit we will calculate all Gangs in GangGroup whether the current number of assumed-pods in each Gang meets the Gang's minimum requirement. and decide whether we should let the pod wait in Permit stage or let the whole gangGroup go binding

func (*Coscheduling) PostBind

func (cs *Coscheduling) PostBind(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeName string)

PostBind is called after a pod is successfully bound. These plugins are used update PodGroup when pod is bound.

func (*Coscheduling) PostFilter

func (cs *Coscheduling) PostFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, filteredNodeStatusMap framework.NodeToStatusMap) (*framework.PostFilterResult, *framework.Status)

PostFilter i. If strict-mode, we will set scheduleCycleValid to false and release all assumed pods. ii. If non-strict mode, we will do nothing.

func (*Coscheduling) PreFilter

PreFilter if non-strict-mode, we only do step1 and step2: i.Check whether childes in Gang has met the requirements of minimum number under each Gang, and reject the pod if negative. ii.Check whether the Gang has been timeout(check the pod's annotation,later introduced at Permit section) or is inited, and reject the pod if positive. iii.Check whether the Gang has met the scheduleCycleValid check, and reject the pod if negative. iv.Try update scheduleCycle, scheduleCycleValid, childrenScheduleRoundMap as mentioned above.

func (*Coscheduling) PreFilterExtensions

func (cs *Coscheduling) PreFilterExtensions() framework.PreFilterExtensions

PreFilterExtensions returns a PreFilterExtensions interface if the plugin implements one.

func (*Coscheduling) RegisterEndpoints

func (cs *Coscheduling) RegisterEndpoints(group *gin.RouterGroup)

func (*Coscheduling) Reserve

func (cs *Coscheduling) Reserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status

Reserve is the functions invoked by the framework at "reserve" extension point.

func (*Coscheduling) Unreserve

func (cs *Coscheduling) Unreserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string)

Unreserve i. handle the timeout gang ii. do nothing when bound failed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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