-
Notifications
You must be signed in to change notification settings - Fork 1k
Add EstimateComponentsPlugins support to estimator framework
#6864
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
Conversation
Summary of ChangesHello @seanlaii, 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 significantly enhances the estimator framework by introducing a new plugin extension point for 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 introduces support for EstimateComponentsPlugins to the estimator framework, a valuable feature for customizing component scheduling logic. The implementation is well-aligned with the existing EstimateReplicasPlugins framework, covering new interfaces, framework logic, and metrics. The test coverage for the new functionality is also thorough. I have a couple of suggestions: one to clarify a comment in the new interface and another to fix a bug in a new test case related to loop variable capturing, which would improve the reliability of the tests. Overall, this is a solid contribution.
| // Emit metrics with both old and new labels for backward compatibility | ||
| // TODO: Remove estimator label in a future release (deprecated) | ||
| metrics.FrameworkExtensionPointDuration.WithLabelValues(estimator).Observe(utilmetrics.DurationInSeconds(startTime)) | ||
| metrics.FrameworkExtensionPointDuration.WithLabelValues(estimateReplicasExtension).Observe(utilmetrics.DurationInSeconds(startTime)) |
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.
Hi @RainbowMango ,
In order to differentiate the metrics between EstimateReplica and EstimateComponents plugins, I decided to introduce a new metrics with EstimateComponents label and plan to use EstimateReplica to replace the old Estimator label.
Additionally, to avoid breaking change I decided to emit the same metrics twice but with different label.
What do you think? I am OK with reusing Estimator but EstimateReplica might be clearer.
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.
I'm okay with introducing EstimateReplica to replace Estimator. However, if we proceed with this change, the release note should include an additional section on the deprecation of the existing metrics.
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.
I'm OK with this way by introducing a new metric to deprecate the old one.
+1 on the release note
In addition, I realized both the old and new label names are written in camel case, which is not recommended.
I failed to find some documentation about the naming rule, but there is a metrics linter in the Prometheus project:
https://github.com/RainbowMango/client_golang/blob/e729ba11961abb3a50910c324221d06a35bdce4f/prometheus/testutil/promlint/validations/generic_name_validations.go#L74-L89
PS: I introduced this tool to Kubernetes several years ago, but I didn't get a chance to do the same thing in Karmada. I think Karmada should adopt this tool as well.
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.
Thanks for the info! Updated the label values with snake case and the release note.
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.
In addition, I realized both the old and new label names are written in camel case, which is not recommended.
Hey, I need to correct my previous comment about the label format, according to the validation tools I linked above, only the label name should be written in snake_case. Actually, what we are talking about here is the value, I don't see any rules for it.
I see you updated the label value to snake_case, which also looks fine to me.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6864 +/- ##
==========================================
+ Coverage 45.63% 45.67% +0.04%
==========================================
Files 692 692
Lines 57703 57732 +29
==========================================
+ Hits 26331 26371 +40
+ Misses 29725 29716 -9
+ Partials 1647 1645 -2
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:
|
8f1b070 to
c8e9577
Compare
|
Thanks |
|
/lgtm |
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
Signed-off-by: seanlaii <qazwsx0939059006@gmail.com>
c8e9577 to
7df8e9e
Compare
|
/lgtm |
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.
/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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Add
EstimateComponentsPluginssupport to estimator framework to allow customizing scheduling logic for Components.Which issue(s) this PR fixes:
Part of #6734
Special notes for your reviewer:
Does this PR introduce a user-facing change?: