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

batch API: add suspended job #98727

Merged
merged 1 commit into from Mar 9, 2021
Merged

batch API: add suspended job #98727

merged 1 commit into from Mar 9, 2021

Conversation

adtac
Copy link
Member

@adtac adtac commented Feb 3, 2021

What type of PR is this?

/kind feature
/kind api-change

What this PR does / why we need it: See KEP: kubernetes/enhancements#2234

Which issue(s) this PR fixes:

Part of kubernetes/enhancements#2232

Special notes for your reviewer:

  1. e2e tests require the alpha feature gate, so they won't run in presubmit until add SuspendJob to presubmit and periodic alpha jobs test-infra#20833 is merged
  2. integration tests coming in a follow-up PR

Does this PR introduce a user-facing change?:

Jobs API has a new .spec.suspend field that can be used to suspend and resume Jobs. This is an alpha field which is only honored by servers with the `SuspendJob` feature gate enabled.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/enhancements/pull/2234

cc @ahg-g @alculquicondor @soltysh

@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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 3, 2021
@adtac
Copy link
Member Author

adtac commented Feb 3, 2021

/sig apps

@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 3, 2021
@adtac adtac force-pushed the suspend branch 4 times, most recently from 2ac0991 to 952aef4 Compare February 3, 2021 16:15
@fejta-bot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

pkg/apis/batch/v1/defaults.go Outdated Show resolved Hide resolved
pkg/registry/batch/job/strategy.go Outdated Show resolved Hide resolved
pkg/controller/job/job_controller.go Outdated Show resolved Hide resolved
pkg/controller/job/job_controller.go Outdated Show resolved Hide resolved
pkg/controller/job/job_controller.go Outdated Show resolved Hide resolved
pkg/controller/job/job_controller.go Outdated Show resolved Hide resolved
pkg/controller/job/job_controller.go Outdated Show resolved Hide resolved
pkg/controller/job/job_controller.go Outdated Show resolved Hide resolved
pkg/controller/job/job_controller.go Outdated Show resolved Hide resolved
pkg/apis/batch/fuzzer/fuzzer.go Outdated Show resolved Hide resolved
pkg/apis/batch/v1/defaults.go Outdated Show resolved Hide resolved
pkg/apis/batch/v1/defaults_test.go Outdated Show resolved Hide resolved
sort.Sort(controller.ActivePods(activePods))

active -= diff
deletePods := func(numPodsToDelete int32) {
Copy link
Member

Choose a reason for hiding this comment

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

I have refactored this into its own function :)

But I can resolve the conflicts later.

pkg/controller/job/job_controller_test.go Outdated Show resolved Hide resolved
pkg/registry/batch/job/strategy.go Outdated Show resolved Hide resolved
pkg/registry/batch/job/strategy_test.go Outdated Show resolved Hide resolved
staging/src/k8s.io/api/batch/v1/types.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 5, 2021
Copy link
Member Author

@adtac adtac left a comment

Choose a reason for hiding this comment

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

addressed all but two comments, I'll respond to those shortly

pkg/controller/job/job_controller.go Outdated Show resolved Hide resolved
pkg/controller/job/job_controller.go Outdated Show resolved Hide resolved
pkg/registry/batch/job/strategy.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 8, 2021
@ahg-g
Copy link
Member

ahg-g commented Mar 8, 2021

@adtac I think we are good to squash

@adtac
Copy link
Member Author

adtac commented Mar 8, 2021

ack, squashed

Copy link
Member

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 8, 2021
@adtac
Copy link
Member Author

adtac commented Mar 8, 2021

/hold cancel
API and sig-apps approved, please feel free to hold again

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 8, 2021
@ahg-g
Copy link
Member

ahg-g commented Mar 8, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 8, 2021
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 8, 2021
@alculquicondor
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 8, 2021
@alculquicondor
Copy link
Member

for future reference: keeping this unsquashed was fine

@alculquicondor
Copy link
Member

/retest

@ehashman ehashman moved this from Waiting on Author to Done in SIG Node PR Triage Mar 8, 2021
@k8s-ci-robot
Copy link
Contributor

@adtac: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-e2e-kind-ipv6 a0844da link /test pull-kubernetes-e2e-kind-ipv6

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.

@alculquicondor
Copy link
Member

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: API review completed, 1.21
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

8 participants