constraints

package
v0.3.66-rc-5cc1afb Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	UnschedulableReasonMaximumNumberOfJobsScheduled  = "maximum number of jobs scheduled"
	UnschedulableReasonMaximumNumberOfGangsScheduled = "maximum number of gangs scheduled"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PriorityClassSchedulingConstraints

type PriorityClassSchedulingConstraints struct {
	PriorityClassName     string
	PriorityClassPriority int32
	// Prevents jobs of this priority class from being scheduled if doing so would exceed
	// cumulative resource usage at priority priorityClassPriority for the queue the job originates from.
	//
	// Cumulative resource usage at priority x includes resources allocated to jobs of priorityClassPriority x or lower.
	MaximumCumulativeResourceFractionPerQueue map[string]float64
}

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.
	MaxLookbackPerQueue 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
	// Per-queue resource limits.
	// Map from resource type to the limit for that resource.
	//
	// TODO: Remove
	MaximalResourceFractionPerQueue map[string]float64
	// Scheduling constraints for specific priority classes.
	PriorityClassSchedulingConstraintsByPriorityClassName map[string]PriorityClassSchedulingConstraints
	// Max resources to schedule per queue at a time.
	MaximalResourceFractionToSchedulePerQueue map[string]float64
	// Max resources to schedule at a time.
	MaximalResourceFractionToSchedule map[string]float64
}

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

func SchedulingConstraintsFromSchedulingConfig

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

func (*SchedulingConstraints) CheckGlobalConstraints

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

func (*SchedulingConstraints) CheckPerQueueAndPriorityClassConstraints

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

Jump to

Keyboard shortcuts

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