Skip to content

feat(batch): job dependencies (dependsOn) — gated launch (batch 4)#1988

Merged
vieiralucas merged 1 commit into
mainfrom
wt-batch-4
Jun 27, 2026
Merged

feat(batch): job dependencies (dependsOn) — gated launch (batch 4)#1988
vieiralucas merged 1 commit into
mainfrom
wt-batch-4

Conversation

@vieiralucas

@vieiralucas vieiralucas commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary

AWS Batch batch 4 — job dependencies (dependsOn), the orchestration feature every rival is weak on (ministack waitForTaskToken no-ops #959).

  • SubmitJob with dependsOn parks the job at PENDING and spawns a background waiter that launches it only once every dependency has SUCCEEDED; if any dependency FAILED the dependent job fails ("Dependent job failed"). The wait never blocks the SubmitJob call.
  • Refactor: the launch path (launch / launch_ecs_task / spawn_status_sync) is now standalone free functions taking a LaunchCtx bundle, so the spawned waiter launches with no &self, exactly like the inline SubmitJob path. launch_job is a thin &self wrapper.

Test plan

  • Unit (14): depends_on_parks_at_pending (no runtime → stays PENDING), plus existing.
  • Docker-gated e2e: depends_on_job_waits_for_its_dependency — B dependsOn A: B is PENDING while A runs (3s), both SUCCEEDED after. The existing real-execution / array / fail e2e still pass against the refactored launch path (all 4 green locally).
  • cargo clippy -p fakecloud-batch --bin fakecloud --all-targets -- -D warnings clean. Docs updated.

Next

Retry strategies + timeouts, then a CloudFormation AWS::Batch::* provisioner + tfacc.


Summary by cubic

Adds Batch job dependencies via dependsOn. Dependent jobs park at PENDING and launch only after all parents succeed; they fail if any parent fails. The wait is non-blocking and works with real ECS-backed execution.

  • New Features

    • SubmitJob with dependsOn sets job to PENDING and spawns a background waiter.
    • Launches when all dependencies are SUCCEEDED; fails with "Dependent job failed" if any is FAILED.
    • No blocking of the SubmitJob call; unchanged behavior when no runtime is present.
    • Tests: unit for PENDING gating; Docker e2e validates B waits for A. Docs updated.
  • Refactors

    • Extracted launch flow into free functions: launch, launch_ecs_task, spawn_status_sync, driven by a LaunchCtx.
    • launch_job is now a thin wrapper. Enables launching from the dependency waiter without &self.

Written for commit 4819688. Summary will update on new commits.

Review in cubic

- SubmitJob with `dependsOn` parks the job at PENDING and spawns a background
  waiter that launches it only once every dependency has SUCCEEDED; if any
  dependency FAILED the dependent job fails ("Dependent job failed"). The wait
  never blocks the SubmitJob call.
- Refactored the launch path (launch / launch_ecs_task / spawn_status_sync) into
  standalone free functions taking a `LaunchCtx` bundle, so the spawned waiter
  can launch with no `&self` exactly like the inline SubmitJob path. The
  `&self launch_job` is now a thin wrapper.

Tests: unit (dependsOn parks at PENDING without a runtime); Docker-gated e2e
(B dependsOn A: B stays PENDING while A runs, both SUCCEEDED after). Existing
real-execution + array e2e still pass against the refactored launch path. Docs
updated.
@vieiralucas vieiralucas merged commit 7a7021a into main Jun 27, 2026
103 checks passed
@vieiralucas vieiralucas deleted the wt-batch-4 branch June 27, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant