Skip to content

fix: add ResourceStrategyFit plugin - #4391

Merged
Monokaix merged 1 commit into
volcano-sh:masterfrom
LY-today:node-resource-fit-plus
Jul 10, 2025
Merged

Monokaix merged 1 commit into
volcano-sh:masterfrom
LY-today:node-resource-fit-plus

Conversation

@LY-today

@LY-today LY-today commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

@volcano-sh-bot volcano-sh-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 23, 2025
@LY-today

Copy link
Copy Markdown
Contributor Author

@JesseStutler please check

Comment thread pkg/scheduler/plugins/node-resource-fit-plus/node_resource_fit_plus.go Outdated
Comment thread pkg/scheduler/plugins/node-resource-fit-plus/node_resource_fit_plus.go Outdated

@JesseStutler JesseStutler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also add a design doc, state the design concept of the plugin, how to use it, and how to choose between it and binpack, there needs to be a best practice.

Comment thread pkg/scheduler/plugins/node-resource-fit-plus/node_resource_fit_plus.go Outdated
Comment thread pkg/scheduler/plugins/node-resource-fit-plus/node_resource_fit_plus.go Outdated
Comment thread pkg/scheduler/plugins/node-resource-fit-plus/node_resource_fit_plus.go Outdated
Comment thread pkg/scheduler/plugins/node-resource-fit-plus/node_resource_fit_plus.go Outdated
Comment thread pkg/scheduler/plugins/node-resource-fit-plus/node_resource_fit_plus.go Outdated
@LY-today

Copy link
Copy Markdown
Contributor Author

Should also add a design doc, state the design concept of the plugin, how to use it, and how to choose between it and binpack, there needs to be a best practice.

get

@volcano-sh-bot volcano-sh-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 27, 2025
@LY-today

Copy link
Copy Markdown
Contributor Author

Should also add a design doc, state the design concept of the plugin, how to use it, and how to choose between it and binpack, there needs to be a best practice.

get

@JesseStutler The design has been supplemented, which includes a scarce resource avoidance strategy, and Jinshan students can adjust it later.

Comment thread pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit_test.go Outdated
Comment thread pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit_test.go Outdated
Comment thread pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit_test.go Outdated
Comment thread pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit.go Outdated
Comment thread docs/design/images/resource_strategy_fit.png Outdated
Comment thread docs/design/resource-strategy-fit-scheduling.md Outdated
Comment thread docs/design/resource-strategy-fit-scheduling.md Outdated
Comment thread docs/design/resource-strategy-fit-scheduling.md Outdated
Comment thread docs/design/resource-strategy-fit-scheduling.md
@LY-today

LY-today commented Jul 1, 2025

Copy link
Copy Markdown
Contributor Author

@JesseStutler hi,Any further adjustments needed?

Comment thread docs/design/resource-strategy-fit-scheduling.md Outdated
Comment thread docs/design/images/aggregated-or-dispersed-scheduler.png Outdated
@JesseStutler

Copy link
Copy Markdown
Member

/cc @lowang-bh @Monokaix

@Monokaix
Monokaix requested a review from Copilot July 1, 2025 08:25
Comment thread docs/design/resource-strategy-fit-scheduling.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new scheduler plugin (resource-strategy-fit) that allows per-resource aggregation or dispersion strategies with weights, including tests and documentation, and registers it in the plugin factory.

  • Introduce resource-strategy-fit plugin implementation and its configuration parsing
  • Add extensive unit tests covering scoring logic
  • Register plugin in factory.go and update design docs

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit.go Plugin implementation, argument parsing, and scoring
pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit_test.go Unit tests for weight calculation and scoring logic
pkg/scheduler/plugins/factory.go Plugin registration in factory
docs/design/resource-strategy-fit-scheduling.md Design documentation for the new plugin
Comments suppressed due to low confidence (3)

pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit.go:61

  • The parameter name aruguments is misspelled. Rename it to arguments for clarity and consistency.
