Skip to content

feat(task): TaskSpec resources.s3_read_write + placement block (spawn#386) - #414

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/386-taskspec-extension
Jul 20, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/386-taskspec-extension

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

Extends the workflow-adapter TaskSpec contract (spawn#386) so the last two adapters — snakemake and nf-spawn — can migrate to spawn task run without regressing. Two additions, both optional (an empty spec is unchanged behavior):

1. resources.s3_read_write (the snakemake blocker)

A list of s3://bucket[/prefix] URIs the task's own tooling reads/writes/deletes/lists beyond the inputs/outputs manifests. The scoped instance profile now grants s3:ListBucket + s3:GetObject/PutObject/DeleteObject on those whole buckets.

Why: the snakemake real-AWS smoke failed with AccessDenied: s3:ListBucket on the storage bucket. Snakemake's own S3 storage plugin (not the spawn wrapper) does the file I/O — including bucket-level listing/footprint checks — but the scoped policy only covered buckets named in the manifests, and snakemake has none. I read the plugin's source to confirm the exact actions (objects.filter→ListBucket, head_bucket→ListBucket, Object.load/download_file→GetObject, upload_file→PutObject, delete→DeleteObject).

2. placement block (the nf-spawn launch knobs)

Optional launch-time fields — ami, availability_zone, attached EBS volumes (from snapshots, mounted at a path), fsx_lustre_id, efs_id — the analogs of nf-spawn's ext.ami/ext.az/ext.volumes/ext.fsx/ext.efs. Without these, migrating nf-spawn to spawn task run would silently drop them for existing users.

Wiring: AMI/AZ/volumes map to LaunchConfig; FSx/EFS/volume mounting goes through a new launcher.Options.StorageScript hook (the headless Provision didn't thread storage before), reusing pkg/userdata.GenerateStorageUserData and the CLI's device-name assignment.

Testing

  • pkg/taskproto: validation tests for s3_read_write (must be s3://) and volumes (must be snap-, needs mount path); a good-spec test exercising the full placement.
  • cmd: taskStagingPolicy read-write-bucket test (asserts ListBucket + DeleteObject, still scoped, no Resource:"*"); s3Buckets2 test.
  • pkg/launcher: existing tests green with the new Options.StorageScript.
  • Full go build ./..., gofmt, vet clean on changed packages.

Unblocks: snakemake-executor-plugin-spawn#1 (re-smoke with s3_read_write) and the nf-spawn migration (placement).

Refs #386

…mes/FSx/EFS)

Extends the workflow-adapter TaskSpec contract (spawn#386) so the remaining
adapters can migrate without regressing:

- resources.s3_read_write []string: s3://bucket[/prefix] URIs the task's own
  tooling reads/writes/deletes/lists beyond the inputs/outputs manifests. The
  scoped instance profile now grants ListBucket + object Get/Put/Delete on those
  whole buckets. Needed by snakemake-executor-plugin-spawn, whose S3 storage
  plugin does bucket-level listing (the smoke caught AccessDenied on ListBucket).

- placement block: optional ami, availability_zone, attached EBS volumes (from
  snapshots), fsx_lustre_id, efs_id — the nf-spawn ext.* analogs. Wired into
  taskLaunchConfig (AMI/AZ/volumes) + a new launcher Options.StorageScript hook
  that mounts FSx/EFS/volumes before the workload (reuses pkg/userdata).

Both fields are optional; an empty spec is unchanged behavior. Validation added
for s3:// URIs and snap- ids. taskproto + launcher + cmd tests green.

Refs #386
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 41.57303% with 52 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/task.go 32.46% 51 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit e60223b into main Jul 20, 2026
7 checks passed
scttfrdmn added a commit that referenced this pull request Jul 20, 2026
MINOR: spawn#386 workflow-adapter contract — task run --wait -o json emits the
CompletionRecord (#412) + TaskSpec resources.s3_read_write & placement block
(#414). Unblocks the snakemake + nf-spawn adapter migrations.
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