context

package
v0.3.66-rc-7909614 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GangSchedulingContext

type GangSchedulingContext struct {
	Created               time.Time
	Queue                 string
	PriorityClassName     string
	JobSchedulingContexts []*JobSchedulingContext
	TotalResourceRequests schedulerobjects.ResourceList
}

func NewGangSchedulingContext

func NewGangSchedulingContext(jctxs []*JobSchedulingContext) *GangSchedulingContext

func (GangSchedulingContext) PodRequirements

func (gctx GangSchedulingContext) PodRequirements() []*schedulerobjects.PodRequirements

type JobSchedulingContext

type JobSchedulingContext struct {
	// Time at which this context was created.
	Created time.Time
	// Executor this job was attempted to be assigned to.
	ExecutorId string
	// Total number of nodes in the cluster when trying to schedule.
	NumNodes int
	// Id of the job this pod corresponds to.
	JobId string
	// Job spec.
	Job interfaces.LegacySchedulerJob
	// Scheduling requirements of this job.
	// We currently require that each job contains exactly one pod spec.
	Req *schedulerobjects.PodRequirements
	// Reason for why the job could not be scheduled.
	// Empty if the job was scheduled successfully.
	UnschedulableReason string
	// Pod scheduling contexts for the individual pods that make up the job.
	PodSchedulingContext *PodSchedulingContext
}

JobSchedulingContext is created by the scheduler and contains information about the decision made by the scheduler for a particular job.

func (*JobSchedulingContext) IsSuccessful

func (jctx *JobSchedulingContext) IsSuccessful() bool

func (*JobSchedulingContext) String

func (jctx *JobSchedulingContext) String() string

type PodSchedulingContext

type PodSchedulingContext struct {
	// Time at which this context was created.
	Created time.Time
	// Node the pod was assigned to.
	// If nil, the pod could not be assigned to any node.
	Node *schedulerobjects.Node
	// Score indicates how well the pod fits on the selected node.
	Score int
	// Node types on which this pod could be scheduled.
	MatchingNodeTypes []*schedulerobjects.NodeType
	// Total number of nodes in the cluster when trying to schedule.
	NumNodes int
	// Number of nodes excluded by reason.
	NumExcludedNodesByReason map[string]int
}

PodSchedulingContext is returned by SelectAndBindNodeToPod and contains detailed information on the scheduling decision made for this pod.

func (*PodSchedulingContext) String

func (pctx *PodSchedulingContext) String() string

type QueueSchedulingContext

type QueueSchedulingContext struct {
	// Time at which this context was created.
	Created time.Time
	// Executor this job was attempted to be assigned to.
	ExecutorId string
	// Queue name.
	Queue string
	// These factors influence the fraction of resources assigned to each queue.
	PriorityFactor float64
	// Allowed priority classes.
	PriorityClasses map[string]configuration.PriorityClass
	// Total resources assigned to the queue across all clusters.
	// Including jobs scheduled during this invocation of the scheduler.
	AllocatedByPriority schedulerobjects.QuantityByPriorityAndResourceType
	// Resources assigned to this queue during this scheduling cycle.
	ScheduledResourcesByPriority schedulerobjects.QuantityByPriorityAndResourceType
	EvictedResourcesByPriority   schedulerobjects.QuantityByPriorityAndResourceType
	// Job scheduling contexts associated with successful scheduling attempts.
	SuccessfulJobSchedulingContexts map[string]*JobSchedulingContext
	// Job scheduling contexts associated with unsuccessful scheduling attempts.
	UnsuccessfulJobSchedulingContexts map[string]*JobSchedulingContext
	// Jobs evicted in this round.
	EvictedJobsById map[string]interfaces.LegacySchedulerJob
}

QueueSchedulingContext captures the decisions made by the scheduler during one invocation for a particular queue.

func NewQueueSchedulingContext

func NewQueueSchedulingContext(
	queue,
	executorId string,
	priorityFactor float64,
	priorityClasses map[string]configuration.PriorityClass,
	initialAllocatedByPriority schedulerobjects.QuantityByPriorityAndResourceType,
) *QueueSchedulingContext

