-
Notifications
You must be signed in to change notification settings - Fork 228
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
Propagate provisioning status of a ProvReq into the Workload status #2007
Conversation
Hi @pajakd. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. 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. |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
/ok-to-test |
About 6 weeks back, we were discussing putting this status in Conditions rather than Admission Checks. But looking at it again, I'm not coming up with any drawbacks of Admission Checks. If anything, I'd argue it's nicer to have all ProvReq info in one place (as is implemented in this PR). Are there any reasons to prefer Conditions over Admission Checks that I'm missing @yaroslava-serdiuk @PBundyra? |
Tested the feature end-to-end. I did observe that the workloads get the placeholder message "Provisioning Request wasn't provisioned." when the Provisioned flag was equal to False. The message later changed to "successfully provisioned" when Provisioned changes to True. As far as I know it is as desired (knowing that the ETA messages are not provided by the DWS yet). The question remains whether the message should be in Conditions or Admission Checks -- see the above comment. |
I think users (data scientists) would like to check Workloads status to understand when it will be admitted / why it's pending, so I would update workload conditions as well. |
I don't have a strong preference, but as long as we do not lose any information about ProvReqs I would lean towards keeping it in the |
So, we have two options:
|
if prAccepted && !prFailed { | ||
updated = updated || updateCheckMessage(&checkState, apimeta.FindStatusCondition(pr.Status.Conditions, autoscaling.Provisioned).Message) |
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.
Can this be a part of the switch statement for consistency? Could you add a comment explaining this case in fact covers Provisioned=false
condition?
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.
Adding to the switch statement -- see my other reply #2007 (comment).
Added a comment explaining the feature. In fact we also update the message for Provisioned=True
(otherwise we would stick to the "wasn't provisioned" message at the workload which would be confusing). When Provisioned=True
the message changes to "successfully provisioned".
@pajakd I think it's enough for now, let's leave as it is. |
/release-note-edit
|
updated = updateCheckState(&checkState, kueue.CheckStatePending) || updated | ||
} | ||
if prAccepted && !prFailed { | ||
updated = updateCheckMessage(&checkState, apimeta.FindStatusCondition(pr.Status.Conditions, autoscaling.Provisioned).Message) || updated |
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.
maybe add a case for prAccepted
in the switch
so you can do the message update there?
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.
yeah, it seems like it would fit into the switch
statement. But adding a case for prAccepted
would cause the default
case not to be executed and this is not what we want (bc we update a state there). As I understand it, the switch is mainly for updating the state of the admission check. Since my feature will be about only updating the message I don't want to mess with the switch
statement. I did consider it, thought about using fallthrough
, but I could not find a good way that would not make this code more brittle.
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.
Could you elaborate why the switch is mainly for updating the state of admission check? I imagine it could be along the lines:
switch {
case prProvisioned: // updates state and message (ETA -> successfully provisioned)
case prFailed: // retries or updates state and message (ETA -> failed)
case prAccepted && !prFailed : // updates message (ETA)
default: // for now covers cases !prAccepted, prBookingExpired, prCapacityRevoked
}
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 see. I wanted to avoid having the ETA update in multiple places, but perhaps you are right. One more thing is that in the new prAccepted
case I would have to also run everything that is in the default
case. But, I'll revisit this idea.
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.
Is prAccepted
a different case than prAccepted && !prFailed
? I thought prFailed
is by default set to false
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 might be missing something, but switch only runs the single case; the topmost one that evaluates to true, right? so if we reach to case prAccepted
we are sure that prFailed = False
and prProvisioned= False
, right?
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.
just a nit
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.
/lgtm
/approve
LGTM label has been added. Git tree hash: b103dd85cf527f06f26a1782c56b2663f7897996
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, pajakd 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 |
} | ||
case prAccepted: | ||
// we propagate the message from the provisioning request status into the workload | ||
// this happens for provisioned = false (ETA updates) and also for provisioned = true |
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.
Could you please update the comment as Provisioned=true
is covered by the case above?
/release-note-edit
|
What type of PR is this?
/kind feature
What this PR does / why we need it:
It propagates the message from the Provisioning Request (condition Provisioned = false) into the Workload. The message will contain the expected time for the resources to be provisioned. Exposing this information to the users will allow them to understand why the job is still pending and how long until the resources will be available.
Which issue(s) this PR fixes:
Fixes #1749
Special notes for your reviewer:
Does this PR introduce a user-facing change?