-
Notifications
You must be signed in to change notification settings - Fork 277
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
Simplify flavorassigner to only return bool if borrowing is required #1498
Simplify flavorassigner to only return bool if borrowing is required #1498
Conversation
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
c5b001e
to
73d8e4e
Compare
/assign @yaroslava-serdiuk |
Nice 👍 |
LGTM label has been added. Git tree hash: e57d0128dd4ffaf46ab85b487cc0473c54dca7ab
|
/assign @alculquicondor @tenzen-y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I can see the commit history, the TotalBorrow
looks like there have been no changes since we implemented flavorAssigner: #454
Also, the scheduler's borrowing implementation based on flavorAssigner looks like there have been no changes since we implemented the kueue 2 years ago:
kueue/pkg/scheduler/scheduler.go
Lines 74 to 76 in 8467cdc
// borrows is the resouces that the workload would need to borrow from the | |
// cohort if it was scheduled in the capacity. | |
borrows capacity.Resources |
Furthermore, we have been using TotalBorrow
only to confirm if the podSet borrows resources from others. In other words, we have never used stored borrowed resources in TotalBorrow
anywhere since we implemented the kueue scheduler.
So, I think that this simplification would be better since we can reduce unneeded calculation costs and avoid no need complications.
cc: @alculquicondor
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mimowo, tenzen-y 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 |
The information could have been useful for debugging, but otherwise not necessary in production. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
To make the logic simpler, and easier to modify in #1397.
Which issue(s) this PR fixes:
Part of #1337
Special notes for your reviewer:
The only exported API where we use
assignment.TotalBorrow
isBorrows()
used by scheduler:So, it is much simpler to just keep a bool "borrowing" instead, it will also have better memory usage.
Does this PR introduce a user-facing change?