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

Fixes incorrect resource model selection #5706

Merged

Conversation

RainbowMango
Copy link
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
Found this issue during the review of documents at karmada-io/website#713 (comment) by @LavredisG.

Given the resource model:

  resourceModels:
  - grade: 0
    ranges:
    - max: "1"
      min: "0"
      name: cpu
  - grade: 1
    ranges:
    - max: "2"
      min: "1"
      name: cpu
  - grade: 2
    ranges:
    - max: "4"
      min: "2"
      name: cpu

If a Pod request 1 CPU, grade 1 will be selected.
If a Pod request 1.5 CPU, grade 1 will be ignored as we are not sure it can provide sufficient resources.

Does this PR introduce a user-facing change?:

`karmada-scheduler`: Fixes an issue where resource model grades were incorrectly matched based on resource requests. Now only grades that can provide sufficient resources will be selected.

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 18, 2024
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 18, 2024
@RainbowMango RainbowMango force-pushed the pr_fix_incorrect_grade_choice branch 2 times, most recently from 241a3a6 to b390f18 Compare October 18, 2024 06:47
@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 39.85%. Comparing base (29c97e9) to head (a6679dd).
Report is 42 commits behind head on master.

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5706      +/-   ##
==========================================
+ Coverage   39.15%   39.85%   +0.70%     
==========================================
  Files         650      650              
  Lines       45207    55145    +9938     
==========================================
+ Hits        17701    21980    +4279     
- Misses      26142    31753    +5611     
- Partials     1364     1412      +48     
Flag Coverage Δ
unittests 39.85% <100.00%> (+0.70%) ⬆️

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.

…ased on resource requests. Now only grades that can provide sufficient resources will be selected.

Signed-off-by: RainbowMango <[email protected]>
@RainbowMango
Copy link
Member Author

cc @chaosi-zju
and @wangxf1987 to take a look.

@wangxf1987
Copy link
Contributor

lgtm

@chaosi-zju
Copy link
Member

You're absolutely right

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 22, 2024
@RainbowMango RainbowMango added this to the v1.12 milestone Oct 23, 2024
@RainbowMango RainbowMango added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 23, 2024
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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 merged commit 4d0181c into karmada-io:master Oct 23, 2024
12 checks passed
@RainbowMango RainbowMango deleted the pr_fix_incorrect_grade_choice branch October 23, 2024 06:52
karmada-bot added a commit that referenced this pull request Oct 24, 2024
…5706-upstream-release-1.11

Automated cherry pick of #5706: Fixes an issue where resource model grades were incorrectly
karmada-bot added a commit that referenced this pull request Oct 24, 2024
…5706-upstream-release-1.10

Automated cherry pick of #5706: Fixes an issue where resource model grades were incorrectly
karmada-bot added a commit that referenced this pull request Oct 24, 2024
…5706-upstream-release-1.9

Automated cherry pick of #5706: Fixes an issue where resource model grades were incorrectly
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants