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

Fast admission annotation #3189

Merged
merged 3 commits into from
Oct 9, 2024
Merged

Conversation

vladikkuzn
Copy link
Contributor

@vladikkuzn vladikkuzn commented Oct 3, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

The PodGroup integration waits until all pods are created, but StatefulSet creates second pod only after all previous pods are running, so there was a deadlock. The solution to this is to introduce the kueue.x-k8s.io/fast-pod-group-admission annotation, when true, then the Pod group does not need to wait for all pods with ungating. Part of #2717

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Introduce the "kueue.x-k8s.io/pod-group-fast-admission" annotation to Plain Pod integration.

If the PlainPod has the annotation and is part of the Plain PodGroup, the Kueue will admit the Plain Pod regardless of whether all PodGroup Pods are created.

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 3, 2024
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 3, 2024
Copy link

netlify bot commented Oct 3, 2024

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit c4ca698
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/6706629858800c0008fab048

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 7, 2024
@vladikkuzn
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Oct 7, 2024
@trasc
Copy link
Contributor

trasc commented Oct 7, 2024

/test pull-kueue-test-integration-main

@vladikkuzn vladikkuzn marked this pull request as ready for review October 7, 2024 11:30
@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 Oct 7, 2024
@k8s-ci-robot k8s-ci-robot requested a review from mimowo October 7, 2024 11:30
@vladikkuzn
Copy link
Contributor Author

/cc @trasc

@k8s-ci-robot k8s-ci-robot requested a review from trasc October 7, 2024 11:30
* Simplify constructGroupPodSetsFast
Copy link
Contributor

@trasc trasc 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 Oct 7, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 6dd114a245a01672959984db22bb09f7a4c1d280

@k8s-ci-robot k8s-ci-robot requested a review from trasc October 9, 2024 11:01
Copy link
Contributor

@mimowo mimowo left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve
/hold
in case @tenzen-y has some extra comments

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 9, 2024
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 9, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 7ef7fa94527d727a61d9dcb6990f6c1b1d8c25b9

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 9, 2024
@tenzen-y
Copy link
Member

tenzen-y commented Oct 9, 2024

Yeah, the PodGroup feature seems like a better fit to base the StatefulSet integration. If we base the integration on individual pods, then in case of preemption, the StatefulSet could lose Pod-0 which might be problematic, because StatefulSets assume continuity of indexes. For Deployments it is fair to use individual pods, because we don't care which pod is preempted. WDYT?

cc @mwielgus who also was thinking about it

@mimowo The use case sounds reasonable, but shouldn't we implement the StatefulSet integration as the dedicated Job?
Actually, we implemented some of dedicated Jobs like batch/job, RayJob, and ... so that we can support such a complex cases.

@mimowo
Copy link
Contributor

mimowo commented Oct 9, 2024

Yes, we are considering it, but it seems to be significantly more work. The idea is to provide the MVP functionality so that Kueue can be used for Inference in 0.9. I consider this as "experimental" support to gain user feedback.

I would go for a dedicated integration when we hit some use cases which cannot be achieved this way. Maybe it is needed for efficient scaling, but I'm not sure. Maybe it is achievable by scaling support for PodGroups also.

@tenzen-y
Copy link
Member

tenzen-y commented Oct 9, 2024

Yes, we are considering it, but it seems to be significantly more work. The idea is to provide the MVP functionality so that Kueue can be used for Inference in 0.9. I consider this as "experimental" support to gain user feedback.

I would go for a dedicated integration when we hit some use cases which cannot be achieved this way. Maybe it is needed for efficient scaling, but I'm not sure. Maybe it is achievable by scaling support for PodGroups also.

That makes sense. In that case, we may would like to avoid using "StatefulSet" as an integration name and use alternative name something like "StatefulSetWithPodGroup" since we are planning to implement the dedicated integration for the StetefulSet and we can assume the "StatefulSetWithPodGroup" will be deprecated in the future release.

Anyway, this PR can be moved forward.

@tenzen-y
Copy link
Member

tenzen-y commented Oct 9, 2024

@vladikkuzn Could you open a PR to update the PodGroup documentation?

https://kueue.sigs.k8s.io/docs/tasks/run/plain_pods/#running-a-group-of-pods-to-be-admitted-together

@tenzen-y tenzen-y closed this Oct 9, 2024
@tenzen-y tenzen-y reopened this Oct 9, 2024
@tenzen-y
Copy link
Member

tenzen-y commented Oct 9, 2024

Oh, sorry. I accidentally closed this PR.

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.

/lgtm
/approve
/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 Oct 9, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mimowo, tenzen-y, vladikkuzn

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

@mimowo
Copy link
Contributor

mimowo commented Oct 9, 2024

That makes sense. In that case, we may would like to avoid using "StatefulSet" as an integration name and use
alternative name something like "StatefulSetWithPodGroup" since we are planning to implement the dedicated ?
integration for the StetefulSet and we can assume the "StatefulSetWithPodGroup" will be deprecated in the future release.

TBH I would prefer to use "StatefulSet" and handle the underlying mechanism as an implementation detail. Users creating StatefulSets don't need to be aware of that. The "fast-admission" annotation will be added by a webhook.

One particularly challenging aspect is that StatefulSet as such does not support "suspend" operation, similarly as Deployment. Adding such fields to the upstream k8s will be challenging, because the usage is rather niche for now. So, we will likely stay with PodGroups as the underlying integration mechanism for a while.

@k8s-ci-robot k8s-ci-robot merged commit a768127 into kubernetes-sigs:main Oct 9, 2024
16 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.9 milestone Oct 9, 2024
@tenzen-y
Copy link
Member

tenzen-y commented Oct 9, 2024

That makes sense. In that case, we may would like to avoid using "StatefulSet" as an integration name and use
alternative name something like "StatefulSetWithPodGroup" since we are planning to implement the dedicated ?
integration for the StetefulSet and we can assume the "StatefulSetWithPodGroup" will be deprecated in the future release.

TBH I would prefer to use "StatefulSet" and handle the underlying mechanism as an implementation detail. Users creating StatefulSets don't need to be aware of that. The "fast-admission" annotation will be added by a webhook.

One particularly challenging aspect is that StatefulSet as such does not support "suspend" operation, similarly as Deployment. Adding such fields to the upstream k8s will be challenging, because the usage is rather niche for now. So, we will likely stay with PodGroups as the underlying integration mechanism for a while.

I discussed this with @mimowo offline. Throughout valuable discussions, we found that the framework integration migration potentially could happen in any integration, not only for StatefulSet. So, we decided to use the "StatefulSet" as a integration name as a today's StatefulSet integration. Then, we will seek out how we can support migration to new integration.

@tenzen-y
Copy link
Member

tenzen-y commented Oct 9, 2024

It seems that this is a user facing new feature since this can be used by batch users.

/release-note-edit

Introduce the "kueue.x-k8s.io/retriable-in-group" annotation to Plain Pod integration.

If the PlainPod has the annotation and is part of the Plain PodGroup, the Kueue will admit the Plain Pod regardless of whether all PodGroup Pods are created.

@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 release-note-none Denotes a PR that doesn't merit a release note. labels Oct 9, 2024
@vladikkuzn
Copy link
Contributor Author

@tenzen-y are you sure about this release note^? "kueue.x-k8s.io/pod-group-fast-admission" annotation was added, not "kueue.x-k8s.io/retriable-in-group"

@vladikkuzn vladikkuzn deleted the fast-admission branch October 10, 2024 17:52
@tenzen-y
Copy link
Member

Oops, sorry. You're right.

/release-note-edit

Introduce the "kueue.x-k8s.io/pod-group-fast-admission" annotation to Plain Pod integration.

If the PlainPod has the annotation and is part of the Plain PodGroup, the Kueue will admit the Plain Pod regardless of whether all PodGroup Pods are created.

kannon92 pushed a commit to openshift-kannon92/kubernetes-sigs-kueue that referenced this pull request Nov 19, 2024
* Fast admission annotation

* Fast admission annotation

* Simplify constructGroupPodSetsFast

* Fast admission annotation

* Restructure integration test
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/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.

5 participants