Repository navigation
feat(task): TaskSpec resources.s3_read_write + placement block (spawn#386) - #414
Merged
Merged
Conversation
…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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
Extends the workflow-adapter TaskSpec contract (spawn#386) so the last two adapters — snakemake and nf-spawn — can migrate to
spawn task runwithout 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 theinputs/outputsmanifests. The scoped instance profile now grantss3:ListBucket+s3:GetObject/PutObject/DeleteObjecton 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.
placementblock (the nf-spawn launch knobs)Optional launch-time fields —
ami,availability_zone, attached EBSvolumes(from snapshots, mounted at a path),fsx_lustre_id,efs_id— the analogs of nf-spawn'sext.ami/ext.az/ext.volumes/ext.fsx/ext.efs. Without these, migrating nf-spawn tospawn task runwould silently drop them for existing users.Wiring: AMI/AZ/volumes map to
LaunchConfig; FSx/EFS/volume mounting goes through a newlauncher.Options.StorageScripthook (the headlessProvisiondidn't thread storage before), reusingpkg/userdata.GenerateStorageUserDataand the CLI's device-name assignment.Testing
pkg/taskproto: validation tests fors3_read_write(must bes3://) and volumes (must besnap-, needs mount path); a good-spec test exercising the full placement.cmd:taskStagingPolicyread-write-bucket test (asserts ListBucket + DeleteObject, still scoped, noResource:"*");s3Buckets2test.pkg/launcher: existing tests green with the newOptions.StorageScript.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