-
Notifications
You must be signed in to change notification settings - Fork 479
introduce JobWithCustomWorkloadActivation interface #7199
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
Conversation
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
|
Welcome @tg123! |
|
Hi @tg123. 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 Once the patch is verified, the new status will be reflected by the 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. |
|
/ok-to-test |
|
Nice feature @tg123 . So, IIUC you have a custom Job which has a field on the CRD indicating "hybernated / active". When hybernated you would like to set I'm happy with that interface, just out of curiosity. Did you consider as alternative to simulate hybernation by setting Jobs' |
|
/release-note-edit |
|
Actually, we could also use this enhancement for all Jobs and implement JobWithCustomActivation interface based on a dedicated Kueue label, say cc @tenzen-y |
|
Could you please consider adding a unit test. I think this would be possible using our mocks, see here: kueue/internal/mocks/controller/jobframework/interface.go Lines 1 to 7 in c817c03
|
|
Also, @tg123 would you like to cherrypick this to 0.13 or 0.14 branches? Since this is just a new interface I think we could do that |
|
@mimowo ah good idea, by removing queue label or moving them to a this sounds like work to me, but need to introduce a label/annotation to remember previous queue name, our crd allows users to choose which queue to use i will add ut and questoin for cherry-pick: what is the policy of cherry-pick, prefer squash into single commit cherry-pick right? |
Well, I think the proposal is actually a better idea, that was just a workaround proposal :) but also it is inferior because we block removal of queue-name for already running Jobs.
Yes, please squash it is slightly easier to manage cherrypicks then. |
…to respect workload active state
|
update: |
…n logic to respect workload active state" This reverts commit 4ad258f.
|
/lgtm |
|
@mimowo: once the present PR merges, I will cherry-pick it on top of In response to this:
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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mimowo, tg123 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 |
|
LGTM label has been added. Git tree hash: 4d71e00756b773f50d5cc402f7a9ce58b3006168
|
|
@mimowo: new pull request created: #7270 In response to this:
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: #7199 failed to apply on top of branch "release-0.13": In response to this:
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. |
|
@tg123 the PR prepared by the robot does not build, would you like to prepare a cherrypick PR manually using the ./hack/cherry_pick_pull.sh? |
|
sure will send 2 pr to pick |
…7199) * Add JobWithCustomWorkloadActivation interface and update reconciliation logic * Add tests for workload activation in generic job reconciliation * Add WorkloadActiveLabel constant and update job reconciliation logic to respect workload active state * Revert "Add WorkloadActiveLabel constant and update job reconciliation logic to respect workload active state" This reverts commit 4ad258f.
…7199) * Add JobWithCustomWorkloadActivation interface and update reconciliation logic * Add tests for workload activation in generic job reconciliation * Add WorkloadActiveLabel constant and update job reconciliation logic to respect workload active state * Revert "Add WorkloadActiveLabel constant and update job reconciliation logic to respect workload active state" This reverts commit 4ad258f.
…7286) * introduce JobWithCustomWorkloadActivation interface (#7199) * Add JobWithCustomWorkloadActivation interface and update reconciliation logic * Add tests for workload activation in generic job reconciliation * Add WorkloadActiveLabel constant and update job reconciliation logic to respect workload active state * Revert "Add WorkloadActiveLabel constant and update job reconciliation logic to respect workload active state" This reverts commit 4ad258f. * refactor: simplify mock expectations in TestReconcileGenericJobWithCustomWorkloadActivation
* Add JobWithCustomWorkloadActivation interface and update reconciliation logic * Add tests for workload activation in generic job reconciliation * Add WorkloadActiveLabel constant and update job reconciliation logic to respect workload active state * Revert "Add WorkloadActiveLabel constant and update job reconciliation logic to respect workload active state" This reverts commit 4ad258f.
|
/kind feature |
I agree with postponing the decision for active annotation support. |
|
/release-note-edit |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Background:
I am integrating Kueue with a custom job type that has its own flag to control pause and resume behavior. This pause/resume mechanism is independent of GenericJob.Suspend(), as Suspend() has a different semantic meaning and does not directly map to workload.active.
Problem:
When the custom job is paused, it should release all resources and enter a hibernation state — behavior equivalent to setting workload.active = false.
Currently, jobs can be paused by implementing JobWithCustomWorkloadConditions and emitting a WorkloadDeactivationTarget, but there is no way to re-activate the workload once it’s deactivated.
Solution:
This PR introduces the JobWithCustomWorkloadActivation interface, allowing workloads linked with custom jobs to explicitly decide when to sleep or wake, enabling full control over activation and deactivation lifecycle.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?