-
Notifications
You must be signed in to change notification settings - Fork 262
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
Fix workload would be created and deleted indefinitely #597
Conversation
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
What's missing for it to be ready for review? |
Integration tests. |
dde0aa4
to
4ffbfca
Compare
d8d0493
to
778c860
Compare
// E.g. job may have resources limits configured but no requests, | ||
// this is not allowed in workload but we can't update the job directly, | ||
// so we need a function like this to set the defaults. | ||
func SetContainersDefaults(containers []v1.Container) []v1.Container { |
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.
If we support LimitRange later, we can also add here. If the LimitRange changes, workload will be non-equal to job.
/assign |
pkg/util/api/api.go
Outdated
// SetContainersDefaults will fill up the container defaults. | ||
// Note that this is used to bridge the gap between job and workload, | ||
// E.g. job may have resources limits configured but no requests, | ||
// this is not allowed in workload but we can't update the job directly, |
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.
This sounds confusing.
It's not that it's not allowed. The purpose of the Workload object is to represent the requests that the Pod containers will ultimately have.
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.
Updated. One more thing, if LimitRange is introduced, workload with no requests should be rejected, wdyt?
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.
Didn't we vote against that already? #485
pkg/util/api/api.go
Outdated
// so we need a function like this to set the defaults. | ||
func SetContainersDefaults(containers []v1.Container) []v1.Container { | ||
// This should only happen in tests. | ||
// We didn't return nil here for spec.Containers should not be 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.
but it also shouldn't be an empty list. I don't think returning nil makes a difference.
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 mentioned, this only happens in test, If we return nil here, integration tests will fail because it shouldn't be nil.
If we return empty slice here, unit tests will fail like
kueue/apis/kueue/webhooks/workload_webhook_test.go
Lines 43 to 50 in 271e66a
"add default podSet name": { | |
wl: kueue.Workload{ | |
Spec: kueue.WorkloadSpec{ | |
PodSets: []kueue.PodSet{ | |
{}, | |
}, | |
}, | |
}, |
I think I should polish the comments.
@@ -16,6 +16,10 @@ limitations under the License. | |||
|
|||
package api |
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 convinced about putting this function here. But we can revisit once we have the jobs library completed, which will probably use it.
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.
Deal. Didn't find where to place this.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, kerthcet 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 |
@kerthcet would you like to follow up with an analogous fix for the MPIJob? |
Instead, can we focus on the library? |
Yes, I was just thinking it makes sense to get rid of the issue as it is now fresh in our minds, and the fix should be just a couple of lines, but I agree with the priorities. |
Let me rebase this one until #616 got merged. |
In kubernetes-sigs#317, we will default workload resource requests to limits if requests not specified. But this will introduce a bug for in job controller reconciling, job will be judged as not equal to workload, so workload will be deleted and re-create indefinitely Signed-off-by: Kante Yin <kerthcet@gmail.com>
2194280
to
89940d5
Compare
New changes are detected. LGTM label has been removed. |
Rebased. |
@kerthcet wdyt about #600 (comment)? |
PR needs rebase. 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/test-infra repository. |
@kerthcet: The following tests 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. 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/test-infra repository. I understand the commands that are listed here. |
/close superseded by #600 |
@kerthcet: Closed this PR. In response to this:
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/test-infra repository. |
In #317, we will default workload resource requests to limits if requests not specified. But this will introduce a bug as in job controller reconciling, job will be judged as not equal to workload, so workload will be deleted and re-create indefinitely
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #590
Special notes for your reviewer: