constraints

package
v0.3.84-rc-967ba1f Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnschedulableReasonMaximumResourcesScheduled        = "maximum resources scheduled"
	UnschedulableReasonMaximumNumberOfJobsScheduled     = "maximum number of jobs scheduled"
	UnschedulableReasonMaximumNumberOfGangsScheduled    = "maximum number of gangs scheduled"
	UnschedulableReasonMaximumResourcesPerQueueExceeded = "maximum total resources for this queue exceeded"
)

Variables

This section is empty.

Functions

func IsTerminalUnschedulableReason added in v0.3.66

func IsTerminalUnschedulableReason(reason string) bool

IsTerminalUnschedulableReason returns true if reason indicates it's not possible to schedule any more jobs in this round.

func ScaleQuantity added in v0.3.71

func ScaleQuantity(q resource.Quantity, f float64) resource.Quantity

ScaleQuantity scales q in-place by a factor f. This functions overflows for quantities the milli value of which can't be expressed as an int64. E.g., 1Pi is ok, but not 10Pi.

Types

type PriorityClassSchedulingConstraints

type PriorityClassSchedulingConstraints struct {
	PriorityClassName     string
	PriorityClassPriority int32
	// Limits total resources allocated to jobs of this priority class per queue.
	MaximumResourcesPerQueue schedulerobjects.ResourceList
}

PriorityClassSchedulingConstraints contains scheduling constraints that apply to jobs of a specific priority class.

type SchedulingConstraints

type SchedulingConstraints struct {
	// Max number of jobs to scheduler per lease jobs call.
	MaximumJobsToSchedule uint
	// Max number of jobs to scheduler per lease jobs call.
	MaximumGangsToSchedule uint
	// Max number of jobs to consider for a queue before giving up.
	MaxQueueLookback uint
	// Jobs leased to this executor must be at least this large.
	// Used, e.g., to avoid scheduling CPU-only jobs onto clusters with GPUs.
	MinimumJobSize schedulerobjects.ResourceList
	// Scheduling constraints for specific priority classes.
	PriorityClassSchedulingConstraintsByPriorityClassName map[string]PriorityClassSchedulingConstraints
	// Limits total resources scheduled per invocation.
	MaximumResourcesToSchedule schedulerobjects.ResourceList
}

SchedulingConstraints contains scheduling constraints, e.g., per-queue resource limits.

func SchedulingConstraintsFromSchedulingConfig

func SchedulingConstraintsFromSchedulingConfig(
	pool string,
	totalResources schedulerobjects.ResourceList,
	minimumJobSize schedulerobjects.ResourceList,
	config configuration.SchedulingConfig,
) SchedulingConstraints

func (*SchedulingConstraints) CheckPerQueueAndPriorityClassConstraints

func (constraints *SchedulingConstraints) CheckPerQueueAndPriorityClassConstraints(
	sctx *schedulercontext.SchedulingContext,
	queue string,
	priorityClassName string,
) (bool, string, error)

func (*SchedulingConstraints) CheckRoundConstraints added in v0.3.66

func (constraints *SchedulingConstraints) CheckRoundConstraints(sctx *schedulercontext.SchedulingContext) (bool, string, error)

Jump to

Keyboard shortcuts

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