Keep the launcher suspended until the workers are ready - #868
Open
poojarishreyas wants to merge 1 commit into
Open
poojarishreyas wants to merge 1 commit into
poojarishreyas wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
With `launcherCreationPolicy: WaitForWorkersReady`, the launcher must not start before all the worker Pods are ready. The policy is only evaluated when the launcher Job is created, which leaves it ineffective for suspended MPIJobs: - Worker Pods aren't created while the MPIJob is suspended, so `worker` is empty and `countReadyWorkerPods(worker) == len(worker)` trivially holds (0 == 0). The launcher Job is created; being suspended, nothing runs yet. - On resume, the launcher Job already exists, so the creation check is skipped altogether and the Job is unsuspended in the very sync that creates the worker Pods. The launcher Pod then starts while no worker is ready, which is exactly what the policy is meant to prevent. A running MPIJob that gets suspended and resumed hits the same path. Extract the policy check into launcherCanStart() and apply it when unsuspending the launcher Job too, so that the Job is still created upfront, as Kueue expects, but only starts once all the workers are ready. Fixes kubeflow#615 Signed-off-by: Shreyas Ananda Poojary <shreyaspoojari6@gmail.com>
poojarishreyas
force-pushed
the
fix-suspended-launcher-creation-policy
branch
from
September 22, 2026 07:32
501e8da to
3a1e56d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it
With
launcherCreationPolicy: WaitForWorkersReady, the launcher must not start before all the worker Pods are ready. The policy is only evaluated when the launcherJobis created, which makes it ineffective as soon as the MPIJob is suspended:workeris empty andc.countReadyWorkerPods(worker) == len(worker)trivially holds (0 == 0). The launcherJobis created — suspended, so nothing runs yet.Jobalready exists, so the creation check is skipped altogether and theJobis unsuspended in the very sync that creates the worker Pods. The launcher Pod starts while no worker is ready, which is exactly what the policy is meant to prevent. A running MPIJob that is suspended and then resumed hits the same path.This is the case @alculquicondor pointed out in #617:
and this PR implements the fix suggested right after:
The policy check is extracted into
launcherCanStart()and applied when unsuspending the launcherJobas well as when creating it. The launcherJobis therefore still created upfront (suspended), which Kueue relies on, but its Pod only starts once every worker is ready.AtStartupbehaviour is unchanged.Which issue(s) this PR fixes
Fixes #615
Checklist
TestResumeMPIJobWithWaitForWorkersReady— a suspended MPIJob is resumed; the worker Pods are created in that sync and aren't ready, so the launcher must stay suspended. Onmasterthis fails with an unexpectedupdate jobsaction carryingSuspend:*false.TestResumeMPIJobWithWaitForWorkersReadyAndReadyWorkers— same, with all workers already running and ready: the launcher is unsuspended as expected.go test ./pkg/...andgolangci-lint runpass.