feat: dispatch each task via spawn task run (spawn#386 adapter migration) - #1
Merged
Merged
Conversation
…ion)
Ports spawn-airflow to the shared workflow-adapter protocol: instead of
building a user-data script + `spawn launch` + `.exitcode`-in-S3 polling, the
operator builds a spawn TaskSpec and dispatches `spawn task run` (detached),
then polls `spawn task status --check-complete` (sync) or defers to the trigger
(deferrable), reading the exit code from the CompletionRecord. spawn owns
sizing (truffle), S3 staging, the durable completion record, and a scoped IAM
profile.
- SpawnExitCodeTrigger → SpawnTaskStatusTrigger (polls `spawn task status`, not
the raw .exitcode object; serialized kwargs now {task_id, region, poll}).
- New pure taskspec.py (TaskSpec builder + CompletionRecord parse). Deleted
launch/completion/bootstrap/sizing.py (spawn owns them).
- Job dir /mnt/spawn_airflow_job → /var/tmp/spawn_airflow_job (user-writable —
spawn runs the command as the unprivileged login user).
- instance_type now steers the family (not an exact pin); on_kill terminates by
task_id.
- 22 pytest + ruff + mypy green. Real-AWS smoke pending (gated).
Refs spore-host/spawn#386
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.
Summary
Ports spawn-airflow to the spawn task-execution protocol (spawn#386), following cwl-spawn and miniwdl-spawn. The operator stops orchestrating the launch itself and instead builds a TaskSpec and shells out to
spawn task run.Before → after
executebuilt a user-data script, calledspawn launch … --user-data-file … --on-complete terminate, and polled a durable.exitcodeobject in S3 (sync loop orSpawnExitCodeTrigger).spawn task run(detached) → pollspawn task status --check-complete(sync) or defer toSpawnTaskStatusTrigger→ read the CompletionRecord exit code.spawn now owns: instance sizing (truffle), S3 staging, the durable completion record, and a scoped least-privilege IAM profile (was
--iam-policy s3:FullAccess).Trigger rename (breaking for deferrable users)
SpawnExitCodeTrigger→SpawnTaskStatusTrigger: it pollsspawn task statusinstead of the raw.exitcodeS3 object. Serialized kwargs change from{s3_prefix, region, poll_interval}to{task_id, region, poll_interval}.Notes
/mnt/spawn_airflow_job→/var/tmp/spawn_airflow_job(user-writable — spawn runs the command as the unprivileged login user, which can'tmkdirunder root-owned/mnt; same class of fix as cwl-spawn#2 / the miniwdl port).commandfetches its own inputs (mirroringEcsRunTaskOperator). The TaskSpec has only an output manifest syncing the job dir back toworkdir_s3.instance_typenow steers the family (e.g.c7i.4xlarge→c7i), not an exact pin (spawn#413 follow-up).on_killterminates by task_id (captured mid-flight).Removed
launch.py,completion.py,bootstrap.py,sizing.py+test_helpers.py(spawn owns these). New puretaskspec.py.Testing
pytest22 pass (newtest_taskspec.py; reworkedtest_operator.pyasserts detached dispatch, status-poll, deferral toSpawnTaskStatusTrigger, terminate-by-task-id;test_drift_guard.pyunchanged).ruff+mypyclean.examples/example_dag.py's hello task end-to-end and leak-check. Not shipping the release until that passes.Refs spore-host/spawn#386