scheduling

package
v0.3.67-rc-ed0ecaf Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateNodeTypeAllocations

func AggregateNodeTypeAllocations(nodes []api.NodeInfo) []*nodeTypeAllocation

AggregateNodeTypeAllocations computes the total available resources for each node type.

func CalculatePriorityUpdate

func CalculatePriorityUpdate(
	resourceScarcity map[string]float64,
	previousReport *api.ClusterUsageReport,
	report *api.ClusterUsageReport,
	previousPriority map[string]float64,
	halfTime time.Duration,
) map[string]float64

func CalculateQueuesPriorityInfo

func CalculateQueuesPriorityInfo(
	clusterPriorities map[string]map[string]float64,
	activeClusterReports map[string]*api.ClusterUsageReport,
	queues []*api.Queue,
) map[*api.Queue]QueuePriorityInfo

func CombineLeasedReportResourceByQueue

func CombineLeasedReportResourceByQueue(reports map[string]*api.ClusterLeasedReport) map[string]armadaresource.ComputeResources

func CreateClusterLeasedReport

func CreateClusterLeasedReport(clusterId string, currentReport *api.ClusterLeasedReport, additionallyLeasedJobs []*api.Job) *api.ClusterLeasedReport

func CreateClusterSchedulingInfoReport

func CreateClusterSchedulingInfoReport(leaseRequest *api.StreamingLeaseRequest, nodeAllocations []*nodeTypeAllocation) *api.ClusterSchedulingInfoReport

func FilterActiveClusterSchedulingInfoReports

func FilterActiveClusterSchedulingInfoReports(reports map[string]*api.ClusterSchedulingInfoReport) map[string]*api.ClusterSchedulingInfoReport

FilterActiveClusterSchedulingInfoReports returns the subset of reports within the expiry time.

func FilterActiveClusters

func FilterActiveClusters(reports map[string]*api.ClusterUsageReport) map[string]*api.ClusterUsageReport

FilterActiveClusters returns the subset of reports corresponding to active clusters. A cluster is considered active if the most recent ClusterUsageReport was received less than activeClusterExpiry ago.

func FilterClusterLeasedReports

func FilterClusterLeasedReports(ids []string, reports map[string]*api.ClusterLeasedReport) map[string]*api.ClusterLeasedReport

FilterClusterLeasedReports returns the subset of reports with id in the provided slice of ids. ids for which there is no corresponding report are ignored.

func FilterPoolClusters

func FilterPoolClusters(pool string, reports map[string]*api.ClusterUsageReport) map[string]*api.ClusterUsageReport

FilterPoolClusters returns the subset of reports for which the pool has a specific value.

func GetClusterReportIds

func GetClusterReportIds(reports map[string]*api.ClusterUsageReport) []string

GetClusterReportIds returns a slice composed of all unique report ids in the provided map.

func GroupByPool

func GroupByPool(reports map[string]*api.ClusterUsageReport) map[string]map[string]*api.ClusterUsageReport

GroupByPool returns a map from pool name to another map, which in turn maps report ids to reports.

func GroupSchedulingInfoByPool

func GroupSchedulingInfoByPool(reports map[string]*api.ClusterSchedulingInfoReport) map[string]map[string]*api.ClusterSchedulingInfoReport

GroupSchedulingInfoByPool returns a map from pool name to another map, which in turn maps report ids to reports.

func MatchSchedulingRequirements

func MatchSchedulingRequirements(
	job *api.Job,
	schedulingInfo *api.ClusterSchedulingInfoReport,
) (bool, error)

func MatchSchedulingRequirementsOnAnyCluster

func MatchSchedulingRequirementsOnAnyCluster(
	job *api.Job,
	allClusterSchedulingInfos map[string]*api.ClusterSchedulingInfoReport,
) (bool, error)

MatchSchedulingRequirementsOnAnyCluster returns true if the provided job can be scheduled. If returning false, the reason for not being able to schedule the pod is indicated by the returned error, which is of type *armadaerrors.ErrPodUnschedulable.

func ResourceScarcityFromReports

func ResourceScarcityFromReports(reports map[string]*api.ClusterUsageReport) map[string]float64

func ResourcesAsUsage

func ResourcesAsUsage(resourceScarcity map[string]float64, resources armadaresource.ComputeResources) float64

Types

type LeaseManager

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

func NewLeaseManager

func NewLeaseManager(
	jobRepository repository.JobRepository,
	queueRepository repository.QueueRepository,
	eventStore repository.EventStore,
	leaseExpiryDuration time.Duration,
) *LeaseManager

func (*LeaseManager) ExpireLeases

func (l *LeaseManager) ExpireLeases()

type PodMatchingContext

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

func NewPodMatchingContext

func NewPodMatchingContext(podSpec *v1.PodSpec) *PodMatchingContext

func (*PodMatchingContext) Matches

func (podCtx *PodMatchingContext) Matches(nodeType *api.NodeType, availableResources armadaresource.ComputeResourcesFloat) (bool, error)

type QueuePriorityInfo

type QueuePriorityInfo struct {
	Priority     float64
	CurrentUsage armadaresource.ComputeResources
}

Jump to

Keyboard shortcuts

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