Repository navigation
Phase 1 (A): signed S3 reads in run-generate-archive.yml - #40
Merged
Merged
Conversation
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
Phase 1 (A) of epic nemarOrg/nemar-cli#736. Make
run-generate-archive.ymlread annexed blobs with authenticated S3GetObjectCommand(the same AWS creds the step already uses to write the zip) instead of anonymoushttps.getagainst the public S3 URL.Why
When nm000111 was approved, this workflow ran seconds after the publish cascade flipped the dataset's S3 prefix public, before the bucket-policy change propagated. The anonymous blob reads all returned HTTP 403, so the job shipped a hollow zip (
0 annexed + 639 regular + 126 skipped) and exited 1. The job already heldAWS_ACCESS_KEY_ID/SECRETin its env but used them only for the multipart upload. Signed reads are visibility-independent (an IAM principal withs3:GetObjectis not subject to the anonymous-public bucket-policy carve-out), so the race disappears and private datasets read fine too. No new secret: the orgAWS_ACCESS_KEY_IDalready hasGetObjecton theobjects/prefix, as proven byscripts/zarr/generate_zarr.py(authenticatedaws s3 cp, many successful runs).Changes (only the inline
stream-archive.jsheredoc)GetObjectCommand; drop thehttps/httprequires andS3_BASE.fetchUrl(<public URL>)blob fetch with a signeds3.send(GetObjectCommand)via a newgetAnnexObject()helper that streamsresp.Bodyinto the archive.getAnnexObject()adds a small bounded backoff (3 attempts) for transient cold-start/throttle errors.skipped > 0exit-1 guard, and the outer idempotency head-object guard. A genuinely missing blob still throws -> skipped -> incomplete -> exit 1 (only the cause of a skip changes from "not-yet-public" to "truly absent").Closes nemarOrg/nemar-cli#738
Part of epic nemarOrg/nemar-cli#736
Test plan (real dispatches, no mocks)
Dispatched the branch's workflow (
--ref fix/issue-738-archive-signed-reads) so the branch's script ran:Archive complete: 126 annexed + 639 regular + 0 skipped-> complete zip. The original 2026-06-10 run on the anonymous path skipped all 126.1 annexed + 8 regular + 0 skipped.Private-at-S3 case: nm099999's prefix is anonymously readable (not in the deny-list), so it could not force the 403 locally; the genuine private reproduction is nm000111's 2026-06-10 failure (those blobs returned 403 anonymously while private, then 200 after the public flip). Signed reads on a private prefix are guaranteed by S3 IAM semantics and already demonstrated in production by the zarr converter using the same credentials.