Repository navigation
Description
Problem
The five workflow-engine adapters (nf-spawn, miniwdl-spawn, cwl-spawn, snakemake-executor-plugin-spawn, spawn-airflow) each independently reimplement the same machinery: config/resource parsing, resource→instance mapping via truffle, S3 input/output staging, user-data construction, launch, polling, cancellation, .exitcode interpretation, and error translation. This is confirmed by inspection — the Java (nf-spawn) and four Python repos share no common library. That will drift: staging behavior, retry classification, and completion semantics will diverge subtly across adapters.
Raised by an external architecture review of the extension/workflow subsystem.
Proposed shape
A formal Spawn task-execution protocol + a shared adapter library defining common types, so each adapter only translates its native task object into this protocol:
TaskSpec(command, container, resources, inputs, outputs, lifecycle)ResourceRequest(cpu, memory_gib, architecture, families, purchase, fallback, headroom)InputManifest/OutputManifest(S3 ↔ local staging)LaunchResult,TaskState,CompletionRecord(durable.exitcode-in-S3)Cancellation,RetryClassification(app-exit vs capacity vs spot-interrupt vs staging vs TTL vs controller-lost)
Example TaskSpec (JSON) is in the review.
Related sub-proposals (may be separate issues or folded here)
- Shared capacity broker: unify truffle sizing + quota check + Spot fallback + Lagotto waiting behind one placement policy, instead of each adapter calling spawn directly.
- Short-task instance reuse / pooling: avoid a fresh EC2 boot per sub-minute task where a warm instance could serve several.
- Execution manifest / provenance record: machine-readable record per task (spawn+adapter+engine versions, AMI, instance type, arch, region/AZ, container digest, plugin versions, command, env allowlist, input object versions, spot vs on-demand, start/end, exit code, termination reason) for reproducibility.
Docs note
The docs (docs/guides/workflow-engines.md) now point users here when explaining that adapters are early/experimental and share an evolving execution model. Benefits: consistent staging/logs/retries/telemetry, shared tests, easier new integrations.
Activity
scttfrdmn commentedon Jul 19, 2026
Sub-proposals now tracked as: #387 (plugin inspect/dry-run), #388 (plugin permissions block), #389 (first-class array reporting), #390 (sweep grid expansion), #391 (task diagnose), and spore-host/spore-plugins#8 (registry supply-chain). The execution-manifest/provenance idea lives in #391's orbit and this issue.
scttfrdmn commentedon Jul 19, 2026
Design RFC drafted in PR #397 (
docs/workflow-adapter-protocol-rfc.md) — proposes the TaskSpec/CompletionRecord/RetryClassification contract, a Go reference impl, and a phased migration for the five adapters, with explicit open decisions. This issue stays open to track the decision + implementation.docs: RFC for a shared workflow-adapter task-execution protocol (#386) (
scttfrdmn commentedon Jul 19, 2026
Reopened: PR #397 landed the design RFC (
docs/workflow-adapter-protocol-rfc.md), not the implementation. This issue stays open to track the open decisions in the RFC and the actualpkg/taskproto+ adapter migration.feat(task): taskproto foundation + `task run --dry-run` (#386)
feat(task): taskproto foundation + `task run --dry-run` (#386) (#399)
scttfrdmn commentedon Jul 19, 2026
Increment 1 landed in PR #399:
pkg/taskproto(TaskSpec/ResourceRequest/Manifest/Lifecycle + offline Validate), the cheapest-instance sizer (multi-family allow-list + memory headroom over truffle), andspawn task run --spec … --dry-run(sizes + prints a plan, launches nothing; example atexamples/task-spec.json). Still open for the later increments: real launch, the durable.exitcode-in-S3 CompletionRecord, RetryClassification, and adapter migration.feat(task): add 'spawn task status' + 'task run --wait' completion po…
fix(task): populate on-demand price in the sizer's finder
feat(task): add 'spawn task status' + 'task run --wait' completion po…
fix(iam): default instance-profile trust to ec2 when TrustServices empty
feat(task): add 'spawn task status' + 'task run --wait' completion po…
2 remaining items
feat(task): add 'spawn task status' + 'task run --wait' completion po…
fix(task): run container docker steps as root + wait for the daemon
feat(task): run the command inside spec.container (spawn#386 incremen…
feat(task): task run --wait -o json emits the CompletionRecord (spawn…
feat: dispatch each step via spawn task run (spawn#386 adapter migrat…
fix: move task job dir to /var/tmp so the unprivileged command user c…
feat: dispatch each task via spawn task run (spawn#386 adapter migrat…
feat: dispatch each task via spawn task run (spawn#386 adapter migrat…
feat(task): TaskSpec resources.s3_read_write + placement (AMI/AZ/volu…
feat: declare storage buckets in resources.s3_read_write (spawn#414)
feat: dispatch each job via spawn task run (spawn#386 adapter migrati…
feat(task): TaskSpec resources.instance_type pins the exact instance …
feat: dispatch each task via spawn task run (spawn#386 adapter migrat…
scttfrdmn commentedon Jul 20, 2026
Adapter migration complete — all 5 adapters on the shared protocol ✅
All five workflow adapters now dispatch each task via
spawn task run(build a TaskSpec → detached run /--wait→ CompletionRecord), instead of each reimplementing launch/sizing/staging/completion. Each was validated end-to-end on real AWS (gated, TTL-bounded, leak-checked) before release.snakemake --executor spawnContract shipped
task run --wait -o jsonemits the CompletionRecord (feat(task): task run --wait -o json emits the CompletionRecord (spawn#386) #412); TaskSpecresources.s3_read_write+placementblock (AMI/AZ/volumes/FSx/EFS) (feat(task): TaskSpec resources.s3_read_write + placement block (spawn#386) #414).resources.instance_typeexact-pin (Add resources.instance_type to TaskSpec for exact instance-type pinning #413).task run(feat(task): real 'spawn task run' — launch + S3 staging + durable completion record (spawn#386) #404),task status+--wait(feat(task): 'spawn task status' + 'task run --wait' completion poller (spawn#386) #405), container execution (feat(task): run the command inside spec.container (spawn#386 increment 3) #408), spored-baseline fix (task run: confirm on_complete=terminate fires (spored version + completion-file) — TTL is currently the only guaranteed teardown #406/fix(task): grant spored self-management baseline on scoped task profiles (#406) #407).Bugs the smokes caught (all fixed pre-release)
/mnt→/var/tmp(unprivileged command user can't mkdir under root-owned /mnt).work/never recreated →mkdir -pbefore cd.ListBucket→ drove thes3_read_writeTaskSpec field (feat(task): TaskSpec resources.s3_read_write + placement block (spawn#386) #414).t3.medium→t3.nano) → drove theinstance_typepin (Add resources.instance_type to TaskSpec for exact instance-type pinning #413).SPAWN_COMPLETEvs the wrapper's) →signalCompletionflag.Every smoke instance self-terminated; zero leaks. Container execution, the shared protocol, and all five adapters are done — this can close.