Repository navigation
fix: repair s3:// input URI and expand ${LOCAL_DIR} in stage-in (#41) - #42
Merged
Merged
Conversation
The declared-input staging from #37/#38 emitted two broken commands so the inputs were never actually copied (silently, since the script runs `set -uo pipefail`, not `-e`): 1. nf-amazon's S3 Path renders `toUri().toString()` with an empty authority (`s3:///bucket/key`, three slashes), so the bucket landed in the path and `aws s3 cp` parsed an empty bucket. normalizeS3Uri() now collapses the leading `s3:///` to `s3://`. 2. The destination single-quoted the literal `${LOCAL_DIR}`, so the shell passed it to `aws` unexpanded — the file would have landed in a dir named `${LOCAL_DIR}`. `${LOCAL_DIR}/` is now kept outside the single quotes (only the stage name is quoted), matching how WORKDIR_S3/AWS_REGION are handled. Also guards each input copy with `|| exit 1` so a failed stage-in fails loud instead of letting the task run with a missing input and fail later with a confusing MissingFileException.
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.
Closes #41.
The filer (on 0.2.10, after #39's permission fix) read the actual generated staging script off the head node and found the declared-input copies from #37/#38 were malformed — so inputs were never landed, silently.
Two bugs in
buildInputStaging's emitted commandsBug 1 —
s3:///(empty authority). nf-amazon's S3PathrenderstoUri().toString()ass3:///bucket/key(three slashes) — the bucket lands in the path, not the authority, soaws s3 cpparses an empty bucket and fails. NewnormalizeS3Uri()collapses a leadings3:///→s3://.Bug 2 — unexpanded
${LOCAL_DIR}in the dest.shellQuote()wrapped the whole dest in single quotes, so the literal${LOCAL_DIR}was passed toawsverbatim — even with bug 1 fixed, the file would land in a directory literally named${LOCAL_DIR}. Now${LOCAL_DIR}/is kept outside the single quotes (only the stage name is quoted), same asWORKDIR_S3/AWS_REGION. Applies to both themkdir -pand theaws s3 cp.Plus: fail loud
The script runs
set -uo pipefail(not-e), so a failed un-pipedaws s3 cpwas silently ignored — the task then ran with a missing input, "succeeded" with no output, and failed downstream with a confusingMissingFileException: Missing output file(s) *.html. Each input copy is now guarded with|| { echo …; exit 1; }so a stage-in failure aborts loudly.Tests
35 total, 0 failures. Updated the 3 #37 staging tests to the corrected expanding format; added a malformed-
s3:///repair test, anormalizeS3Uriunit test, and a fail-loud assertion.Built + tested on JDK 17 / Nextflow 26.04.x.