constraints

package
v0.4.41 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Indicates that the limit on resources scheduled per round has been exceeded.
	MaximumResourcesScheduledUnschedulableReason = "maximum resources scheduled"

	// Indicates that a queue has been assigned more than its allowed amount of resources.
	MaximumResourcesPerQueueExceededUnschedulableReason = "maximum total resources for this queue exceeded"

	// Indicates that the scheduling rate limit has been exceeded.
	GlobalRateLimitExceededUnschedulableReason = "global scheduling rate limit exceeded"
	QueueRateLimitExceededUnschedulableReason  = "queue scheduling rate limit exceeded"

	// Indicates that scheduling a gang would exceed the rate limit.
	GlobalRateLimitExceededByGangUnschedulableReason = "gang would exceed global scheduling rate limit"
	QueueRateLimitExceededByGangUnschedulableReason  = "gang would exceed queue scheduling rate limit"

	// Indicates that the number of jobs in a gang exceeds the burst size.
	// This means the gang can not be scheduled without first increasing the burst size.
	GangExceedsGlobalBurstSizeUnschedulableReason = "gang cardinality too large: exceeds global max burst size"
	GangExceedsQueueBurstSizeUnschedulableReason  = "gang cardinality too large: exceeds queue max burst size"

	UnschedulableReasonMaximumResourcesPerQueueExceeded = "per-queue resource limit exceeded"
	UnschedulableReasonMaximumResourcesExceeded         = "resource limit exceeded"
)

Variables

This section is empty.

Functions

func IsTerminalQueueUnschedulableReason added in v0.3.92

func IsTerminalQueueUnschedulableReason(reason string) bool

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

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 RequestsAreLargeEnough added in v0.3.92

func RequestsAreLargeEnough(totalResourceRequests, minRequest schedulerobjects.ResourceList) (bool, string)

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
	// 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 QueueSchedulingConstraints added in v0.4.29

type QueueSchedulingConstraints struct {
	// Scheduling constraints by priority class.
	PriorityClassSchedulingConstraintsByPriorityClassName map[string]PriorityClassSchedulingConstraints
}

QueueSchedulingConstraints contains per-queue scheduling constraints.

type SchedulingConstraints

type SchedulingConstraints struct {
	// 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 by priority class.
	PriorityClassSchedulingConstraintsByPriorityClassName map[string]PriorityClassSchedulingConstraints
	// Scheduling constraints for specific queues.
	// If present for a particular queue, global limits (i.e., PriorityClassSchedulingConstraintsByPriorityClassName)
	// do not apply for that queue.
	QueueSchedulingConstraintsByQueueName map[string]QueueSchedulingConstraints
	// Limits total resources scheduled per invocation.
	MaximumResourcesToSchedule schedulerobjects.ResourceList
}

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

func NewSchedulingConstraints added in v0.4.29

func NewSchedulingConstraints(
	pool string,
	totalResources schedulerobjects.ResourceList,
	minimumJobSize schedulerobjects.ResourceList,
	config configuration.SchedulingConfig,
	queues []queue.Queue,
) SchedulingConstraints

func (*SchedulingConstraints) CheckConstraints added in v0.3.92

func (*SchedulingConstraints) CheckRoundConstraints added in v0.3.66

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

Jump to

Keyboard shortcuts

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