Skip to content
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

adjust the Priority of General and Accurate Estimator of Karmada Scheduler #4398

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chaosi-zju
Copy link
Member

@chaosi-zju chaosi-zju commented Dec 11, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

If the accurate estimator is enabled and karmada-scheduler-estimator components also are enabled, the accurate estimator should be prior to ResourceModeling rather than using the minumal value of them.

Which issue(s) this PR fixes:

Fixes #3333

Special notes for your reviewer:

CC @lonelyCZ @whitewindmills

Does this PR introduce a user-facing change?:

introduced priority to schedule estimator so that higher-priority estimator can override the result given by lower-priority.

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 11, 2023
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 11, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2023

Codecov Report

Attention: 48 lines in your changes are missing coverage. Please review.

Comparison is base (697170b) 51.82% compared to head (2a208c7) 51.84%.
Report is 5 commits behind head on master.

Files Patch % Lines
pkg/descheduler/core/helper.go 0.00% 34 Missing ⚠️
pkg/scheduler/core/util.go 65.71% 7 Missing and 5 partials ⚠️
pkg/descheduler/descheduler.go 0.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4398      +/-   ##
==========================================
+ Coverage   51.82%   51.84%   +0.02%     
==========================================
  Files         244      246       +2     
  Lines       24238    24378     +140     
==========================================
+ Hits        12561    12639      +78     
- Misses      10995    11049      +54     
- Partials      682      690       +8     
Flag Coverage Δ
unittests 51.84% <34.24%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chaunceyjiang
Copy link
Member

Just a question, will this modification require compatibility? Will it force users to upgrade the Estimator component?

@chaosi-zju
Copy link
Member Author

will this modification require compatibility

I don't think it matters. What do you think?

Will it force users to upgrade the Estimator component

I think it's only about the scheduler, and doesn't require upgrading estimator

@jwcesign
Copy link
Member

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 14, 2023
@zhzhuang-zju
Copy link
Contributor

/lgtm

@chaosi-zju
Copy link
Member Author

CC @RainbowMango may be ready to merge, any further comments?

@RainbowMango RainbowMango added this to the v1.9 milestone Dec 15, 2023
@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 29, 2023
@chaosi-zju
Copy link
Member Author

@whitewindmills sorry for delayed a while, I have updated the code, do you have time checking once more?

@chaosi-zju chaosi-zju force-pushed the estimator-priority branch 3 times, most recently from b1f44ba to 842aef3 Compare January 2, 2024 11:43
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 2, 2024
@chaosi-zju
Copy link
Member Author

@whitewindmills @RainbowMango @Garrybest

I have improved the logic as:

  • priority is not declared by estimator itself, but by the function caller, just like:
// NewGeneralEstimator builds a new GeneralEstimator.
func NewGeneralEstimator(priority EstimatorPriority) *GeneralEstimator {
	return &GeneralEstimator{priority: priority}
}

// GetPriority return the priority of this estimator
func (ge *GeneralEstimator) GetPriority() EstimatorPriority {
	return ge.priority
}
  • If higher-priority estimators haven't given the result for certain member clusters, lower-priority estimator only continue to estimate for such clusters haven't got a result. Just like for the cluster which already estimated by its karmada-estimator no need to back off to general estimator.

Sorry for delayed, and thanks for review again~

@whitewindmills
Copy link
Member

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 18, 2024
pkg/scheduler/core/util.go Outdated Show resolved Hide resolved
pkg/estimator/client/general.go Outdated Show resolved Hide resolved
pkg/estimator/client/accurate.go Outdated Show resolved Hide resolved
pkg/estimator/client/general.go Outdated Show resolved Hide resolved
pkg/estimator/client/accurate.go Outdated Show resolved Hide resolved
pkg/estimator/client/accurate.go Outdated Show resolved Hide resolved
pkg/scheduler/core/util.go Outdated Show resolved Hide resolved
pkg/scheduler/core/util.go Outdated Show resolved Hide resolved
@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2024
@karmada-bot
Copy link
Collaborator

New changes are detected. LGTM label has been removed.

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from garrybest after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

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

@karmada-bot karmada-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adjust the Priority of General and Accurate Estimator of Karmada Scheduler
9 participants