Fixed cluster affinity scheduling evaluation order when scheduling is triggered via WorkloadRebalancer
What type of PR is this?
/kind bug
What this PR does / why we need it: As discussed in the community meet on 2024-07-09 , added the fix to evaluate the cluster affinities freshly when scheduling is triggered via WorkloadRebalancer.
Which issue(s) this PR fixes: Fixes #5070
Progress
- [x] share opinion in Community Meeting
- [ ] proposal
- [x] implementation
- [ ] UT test
- [ ] e2e test
Special notes for your reviewer: Raising this PR to get early feedback on the implementation as it is still work in progress and tested manually by building the deploying the scheduler. There may be unit test failures which I will fix so please don't merge the PR until that's done.
Does this PR introduce a user-facing change?: Yes. [Rest of the section TBA]
Welcome @bharathguvvala! It looks like this is your first PR to karmada-io/karmada 🎉
hi @bharathguvvala, really glad to see your PR submission!
By the way, here may be some minor problems with the ci now, and can you please fix the ci and squash the commit records into one? thanks~
@chaosi-zju Sure, will do that.
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
Project coverage is 48.17%. Comparing base (
cf7ac41) to head (762f992).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| pkg/scheduler/scheduler.go | 0.00% | 4 Missing and 2 partials :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #5425 +/- ##
==========================================
- Coverage 48.18% 48.17% -0.02%
==========================================
Files 664 664
Lines 54799 54805 +6
==========================================
- Hits 26405 26402 -3
- Misses 26680 26686 +6
- Partials 1714 1717 +3
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 48.17% <0.00%> (-0.02%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
/retest
Hi, there are still two nits:
-
The CI of this PR failed due to it wasn't signed off, usually please use
git commit -s -m 'your message 'orgit commit -m ' Signed-off-by: AuthorName <[email protected]> \n <other message> 'to passDCO(detail guideline can refer to: https://probot.github.io/apps/dco/). -
I see this PR has
26commit record, can you please squash these26commits into one commit, you can refer to: https://stackoverflow.com/questions/5189560/how-do-i-squash-my-last-n-commits-together
thanks~
Adding label do-not-merge/contains-merge-commits because PR contains merge commits, which are not allowed in this repository.
Use git rebase to reapply your commits on top of the target branch. Detailed instructions for doing so can be found here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
@chaosi-zju I've tried to squash the commits and sort of messed it up. Those squashed commits aren't showing up in the branch. Can we do "squash and merge" while merging this PR?
I've tried to squash the commits and sort of messed it up. Those squashed commits aren't showing up in the branch. Can we do "squash and merge" while merging this PR?
can you try one more time by following command:
git remote add upstream https://github.com/karmada-io/karmada.git
git fetch upstream
git rebase upstream/master
then if you successfully rebased, you can directly push tou commit,
but you may also encounter some rebase conflict, in that case you should manually resolve the conflict and execute git rebase --continue
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign garrybest for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@chaosi-zju can you check now?
hi @bharathguvvala, I reviewed your code from earlier and found no functional issues.
However, we've been unable to move forward with this PR because your submissions consistently fail CI checks. For example, the code below failed to compile, and it includes unrelated commits (seems something unexpected happened when you do squash or conflict-resolution). Actually, all CI checks must pass for the code to be merged.
I am also eagerly anticipate the release of your feature, and I’m trying to find an efficient way to collaborate with you to ensure that all CI checks are successfully completed.
At this moment, maybe we should fix these two problem:
- you can check the file you submited, that
docs/proposals/karmada-operator/component-priority-class-name/README.mdseems is not related to this feature, could you please remove that file? - the code in
pkg/scheduler/scheduler.goseems to have some discrepancies, I would much appreciate you to reset the code in this file to the previous code.
maybe you can do like this:
- execute
git reset --soft HEAD~1, this command moves the current branch pointer back by one commit, keeping the changes from that commit in the staging area (index) - manually remove the change in
docs/proposals/karmada-operator/component-priority-class-name/README.mdand repair the code inpkg/scheduler/scheduler.go - execute
git commit -m "support workloadrebalance to reschedule from the first cluster affinity"andgit push -fto re-commit your code.
please let me know if you have any questions, best wishes~
hi @bharathguvvala, if above method is still troublesome, how about this:
- first, overwrite the current branch code with the latest code from master, by executing following command:
git remote add upstream https://github.com/karmada-io/karmada.git
# replace code in local rebalancefix branch with code in upstream master branch
git pull -f upstream master:rebalancefix
-
then we manually add what we newly added code, including only following six line:
-
then re-commit and push the code:
git commit -s -m "support workload rebalancer to reschedule from the first cluster affinity
git push -f
this maybe the simplest way, good luck!
I can get back on this after the PR passes the CI. @bharathguvvala I can help to rebase it if you want.