-
Notifications
You must be signed in to change notification settings - Fork 1.2k
add nodegroup nonstrict to fit 0nodes queue #4602
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
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.
Summary of Changes
Hello @wuyueandrew, 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 enhances the nodegroup scheduler plugin by introducing a configurable "nonstrict" mode. This mode modifies the behavior of queue-group affinity checks and scoring, making the scheduler more resilient to scenarios where queues might not have strictly defined node group affiliations, particularly for queues that might temporarily or permanently have zero associated nodes.
Highlights
- New Configuration Option: Introduced a "nonstrict" boolean configuration option for the
nodegroupplugin, allowing for more flexible handling of node group affinities. - Predicate Logic Adjustment: Modified the
predicatefunction withinqueueGroupAffinityto bypass strict group requirements whennonstrictmode is enabled, preventing tasks from being unschedulable if a queue has no associated groups. - Scoring Behavior Modification: Adjusted the
scorefunction to assign a specific negative score (-2) whennonstrictmode is active and a queue has no associated nodes, influencing scheduling decisions.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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 a nonstrict mode to the nodegroup plugin, allowing queues to schedule on nodes without explicit affinity, which is useful for queues that might not have dedicated nodes. The implementation is straightforward, but I've identified a significant pre-existing bug in the predicate logic that is exacerbated by this change. Additionally, I've provided some suggestions to improve code clarity. A crucial omission is the lack of unit tests for the new nonstrict functionality; adding tests would be essential to ensure correctness and prevent future regressions.
| flag := false | ||
| if nonstrict { | ||
| flag = true | ||
| } |
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.
| return nodeScore | ||
| } | ||
| if nonstrict { | ||
| nodeScore = -2 |
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.
| if len(queue) == 0 { | ||
| return nodeScore | ||
| } | ||
| if nonstrict { |
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.
ut needed.
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.
ut done
1a29cc5 to
d9a22ce
Compare
|
/lgtm |
| type nodeGroupPlugin struct { | ||
| // Arguments given for the plugin | ||
| pluginArguments framework.Arguments | ||
| nonstrict bool |
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 prefer to set a strict flag instead of nonstricet, which is more understandable, and it's defaut value is true.
|
And please also update the ndoegroup design doc to include this parameter and merge to one commit is OK. |
4abb45d to
e731d50
Compare
|
New changes are detected. LGTM label has been removed. |
done |
e731d50 to
fe24f30
Compare
2356df9 to
d33ea69
Compare
|
/approve |
| // New function returns prioritize plugin object. | ||
| func New(arguments framework.Arguments) framework.Plugin { | ||
| return &nodeGroupPlugin{pluginArguments: arguments} | ||
| nodeGroupPlugin := &nodeGroupPlugin{pluginArguments: arguments, strict: true} |
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 think we should also update nodegroup plugin user guide? But we will release v1.13.0 soon, if you have limit time to update it, you can also seperate in the other PR @wuyueandrew
Signed-off-by: wuyue <[email protected]>
d33ea69 to
dfd2b80
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Monokaix 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 |
| - name: predicates | ||
| - name: proportion | ||
| - name: nodegroup | ||
| strict: false |
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 think it's
- name: nodegroup
arguments:
strict: false
|
|
||
| ### Nodegroup Plugin Strict Configuration | ||
|
|
||
| Strict is a switch to specific behavior of unset affinity queue. If `strict: false`, workload assigned to a unset affinity queue could be scheduled to Node with empty label `volcano.sh/nodegroup-name`. Otherwise, workload cannot be scheduled. |
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.
Seems that it's if the node doesn't have the "volcano.sh/nodegroup-name" label or the queue doesn't set affinity ?
| if np.strict || !unsetAffinity { | ||
| return newFitErr(task, node, errNodeGroupLabelNotFound) | ||
| } else { | ||
| return nil | ||
| } |
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.
| if np.strict || !unsetAffinity { | |
| return newFitErr(task, node, errNodeGroupLabelNotFound) | |
| } else { | |
| return nil | |
| } | |
| if np.strict || !unsetAffinity { | |
| return newFitErr(task, node, errNodeGroupLabelNotFound) | |
| } | |
| return nil |
| } else { | ||
| return nil | ||
| } |
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.
| } else { | |
| return nil | |
| } | |
| } | |
| return nil | |
| } else { | ||
| return nil | ||
| } |
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.
| } else { | |
| return nil | |
| } | |
| return nil | |
|
@kingeasternsun @Monokaix Consider we need to release new version asap and @wuyueandrew has no time currently, I have made a new PR and we can merge that #4652 |
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #4528
Special notes for your reviewer:
Does this PR introduce a user-facing change?