kueue
kueue copied to clipboard
Fair share during admission
trafficstars
What type of PR is this?
What this PR does / why we need it:
Implements the concept of a "fair share" for a ClusterQueue or a ClusterQueue with an additional workload as defined in #1773:
For a given resource r provided by a ClusterQueue or cohort c, we calculate T_r as the total
requests consumed by the Workloads for that resource in that CQ or cohort, independent of the
flavor, that are above the nominal quota. The value for a resource is the ratio of T_r and the
total nominal quotas, or lendingLimits if defined, in the hierarchy of the parent of C.
The value for the CQ or cohort is the maximum among the values for each resource,
divided by the weight, if defined.
The fair share value is used for sorting the heads of the ClusterQueues during admission.
Which issue(s) this PR fixes:
Part of #1714
Special notes for your reviewer:
There is no API for this feature in this PR. That's because we don't want to release this behavior standalone, but accompany it with preemption support, which will come in a subsequent PR.
For reviewers convenience, I roughly divided the PR in 3 commits:
- Keeping stats for a ClusterQueue and cohort about total usage per resource and shareable resources.
- Calculate the share value for a ClusterQueue with or without a new workload
- Admission sorting + tests.
Does this PR introduce a user-facing change?
NONE