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

reset admission check after deactivation #3350

Merged
merged 10 commits into from
Nov 12, 2024

Conversation

KPostOffice
Copy link
Contributor

@KPostOffice KPostOffice commented Oct 28, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #3346
Fixes #3331

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Fix the flow of deactivation for workloads due to rejected AdmissionChecks. 
Now, all AdmissionChecks are reset back to the Pending state on eviction (and deactivation in particular), 
and so an admin can easily re-activate such a workload manually without tweaking the checks.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 28, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 28, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @KPostOffice!

It looks like this is your first PR to kubernetes-sigs/kueue 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kueue has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 28, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @KPostOffice. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 28, 2024
Copy link

netlify bot commented Oct 28, 2024

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit 8043dba
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/67335b2ade58660008942c0d
😎 Deploy Preview https://deploy-preview-3350--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@tenzen-y
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 28, 2024
@KPostOffice KPostOffice force-pushed the resetACOnWLDeactivation branch 2 times, most recently from 4db1187 to 6f7c974 Compare October 28, 2024 23:31
@mimowo
Copy link
Contributor

mimowo commented Oct 29, 2024

cc @PBundyra

@mimowo
Copy link
Contributor

mimowo commented Oct 31, 2024

@KPostOffice PTAL at the failures, maybe we could include as bugfix in 0.9.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 4, 2024
@KPostOffice KPostOffice force-pushed the resetACOnWLDeactivation branch 2 times, most recently from dc8bc5a to a559886 Compare November 5, 2024 00:06
@mimowo
Copy link
Contributor

mimowo commented Nov 5, 2024

cc @PBundyra for a review pass. It seems the failing integration tests are for BookingExpired. PTAL.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a scenario for deactivated test, to observe transition from DeactivationTarget -> EvictedByDeactivation and resetting Workload's AdmissionChecks and RequeueState

checks[i] = kueue.AdmissionCheckState{
Name: checks[i].Name,
State: kueue.CheckStatePending,
LastTransitionTime: metav1.NewTime(time.Now()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use a clock used in WorkloadController?

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 12, 2024
@PBundyra
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 Nov 12, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: f67d95d9c2f4924e2ab70e39f87c976a66e5ee98

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 12, 2024
@mimowo
Copy link
Contributor

mimowo commented Nov 12, 2024

/release-note-edit

Fix the flow of deactivation for workloads due to rejected AdmissionChecks. 
Now, all AdmissionChecks are reset back to the Pending state on eviction (and deactivation in particular), 
and so an admin can easily re-activate such a workload manually without tweaking the checks.

@mimowo
Copy link
Contributor

mimowo commented Nov 12, 2024

/approve
/cherry-pick release 0.9

@k8s-infra-cherrypick-robot
Copy link
Contributor

@mimowo: once the present PR merges, I will cherry-pick it on top of release in a new PR and assign it to you.

In response to this:

/approve
/cherry-pick release 0.9

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-sigs/prow repository.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: KPostOffice, mimowo

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 43b7374 into kubernetes-sigs:main Nov 12, 2024
16 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.10 milestone Nov 12, 2024
@k8s-infra-cherrypick-robot
Copy link
Contributor

@mimowo: cannot checkout release: error checking out "release": exit status 1 error: pathspec 'release' did not match any file(s) known to git

In response to this:

/approve
/cherry-pick release 0.9

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-sigs/prow repository.

@mimowo
Copy link
Contributor

mimowo commented Nov 12, 2024

/cherry-pick release-0.9

@k8s-infra-cherrypick-robot
Copy link
Contributor

@mimowo: #3350 failed to apply on top of branch "release-0.9":

Applying: reset admission check after deactivation
Applying: adjust unit tests
Applying: use deactivation as prefix
Applying: use realClock in admissionCheck package
Applying: remove rejected check because it's transitory
Applying: swap order to avoid short circuit
Applying: dont duplicate eviction function
Using index info to reconstruct a base tree...
M	pkg/controller/core/workload_controller.go
M	pkg/workload/admissionchecks.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/workload/admissionchecks.go
CONFLICT (content): Merge conflict in pkg/workload/admissionchecks.go
Auto-merging pkg/controller/core/workload_controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0007 dont duplicate eviction function

In response to this:

/cherry-pick release-0.9

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-sigs/prow repository.

@mimowo
Copy link
Contributor

mimowo commented Nov 12, 2024

@KPostOffice can you work on preparing the cherry-pick?
You can use the hack/cherry_pick_pull.sh script.

k8s-ci-robot pushed a commit that referenced this pull request Nov 13, 2024
…ion (#3518)

* reset admission check after deactivation

Signed-off-by: Kevin <[email protected]>

* adjust unit tests

Signed-off-by: Kevin <[email protected]>

* use deactivation as prefix

Signed-off-by: Kevin <[email protected]>

* use realClock in admissionCheck package

Signed-off-by: Kevin <[email protected]>

* remove rejected check because it's transitory

Signed-off-by: Kevin <[email protected]>

* swap order to avoid short circuit

Signed-off-by: Kevin <[email protected]>

* dont duplicate eviction function

Signed-off-by: Kevin <[email protected]>

* address comments

Signed-off-by: Kevin <[email protected]>

* add unit test for admission check reset

Signed-off-by: Kevin <[email protected]>

* adjust test description to reflect transitory nature

Signed-off-by: Kevin <[email protected]>

* use reconcilers clock for all func calls

Signed-off-by: Kevin <[email protected]>

---------

Signed-off-by: Kevin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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
7 participants