Skip to content

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

Closed

Description

@scttfrdmn

Bug: the workflow examples check a sweep with spawn status <sweep-id>, which looks the ID up as an instance

Found while fixing #1540. The examples' spawn launch commands are now gated, so their flags parse and the right param flag is used. The follow-up commands are not gated, and two of their patterns don't work.

1. spawn status <sweep-id> treats the sweep ID as an instance name

runStatus (cmd/status.go) takes args[0] as an instance ID or name. Only the deprecated --sweep-id flag reaches runSweepStatus. Hermetic run:

$ spawn status sweep-20261105-123456 --check-complete
Looking up instance sweep-20261105-123456...

So --check-complete on a sweep ID polls for an instance that doesn't exist, and --json prints nothing useful. That pattern is in 11 files under examples/workflows/: airflow (operators/spawn_operator.py, parameter_sweep_dag.py, taskflow_dag.py), argo/spawn-sweep-workflow.yaml, dagster/spawn_assets.py, luigi/spawn_pipeline.py, prefect/spawn_flow.py, step-functions/lambda/status_checker.py, temporal/spawn_workflow.py, wdl/spawn_task.wdl and the nextflow/README.md prose. The command for a sweep is spawn sweep status <sweep-id> (--check-complete, --output json).

2. "Wait" by launching the sweep again

examples/workflows/dagster/spawn_assets.py wait_sweep_op waits for a sweep it was handed by running spawn launch --param-file sweep.yaml --detach --wait. That starts a second sweep, which costs money. The Snakefile had the same bug, and #1540 fixed it there: the launch rule waits with --detach --wait, and the status rule reads spawn sweep status.

Suggested fix

Point the follow-ups at spawn sweep status. Remove the relaunch-to-wait. Then extend the #1540 example gate (cmd/example_launch_gate_test.go) to resolve every spawn <subcommand> invocation in examples/, not only spawn launch. That gate would also catch spawn status <sweep-id> passed with a sweep-shaped placeholder.

Also not a param file, and not referenced by any command: examples/staging/ml-training.yaml (top-level sweep_name:/count:/base_command:, same as the three files #1540 rewrote).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcomponent:spawndocumentation

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions