-
Notifications
You must be signed in to change notification settings - Fork 501
Added workloadAssignedQueues logic handling it. #8433
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
base: main
Are you sure you want to change the base?
Added workloadAssignedQueues logic handling it. #8433
Conversation
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Singularity23x0 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Singularity23x0. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
/ok-to-test |
| func (c *Cache) addOrUpdateWorkloadToQueue(log logr.Logger, w *kueue.Workload, cq *clusterQueue) error { | ||
| wlKey := workload.Key(w) | ||
|
|
||
| if err := c.purgeSavedWorkloadData(log, wlKey); err != nil { |
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.
I think we don't need to call it there. We'll just override the current values with new ones, and the cq.addOrUpdateWorkload has built-in delete
| if !assignded { | ||
| return errors.New("workload assumed but not assigned to any queue") | ||
| } | ||
| if assumedCQ != assignedCQ { | ||
| return fmt.Errorf("workload assumed to %s but assigned to %s", assumedCQ, assignedCQ) | ||
| } |
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.
I'm not sure if this is the right behavior. Why don't we delete the assumedCQ/assignedCQ anyway even if they differ/assignedCQ is not present?
| } | ||
|
|
||
| func (c *Cache) purgeSavedWorkloadData(log logr.Logger, wlKey workload.Reference) error { | ||
| assignedCQ, assignded := c.workloadAssignedQueues[wlKey] |
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.
| assignedCQ, assignded := c.workloadAssignedQueues[wlKey] | |
| assignedCQ, assigned := c.workloadAssignedQueues[wlKey] |
| } | ||
|
|
||
| func (c *Cache) UpdateWorkload(log logr.Logger, oldWl, newWl *kueue.Workload) error { | ||
| func (c *Cache) UpdateWorkload(log logr.Logger, wl *kueue.Workload) error { |
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.
After the changes UpdateWorkload looks very similar to AddOrUpdateWorkload. Do we have plans for consolidating those two in a follow-up?
|
Please rebase on #8474 once it's merged |
|
@Singularity23x0: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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. I understand the commands that are listed here. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds workloadAssignedQueues tracking to the scheduler cache, by analogy to what 7915 and its successor have are implementing for the queue cache.
This change will be followed up by changing the assumedWorkloads map to a structure holding only boolean information on whether a wl has been assumed, to avoid data redundancy and conflicts, as workloadAssignedQueues will already be providing the queue assignment mappings.
Which issue(s) this PR fixes:
Part 2.1 of addressing: #5310
Special notes for your reviewer:
Does this PR introduce a user-facing change?