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

Add support for single pods #1072

Merged
merged 4 commits into from Sep 27, 2023
Merged

Conversation

achernevskii
Copy link
Contributor

@achernevskii achernevskii commented Aug 18, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • Add support for pods (k8s 1.26+)

  • Add PodIntegrationOptions configuration field containing
    namespace and pod label selectors.

  • Create a new interface JobWithFinalize. Jobs implementing
    it supports custom finalization logic.

  • Add namespace/pod label filtering for Default pod webhook.

Which issue(s) this PR fixes:

Related issue: #976

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Add support for single plain Pods.

@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/feature Categorizes issue or PR as related to a new feature. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 18, 2023
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 18, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @achernevskii. 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 18, 2023
@netlify
Copy link

netlify bot commented Aug 18, 2023

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit aac3eb4
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/651368f833187a000811023c

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 18, 2023
@trasc
Copy link
Contributor

trasc commented Aug 19, 2023

/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 Aug 19, 2023
apis/config/v1beta1/configuration_types.go Outdated Show resolved Hide resolved
apis/config/v1beta1/configuration_types.go Outdated Show resolved Hide resolved
apis/config/v1beta1/configuration_types.go Outdated Show resolved Hide resolved
apis/config/v1beta1/configuration_types_test.go Outdated Show resolved Hide resolved
apis/config/v1beta1/defaults.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_webhook.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_webhook.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_webhook_test.go Outdated Show resolved Hide resolved
pkg/util/testing/wrappers.go Outdated Show resolved Hide resolved
site/static/examples/pods-kueue/high-prio-pod.yaml Outdated Show resolved Hide resolved
apis/config/v1beta1/validation.go Outdated Show resolved Hide resolved
apis/config/v1beta1/validation.go Outdated Show resolved Hide resolved
apis/config/v1beta1/validation.go Outdated Show resolved Hide resolved
apis/config/v1beta1/validation.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_controller.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_controller.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_webhook.go Show resolved Hide resolved
apis/config/v1beta1/validation_test.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
pkg/config/validation.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_controller.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_controller_test.go Outdated Show resolved Hide resolved
pkg/config/validation.go Outdated Show resolved Hide resolved
pkg/config/validation.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 2, 2023
@alculquicondor
Copy link
Contributor

please rebase instead of merge.

It might be ok to squash at this point

@achernevskii achernevskii changed the title WIP: Add support for pods Add support for single pods Sep 8, 2023
@achernevskii achernevskii marked this pull request as ready for review September 8, 2023 01:36
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 8, 2023
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 20, 2023
Copy link
Contributor

@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.

/approve
/hold for nits

I will leave LGTM to @tenzen-y

pkg/controller/jobframework/reconciler.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_controller_test.go Outdated Show resolved Hide resolved
test/integration/controller/core/suite_test.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 21, 2023
Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

Also, can you rebase this PR and add IsManagingObjectsOwner to the PaddleJob?

utilruntime.Must(jobframework.RegisterIntegration(FrameworkName, jobframework.IntegrationCallbacks{
SetupIndexes: SetupIndexes,
NewReconciler: NewReconciler,
SetupWebhook: SetupPaddleJobWebhook,
JobType: &kftraining.PaddleJob{},
AddToScheme: kftraining.AddToScheme,
}))

pkg/controller/jobs/pod/pod_controller.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_webhook.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_webhook_test.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_webhook_test.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_webhook_test.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_webhook_test.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_webhook_test.go Outdated Show resolved Hide resolved
})
})
})
})
Copy link
Member

Choose a reason for hiding this comment

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

Add test cases when starting manager with the scheduler like other integrations:

var _ = ginkgo.Describe("JobSet controller interacting with scheduler", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {

@tenzen-y
Copy link
Member

/release-note Add support for single pods

@tenzen-y
Copy link
Member

/release-note Add support for single pods

@achernevskii Can you add a release note?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 22, 2023
trasc and others added 3 commits September 25, 2023 22:28
* Add namespace/pod label filtering for Default pod
  webhook. Add PodIntegrationOptions configuration
  field containing namespace and pod label selectors.

* Simplify RunWithPodSetsInfo method for the pod
  controller.

* Create a new interface JobWithFinalize. Jobs implementing
  it supports custom finalization logic.

* Add k8s version check. If the pod integration is
  enabled on k8s server versions < 1.27, Kueue pod
  will stop with an error message.

* Add JobWithSkip interface. Jobs that implement
  this interface can introduce custom
  reconciliation skip logic.

* Add IsPodOwnerManagedByQueue function.
  Defaulting webhook will skip a pod if it's owner
  is managed by Kueue. Reconciler will skip such a
  pod even if 'managed' label is set.

* Add integration tests for the pod controller
  and webhook.
* Add tests for pod controller interacting with
  scheduler

* Change IsManagingObjectsOwner functions for
  Kubeflow jobs.

* Update webhook paths for integration tests.

* Add parent check for kubeflow PaddleJob resource

* Update helm chart.

* Replace patchesStrategicMerge with patches in
  webhook kustomization.yaml

* Update unit/integration tests.

* Change pod webhook failure policy from Ignore to
  fail, add webhook namespace selector patch.

* Merge tests in validation_test.go into a single
  test for exported ValidateConfiguration function.

* Update JobWithSkip interface.

* Add missing licence comments.

* Rewrite some of the integration tests messages
  and value validations.

* Update unit tests.
@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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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 Sep 26, 2023
Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

@achernevskii This looks great! Thank you!

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: 305aa7f7f714fdb39db5225c75e94406e27ca817

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: achernevskii, alculquicondor, tenzen-y

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:
  • OWNERS [alculquicondor,tenzen-y]

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

@tenzen-y
Copy link
Member

/hold cancel

@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 Sep 27, 2023
@k8s-ci-robot k8s-ci-robot merged commit a68805f into kubernetes-sigs:main Sep 27, 2023
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.5 milestone Sep 27, 2023
@trasc trasc deleted the pod_support branch March 12, 2024 08:59
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/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. 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants