Documentation ¶
Index ¶
- func AggregateNodeTypeAllocations(nodes []api.NodeInfo) []*nodeTypeAllocation
- func CalculatePriorityUpdate(resourceScarcity map[string]float64, previousReport *api.ClusterUsageReport, ...) map[string]float64
- func CalculateQueuesPriorityInfo(clusterPriorities map[string]map[string]float64, ...) map[*api.Queue]QueuePriorityInfo
- func CombineLeasedReportResourceByQueue(reports map[string]*api.ClusterLeasedReport) map[string]armadaresource.ComputeResources
- func CreateClusterLeasedReport(clusterId string, currentReport *api.ClusterLeasedReport, ...) *api.ClusterLeasedReport
- func CreateClusterSchedulingInfoReport(leaseRequest *api.StreamingLeaseRequest, nodeAllocations []*nodeTypeAllocation) *api.ClusterSchedulingInfoReport
- func FilterActiveClusterSchedulingInfoReports(reports map[string]*api.ClusterSchedulingInfoReport) map[string]*api.ClusterSchedulingInfoReport
- func FilterActiveClusters(reports map[string]*api.ClusterUsageReport) map[string]*api.ClusterUsageReport
- func FilterClusterLeasedReports(ids []string, reports map[string]*api.ClusterLeasedReport) map[string]*api.ClusterLeasedReport
- func FilterPoolClusters(pool string, reports map[string]*api.ClusterUsageReport) map[string]*api.ClusterUsageReport
- func GetClusterReportIds(reports map[string]*api.ClusterUsageReport) []string
- func GroupByPool(reports map[string]*api.ClusterUsageReport) map[string]map[string]*api.ClusterUsageReport
- func GroupSchedulingInfoByPool(reports map[string]*api.ClusterSchedulingInfoReport) map[string]map[string]*api.ClusterSchedulingInfoReport
- func MatchSchedulingRequirements(job *api.Job, schedulingInfo *api.ClusterSchedulingInfoReport) (bool, error)
- func MatchSchedulingRequirementsOnAnyCluster(job *api.Job, ...) (bool, error)
- func ResourceScarcityFromReports(reports map[string]*api.ClusterUsageReport) map[string]float64
- func ResourcesAsUsage(resourceScarcity map[string]float64, resources armadaresource.ComputeResources) float64
- type LeaseManager
- type PodMatchingContext
- type QueuePriorityInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateNodeTypeAllocations ¶
AggregateNodeTypeAllocations computes the total available resources for each node type.
func CalculatePriorityUpdate ¶
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 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 }