func (*QueueSchedulingContext) AddGangSchedulingContext

func (qctx *QueueSchedulingContext) AddGangSchedulingContext(gctx *GangSchedulingContext)

func (*QueueSchedulingContext) AddJobSchedulingContext

func (qctx *QueueSchedulingContext) AddJobSchedulingContext(jctx *JobSchedulingContext) bool

AddJobSchedulingContext adds a job scheduling context. Automatically updates scheduled resources.

func (*QueueSchedulingContext) ClearJobSpecs

func (qctx *QueueSchedulingContext) ClearJobSpecs()

ClearJobSpecs zeroes out job specs to reduce memory usage.

func (*QueueSchedulingContext) EvictJob

func (*QueueSchedulingContext) String

func (qctx *QueueSchedulingContext) String() string

TODO: Update with preemptions.

type SchedulingContext

type SchedulingContext struct {
	// Time at which the scheduling cycle started.
	Started time.Time
	// Time at which the scheduling cycle finished.
	Finished time.Time
	// Executor for which we're currently scheduling jobs.
	ExecutorId string
	// Resource pool of this executor.
	Pool string
	// Allowed priority classes.
	PriorityClasses map[string]configuration.PriorityClass
	// Default priority class.
	DefaultPriorityClass string
	// Weights used when computing total resource usage.
	ResourceScarcity map[string]float64
	// Per-queue scheduling contexts.
	QueueSchedulingContexts map[string]*QueueSchedulingContext
	// Total resources across all clusters available at the start of the scheduling cycle.
	TotalResources schedulerobjects.ResourceList
	// Resources assigned across all queues during this scheduling cycle.
	ScheduledResourcesByPriority schedulerobjects.QuantityByPriorityAndResourceType
	// Resources evicted across all queues during this scheduling cycle.
	EvictedResourcesByPriority schedulerobjects.QuantityByPriorityAndResourceType
	// Total number of successfully scheduled jobs.
	NumScheduledJobs int
	// Total number of successfully scheduled gangs.
	NumScheduledGangs int
	// Reason for why the scheduling round finished.
	TerminationReason string
}

SchedulingContext contains information necessary for scheduling and records what happened in a scheduling round.

func NewSchedulingContext

func NewSchedulingContext(
	executorId string,
	pool string,
	priorityClasses map[string]configuration.PriorityClass,
	defaultPriorityClass string,
	resourceScarcity map[string]float64,
	priorityFactorByQueue map[string]float64,
	totalResources schedulerobjects.ResourceList,
	initialAllocatedByQueueAndPriority map[string]schedulerobjects.QuantityByPriorityAndResourceType,
) *SchedulingContext

func (*SchedulingContext) AddGangSchedulingContext

func (sctx *SchedulingContext) AddGangSchedulingContext(gctx *GangSchedulingContext) bool

func (*SchedulingContext) AddJobSchedulingContext

func (sctx *SchedulingContext) AddJobSchedulingContext(jctx *JobSchedulingContext) bool

AddJobSchedulingContext adds a job scheduling context. Automatically updates scheduled resources.

func (*SchedulingContext) AllocatedByQueueAndPriority

func (sctx *SchedulingContext) AllocatedByQueueAndPriority() map[string]schedulerobjects.QuantityByPriorityAndResourceType

AllocatedByQueueAndPriority returns map from queue name and priority to resources allocated.

func (*SchedulingContext) ClearJobSpecs

func (sctx *SchedulingContext) ClearJobSpecs()

ClearJobSpecs zeroes out job specs to reduce memory usage.

func (*SchedulingContext) EvictGang

func (sctx *SchedulingContext) EvictGang(jobs []interfaces.LegacySchedulerJob) bool

func (*SchedulingContext) EvictJob

func (*SchedulingContext) String

func (sctx *SchedulingContext) String() string

func (*SchedulingContext) SuccessfulJobSchedulingContexts

func (sctx *SchedulingContext) SuccessfulJobSchedulingContexts() []*JobSchedulingContext

Jump to

Keyboard shortcuts

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