Skip to content
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

Provide support for ProvisioningRequest's BookingExpired condition #2445

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

PBundyra
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Provide support for the new ProvisioningRequest's condition BookingExpired. When a Workload is Admitted this Condition has no effect. If Workload is still waiting for admission due to others AdmissionChecks running, then with respect to retry policy it, the Provisioning AdmissionCheck gets retried or rejected.

Which issue(s) this PR fixes:

Fixes #2041

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Kueue now supports ProvisioningRequest's condition `BookingExpired`

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Jun 19, 2024
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 19, 2024
Copy link

netlify bot commented Jun 19, 2024

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 2142af2
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/667eba83f1cc1400084921c5

@PBundyra
Copy link
Contributor Author

/assign @yaroslava-serdiuk
/assign @alculquicondor

@yaroslava-serdiuk
Copy link
Contributor

please, fix the tests

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: PBundyra
Once this PR has been reviewed and has the lgtm label, please ask for approval from alculquicondor. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

@yaroslava-serdiuk yaroslava-serdiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few nits
/lgtm

if isFailed(oldPr) {
switch {
case isFailed(oldPr) || isBookingExpired(oldPr):
if isBookingExpired(oldPr) && workload.IsAdmitted(wl) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If ProvReq is failed but workload.IsAdmitted(wl) are we going to retry? Maybe we can put caseworkload.IsAdmitted(wl) and break earlier?

Copy link
Contributor Author

@PBundyra PBundyra Jun 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC ProvReq cannot transition from Provisioned to Failed. In that case, Workload cannot be admitted and have ProvReq Failed, as Workload is only admitted if all of its checks are Ready, and ProvReq sets AdmissionChecks as Ready only when it's Provisioned

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 672b58a98791f6ae8859027913fbce4da7767f21

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2024
@yaroslava-serdiuk
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: db579ea45ac6d17bbcd2a970814e4e724cd4c40b

@yaroslava-serdiuk
Copy link
Contributor

/lgtm

pkg/controller/admissionchecks/provisioning/controller.go Outdated Show resolved Hide resolved
// This is needed to prevent replacement pods being stuck in the pending phase indefinitely
// as the nodes are already deleted by Cluster Autoscaler.
updated = updateCheckState(&checkState, kueue.CheckStateRejected) || updated
updated = updateCheckMessage(&checkState, apimeta.FindStatusCondition(pr.Status.Conditions, autoscaling.CapacityRevoked).Message) || updated
}
case isBookingExpired(pr):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the logic mostly repeated in two places? Perhaps we need some refactoring?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean similarities between Failed and BookingExpired cases?

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jun 26, 2024
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 27, 2024
@alculquicondor
Copy link
Contributor

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support all ProvisioningRequest's conditions
4 participants