Repository navigation
tas: preserve grouped leader placement capacity - #13383
kubernetes-prow[bot] merged 4 commits into
Conversation
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
📝 WalkthroughWalkthroughTAS grouped PodSet placement now incorporates leader capacity during domain selection, topology descent, and capacity consumption. Five table-driven scenarios validate leader and worker assignments across hostname, slice, preferred, mixed-profile, and below-slice constraints. ChangesTAS grouped placement
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant findTopologyAssignment
participant findBestFitDomainBy
participant prioritizeLeaderDomain
participant consumeWithLeadersGeneric
findTopologyAssignment->>findBestFitDomainBy: select domain with sufficient leader capacity
findTopologyAssignment->>prioritizeLeaderDomain: order fitting domains for leader placement
prioritizeLeaderDomain->>consumeWithLeadersGeneric: consume leader-adjusted capacity
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @YQ-Wang. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
/retest |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/cache/scheduler/tas_flavor_snapshot.go`:
- Around line 1362-1386: The fallback in findBestFitDomainBy must not select a
domain with domain.leaderState below leaderCount when no candidate meets the
state requirement. Preserve the already-selected leader-feasible domain from the
caller or otherwise pass it into this selection path, and return it instead of
candidates[0] whenever the affinity-tier candidates exclude all leader-feasible
domains.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 79aeb670-33e7-45a5-b0fb-5748d8916a0c
📒 Files selected for processing (3)
pkg/cache/scheduler/tas_cache_test.gopkg/cache/scheduler/tas_flavor_snapshot.gopkg/cache/scheduler/tas_flavor_snapshot_grouped_placement_test.go
|
cc @pajakd ptal |
|
/area tas |
|
/release-note-edit |
|
/lgtm |
|
@mimowo: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
LGTM label has been added. DetailsGit tree hash: 8590618300c96866ce84dcc5e811a1be880bec54 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mimowo, YQ-Wang The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@mimowo: new pull request created: #13766 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@mimowo: new pull request created: #13767 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
TAS summarizes grouped PodSet capacity using the smallest leader-placement penalty among the available domains. During downward assignment, however, the leader domain was selected from the existing worker-capacity order without checking that its penalty fit within the available worker slack. This could consume more capacity than the summary accounted for, leave worker pods unassigned, and return an empty topology assignment even though a feasible placement existed.
This change preserves that summarized invariant during domain selection and hierarchy descent. It prioritizes a leader-capable domain only when its capacity penalty fits within the available slack, applies the same constraint to BestFit and LeastFreeCapacity selection, and uses one consistent partial-consumption path for sliced and non-sliced assignments.
The regression scenario has three hosts with worker capacities 2, 4, and 3, one 1-CPU leader, and four 2-CPU workers. The leader is placed on the 3-capacity host, allowing the workers to be assigned 1/2/1 across the hosts.
AI assistance was used to help implement and review this change. The author reviewed and tested the resulting code and takes responsibility for it.
Which issue(s) this PR fixes:
Fixes #7446
Special notes for your reviewer:
Validation completed:
gofmtcheck on all changed Go filesgit diff --check HEADgo test -race ./pkg/cache/scheduler -run 'TestFindTopologyAssignments|TestFindLevelWithFitDomainsPreservesFeasibleGroupedPlacements|TestUpdateCountsToMinimumGenericPreservesFeasibleGroupedPlacements' -count=1go test ./pkg/cache/... ./pkg/scheduler/...go vet ./pkg/cache/... ./pkg/scheduler/...remainingCount: 1, while the patched controller admitted the workload in one scheduling cycle and reserved all nine CPU slots. Restoring the patched image after the base reproduction admitted the workload again.make verifycould not be run locally because this macOS environment does not have GNUsed; the directly relevant formatting, unit, race, and vet checks above all passed.Does this PR introduce a user-facing change?
Summary by CodeRabbit