Skip to content

fix(pool): provenance tagging + private-ECR pull grants for pool workers (#1148) - #1201

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1148-pool-grants
Oct 20, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1148-pool-grants

Conversation

@scttfrdmn

@scttfrdmn scttfrdmn commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Pool workers now get the provenance tagging actions spawn task run grants, plus an ECR pull grant when the pool's tasks run a private-ECR image.

Fixes #1148

What changed

  • Provenance. The pooled job script (taskproto.GeneratePooledJobScript) runs spored provenance upload for outputs, as task run does; that step is not gated on signalComplete. The worker policy granted only s3:PutObject, so uploads fell back to untagged aws s3 cp. poolWorkerPolicy now grants the provenance actions on the results bucket and on every --s3-write bucket. Read-only buckets do not get them. The list is now one var, provenanceWriteActions, shared by taskStagingPolicyFor and the pool.
  • ECR. Specs arrive after pool create, so the pool cannot read the image from a spec. pool create --container IMAGE (repeatable) declares the images instead. ecrPullPolicies is the old taskExtraPolicies logic generalised to several images, with taskExtraPolicies now delegating to it. It adds ecr:ReadOnly when any declared image is private ECR. The role request is built by a new pure function, poolWorkerRoleConfig.

Gates (each watched failing against a revert that compiles)

Gate Revert Result
TestPoolWorkerPolicyGrantsTaskRunsProvenanceActions: discovers the provenance actions as taskStagingPolicyFor(provenance=true) minus (false), fails if it finds none, then requires each on the results bucket and the write bucket but not the read bucket drop the results-bucket statement / drop the --s3-write statement FAIL / FAIL
same gate, discovery side add s3:PutObjectRetention to task run's provenance statement only FAIL (a new task-run action is required of pools automatically)
TestPoolECRGrantMatchesTaskRun: pool grant iff taskExtraPolicies grants, over a corpus of private-ECR, public ECR, Docker Hub, bare and ghcr images (asserts both sides are exercised), plus the mixed and none cases drop Policies: from poolWorkerRoleConfig FAIL
TestPoolContainerFlagReachesTheRole same FAIL

Merge note

Rebased onto main after #1192, #1198 and #1200 merged. poolWorkerRoleConfig keeps #1198's per-pool RoleName/Tags and adds this PR's containers parameter and Policies. #1198's concurrent-grants gate still passes, and still fails with the shared role name restored.

Checks

  • make check: all steps passed except check-build-tags, which fails on the /private/tmp worktree path (known on main).
  • make check-docs: clean. semgrep --config=auto --error: clean.

Not verified

Not run on AWS. nf-spawn, which creates pools for its users, will need to pass --container for private-ECR processes. That is a separate change in nf-spawn.

@scttfrdmn scttfrdmn added this to the v0.136.0 milestone Oct 19, 2026
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/pool.go 83.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

The pooled job script uploads outputs with spored provenance upload, as
task run does, but the worker policy lacked s3:PutObjectTagging and
s3:PutObjectAnnotation, so pooled outputs landed untagged. Grant them on
every bucket a worker writes, from the same action list task run uses.
pool create gains --container; a private-ECR image adds ecr:ReadOnly,
decided by the same helper as task run.

Fixes #1148
@scttfrdmn
scttfrdmn force-pushed the fix/1148-pool-grants branch from 4feee9f to 3439b9f Compare October 20, 2026 01:28
@scttfrdmn
scttfrdmn merged commit 77f0735 into main Oct 20, 2026
8 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1148-pool-grants branch October 20, 2026 01:41
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.

spawn pool: pooled outputs untagged (no tagging grant) and no ECR pull grant

1 participant