func New(aruguments framework.Arguments) framework.Plugin {

pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit.go:85

  • The argument key resourceStrategyFitWeight is not consistent with tests that use ResourceStrategyFitPlusWeight. Align the key name between code, tests, and documentation to avoid confusion.
	resourceStrategyFitPluginWeight, b := framework.Get[int](args, "resourceStrategyFitWeight")

pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit_test.go:478

  • The error message references mostRequestedScore() in the test for leastRequestedScore. Update the message to the correct function name.
				t.Errorf("mostRequestedScore() error = %v, wantErr %v", err, tt.wantErr)

Comment thread pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit.go Outdated
Comment thread pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit_test.go Outdated
@JesseStutler

Copy link
Copy Markdown
Member

Please also change the title to ResourceStrategyFit, thanks

Comment thread pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit_test.go Outdated
@LY-today LY-today changed the title fix: add noderesourcefitplus plugin fix: add ResourceStrategyFit plugin Jul 1, 2025
@LY-today

LY-today commented Jul 1, 2025

Copy link
Copy Markdown
Contributor Author

也请将标题更改为ResourceStrategyFit,谢谢

done

@volcano-sh-bot volcano-sh-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 1, 2025
@LY-today

LY-today commented Jul 9, 2025

Copy link
Copy Markdown
Contributor Author

@JesseStutler @Monokaix Just rebased the latest branch, please re-lgtm

@JesseStutler JesseStutler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2025
@LY-today

LY-today commented Jul 9, 2025

Copy link
Copy Markdown
Contributor Author

/lgtm

cc:@Monokaix

Comment thread pkg/scheduler/plugins/resource-strategy-fit/resource_strategy_fit.go Outdated
@volcano-sh-bot volcano-sh-bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 10, 2025
@volcano-sh-bot

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

@LY-today
LY-today force-pushed the node-resource-fit-plus branch from 5794b54 to be6b3ba Compare July 10, 2025 02:46
@Monokaix

Copy link
Copy Markdown
Member

/approve

@volcano-sh-bot

Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2025
Signed-off-by: LY-today <724102053@qq.com>
@LY-today
LY-today force-pushed the node-resource-fit-plus branch from be6b3ba to d43a885 Compare July 10, 2025 06:00
@LY-today

LY-today commented Jul 10, 2025

Copy link
Copy Markdown
Contributor Author

@JesseStutler @Monokaix
Hello, I just rebased the latest master branch. If everyone has no problem, let's speed up the progress. Thank you.

@JesseStutler JesseStutler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@JesseStutler

Copy link
Copy Markdown
Member

/lgtm

@Monokaix
Monokaix enabled auto-merge (rebase) July 10, 2025 07:14
@Monokaix
Monokaix disabled auto-merge July 10, 2025 07:15
@Monokaix
Monokaix merged commit 0280981 into volcano-sh:master Jul 10, 2025
@JesseStutler

Copy link
Copy Markdown
Member

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 the ResourceStrategyFit plugin, a valuable addition that allows for configuring different scheduling strategies per resource type. The implementation is well-structured and the overall approach is sound.

My review feedback primarily focuses on improving the accuracy of the design documentation, correcting several issues in the test suite (including incorrect argument keys and flawed test logic), and making minor refinements to the plugin code for better clarity and robustness. Addressing these points will ensure the new feature is well-documented and thoroughly validated.

Comment thread docs/design/resource-strategy-fit-scheduling.md
@JesseStutler

Copy link
Copy Markdown
Member

@LY-today Could you fix these issues as gemini's suggestion?

@LY-today

Copy link
Copy Markdown
Contributor Author

@LY-today Could you fix these issues as gemini's suggestion?

Of course, good standards make good community projects.

@LY-today

Copy link
Copy Markdown
Contributor Author

@JesseStutler Resubmit PR?

@JesseStutler

Copy link
Copy Markdown
Member

@JesseStutler Resubmit PR?

Just open a new PR :) This PR is closed already

@LY-today

Copy link
Copy Markdown
Contributor Author

@JesseStutler Resubmit PR?

Just open a new PR :) This PR is closed already

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants