Skip to content

docs(examples): check sweeps with spawn sweep status; gate every status/sweep invocation in examples (#1543) - #1546

Merged
scttfrdmn merged 2 commits into
mainfrom
fix/1543-example-sweep-status
Nov 6, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
fix/1543-example-sweep-status

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1543

What was wrong

  • 11 workflow examples watched a sweep with spawn status <sweep-id>. That command looks its argument up as an instance, so --check-complete polled for an instance that doesn't exist and --json printed nothing about the sweep. The JSON keys they read (Status, TotalParams, Launched, Failed) also aren't in the output, which uses status, total_params, launched, failed.
  • Dagster's wait_sweep_op "waited" by running spawn launch --param-file sweep.yaml --detach --wait, which starts a second sweep.
  • Four more files started a sweep with spawn sweep --file …. That command doesn't exist, because spawn sweep is only a group: workflow-ml-training.yaml, workflow-ci-pipeline.yaml, multi-region-opportunistic.yaml and result-collection-example.sh.
  • examples/staging/ml-training.yaml was not a param file.

Fix

  • Airflow (operator, classic DAG, TaskFlow DAG), Argo, Dagster, Luigi, Prefect, Step Functions, Temporal and WDL now use spawn sweep status <id> --check-complete and spawn sweep status <id> --output json, and read the real JSON keys.
  • Dagster's wait_sweep_op polls the existing sweep. The usage lines use spawn launch --param-file. The script waits with spawn sweep status and collects with spawn sweep collect.
  • ml-training.yaml is now a real param file: one ensemble member per region, each reading that region's copy of the dataset. The launch gate checks its usage line.
  • The nextflow README now says nf-spawn polls each task's instance. Those are instances, so spawn status is correct there.
  • CWL and Snakemake needed no change. CWL only launches, and feat(launch): implement inline --params; examples use --param-file; gate every spawn launch in examples (#1540) #1544 already fixed Snakemake.

Gate

cmd/example_followup_gate_test.go extracts every spawn status / spawn sweep … invocation under examples/. It uses the same extractors and placeholder handling as the #1544 launch gate, which were refactored so they take a pattern. Each invocation must:

  • resolve to a runnable command;
  • parse with that command's flags;
  • use no deprecated flag;
  • pass its argument count.

A sweep-shaped positional argument to spawn status fails the gate. That covers sweep-…, $SWEEP_ID, <sweep-id>, $(cat /tmp/sweep_id.txt) and the Python sweep_id, which now stays visible as {expr:sweep_id}. A synthetic test checks that each bad form is caught, and another checks that the fixed forms pass.

Revert evidence: with examples/ checked out from origin/main, the gate fails 25 invocations. Those are every spawn status call in the 10 workflow files, the 4 spawn sweep --file usage lines, and the script's deprecated spawn status --sweep-id … --json.

The relaunch-to-wait in Dagster is not something the gate can detect. It is fixed by hand.

…nstead of relaunching; ml-training.yaml is a param file (#1543)
…xamples; fix the spawn sweep --file usage lines (#1543)
@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 1e1c76f into main Nov 6, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1543-example-sweep-status branch November 6, 2026 17:38
@scttfrdmn scttfrdmn mentioned this pull request Nov 6, 2026
4 tasks
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.

examples/workflows check a sweep with spawn status <sweep-id> (an instance lookup), and dagster relaunches the sweep to wait

1 participant