-
Notifications
You must be signed in to change notification settings - Fork 1k
Implements maxAvailableComponentSets for accurate estimator #6876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements maxAvailableComponentSets for accurate estimator #6876
Conversation
Summary of ChangesHello @mszacillo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant feature to the estimator, allowing it to accurately determine the maximum number of multi-component sets that can be scheduled across various clusters. This enhancement is crucial for advanced resource allocation and scheduling decisions, providing a more granular and comprehensive view of cluster capacity beyond single replica estimations. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request implements the maxAvailableComponentSets functionality for the accurate estimator, which is a great addition. The changes are well-structured, with corresponding client and server implementations, as well as metrics.
My review focuses on a couple of points in the server-side estimation logic. I've identified a potential bug where the estimation would always return zero, and a minor naming issue that could affect code clarity. The proposed suggestions aim to fix the bug and improve maintainability. Overall, this is a solid contribution.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6876 +/- ##
==========================================
- Coverage 46.24% 46.14% -0.11%
==========================================
Files 692 692
Lines 47194 47288 +94
==========================================
- Hits 21826 21819 -7
- Misses 23715 23816 +101
Partials 1653 1653
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f9c29e1 to
ed013e5
Compare
|
@RainbowMango @zhzhuang-zju @seanlaii Should be ready for review! |
RainbowMango
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/assign
RainbowMango
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
| // toPBReplicaRequirements converts the API ComponentReplicaRequirements to the pb.ReplicaRequirements value. | ||
| func toPBReplicaRequirements(cr *workv1alpha2.ComponentReplicaRequirements, namespace string) pb.ReplicaRequirements { | ||
| var out pb.ReplicaRequirements | ||
| out.Namespace = namespace | ||
| if cr == nil { | ||
| return out | ||
| } | ||
| out.ResourceRequest = cr.ResourceRequest | ||
| out.PriorityClassName = cr.PriorityClassName | ||
| if cr.NodeClaim != nil { | ||
| out.NodeClaim = &pb.NodeClaim{ | ||
| NodeAffinity: cr.NodeClaim.HardNodeAffinity, | ||
| NodeSelector: cr.NodeClaim.NodeSelector, | ||
| Tolerations: cr.NodeClaim.Tolerations, | ||
| } | ||
| } | ||
| return out | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct and not a blocker. But we should give it another look at the definition of the gRPC data structure. The conversion should be more straightforward.
@seanlaii Do you have any idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS:
I added a follow-up task to #6734 for revising the design here.
Signed-off-by: mszacillo <[email protected]>
ed013e5 to
621f845
Compare
RainbowMango
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@zhzhuang-zju Can you help look at the failing tests? |
|
Failed Test Scenario: Event Timeline from Logs:
In [BeforeEach] at: /home/runner/work/karmada/karmada/test/e2e/suites/base/federatedresourcequota_test.go:349 @ 10/28/25 04:28:13.927Summary: Is this a bug? Can the test be hardened? /retest |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Implements maxAvailableComponentSets for the accurate estimator. I have a follow-up commented as a TODO in the implementation for the conversion of the node resource estimation into a plugin.
Which issue(s) this PR fixes:
Part of #6734
Special notes for your reviewer:
Tested E2E using code from #6857. At the moment the estimator returns 0 for the component set estimation, but this is expected since I have not linked this together with the resourcequota plugin (which is under review).
Does this PR introduce a user-facing change?: