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

Account for unschedulable plugin result during maxreplica estimation #5012

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

mszacillo
Copy link
Contributor

@mszacillo mszacillo commented Jun 1, 2024

What type of PR is this?
/kind bug

What this PR does / why we need it:
Bugfix related to maxReplica estimation.

Testing

Local:

mszacillo@HXQDWP921L estimator % go test ./...
?   	github.com/karmada-io/karmada/pkg/estimator/client	[no test files]
?   	github.com/karmada-io/karmada/pkg/estimator/pb	[no test files]
?   	github.com/karmada-io/karmada/pkg/estimator/server/framework	[no test files]
?   	github.com/karmada-io/karmada/pkg/estimator/server/framework/plugins	[no test files]
?   	github.com/karmada-io/karmada/pkg/estimator/server/metrics	[no test files]
?   	github.com/karmada-io/karmada/pkg/estimator/server/nodes	[no test files]
?   	github.com/karmada-io/karmada/pkg/estimator/server/replica	[no test files]
?   	github.com/karmada-io/karmada/pkg/estimator/service	[no test files]
ok  	github.com/karmada-io/karmada/pkg/estimator/server	1.626s
ok  	github.com/karmada-io/karmada/pkg/estimator/server/framework/plugins/resourcequota	2.148s
ok  	github.com/karmada-io/karmada/pkg/estimator/server/framework/runtime	1.244s

E2E test with added logs:

I0601 16:19:48.700057       1 generic_scheduler.go:95] Feasible clusters scores: [{cluster-A 0} {cluster-B 0}]
I0601 16:19:48.700159       1 util.go:76] Running score for estimator: general-estimator
I0601 16:19:48.700212       1 general.go:77] cluster cluster-A has max available replicas: 8 according to cluster resource models
I0601 16:19:48.700234       1 general.go:77] cluster cluster-B has max available replicas: 8 according to cluster resource models
I0601 16:19:48.700257       1 util.go:83] Result for cluster: cluster-A was score 8
I0601 16:19:48.700270       1 util.go:83] Result for cluster: cluster-B was score 8
I0601 16:19:48.700282       1 util.go:76] Running score for estimator: scheduler-estimator
I0601 16:19:48.704222       1 util.go:83] Result for cluster: cluster-A was score 0
I0601 16:19:48.704248       1 util.go:83] Result for cluster: cluster-B was score 4
I0601 16:19:48.704253       1 util.go:101] Target cluster calculated by estimators (available cluster && maxAvailableReplicas): [{cluster-A 0} {cluster-B 4}]
I0601 16:19:48.704275       1 generic_scheduler.go:101] Selected clusters: [cluster-B]

Which issue(s) this PR fixes:
Fixes #5011

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-scheduler-estimator`: Fixed the `Unschedulable` result returned by plugins to be treated as an exception issue.

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 1, 2024
@karmada-bot
Copy link
Collaborator

Welcome @mszacillo! It looks like this is your first PR to karmada-io/karmada 🎉

@karmada-bot karmada-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 1, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2024

Codecov Report

Attention: Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 53.30%. Comparing base (c181917) to head (23c9dc9).
Report is 4 commits behind head on master.

Files Patch % Lines
pkg/estimator/server/estimate.go 0.00% 1 Missing and 1 partial ⚠️
pkg/scheduler/core/util.go 80.00% 1 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5012      +/-   ##
==========================================
- Coverage   53.32%   53.30%   -0.03%     
==========================================
  Files         253      253              
  Lines       20560    20565       +5     
==========================================
- Hits        10964    10962       -2     
- Misses       8870     8876       +6     
- Partials      726      727       +1     
Flag Coverage Δ
unittests 53.30% <62.50%> (-0.03%) ⬇️

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.

Copy link
Member

@whitewindmills whitewindmills left a comment

Choose a reason for hiding this comment

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

/assign

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/assign

@RainbowMango RainbowMango added this to the v1.11 milestone Jun 4, 2024
pkg/scheduler/core/util.go Outdated Show resolved Hide resolved
pkg/estimator/server/estimate.go Outdated Show resolved Hide resolved
@mszacillo mszacillo force-pushed the unschedulable-plugin-fix branch from 957e50b to 34be0c4 Compare June 4, 2024 15:59
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/lgtm

@whitewindmills Do you have any further comments?

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 5, 2024
@whitewindmills
Copy link
Member

others LGTM

Signed-off-by: mszacillo <mszacillo@bloomberg.net>
@mszacillo mszacillo force-pushed the unschedulable-plugin-fix branch from 34be0c4 to 23c9dc9 Compare June 5, 2024 13:44
@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 5, 2024
@mszacillo
Copy link
Contributor Author

Thanks for all the comments!

@RainbowMango
Copy link
Member

/lgtm
I see comments have been addressed.
@whitewindmills would you like to take another look?

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 6, 2024
@whitewindmills
Copy link
Member

/lgtm

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/approve

@karmada-bot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 6, 2024
@karmada-bot karmada-bot merged commit f2633a4 into karmada-io:master Jun 6, 2024
11 checks passed
@RainbowMango
Copy link
Member

@mszacillo Great thanks for helping fix this!
Just a suggestion that you might need to add your email to GitHub Emails, otherwise, GitHub can't recognize you and count your contributions.

@RainbowMango RainbowMango mentioned this pull request Jun 6, 2024
3 tasks
@RainbowMango
Copy link
Member

Filed an issue(#5024) to track the backport tasks.

@RainbowMango
Copy link
Member

@mszacillo I didn't run the test locally, can you confirm if this patch works as expected?

karmada-bot added a commit that referenced this pull request Jun 12, 2024
…5012-upstream-release-1.10

Automated cherry pick of #5012: Account for unschedulable plugin result during maxreplica
karmada-bot added a commit that referenced this pull request Jun 12, 2024
…5012-upstream-release-1.9

Automated cherry pick of #5012: Account for unschedulable plugin result during maxreplica
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unschedulable result treated as failure during max replica estimation
5 participants