Repository navigation
fix(launch): non-interactive stdin (#34) + STS→IMDS identity fallback (#33) - #36
Merged
Merged
Conversation
…ck (#33) Two bugs that block nf-spawn (spawn invoked from a Nextflow/Java subprocess). #34 — launch read stdin as truffle JSON whenever stdin wasn't a TTY, so a caller passing explicit flags from a piped/non-TTY stdin (ProcessBuilder) hit "failed to parse JSON: unexpected end of JSON input" on every launch. Pipe mode now requires NO --instance-type; with an explicit instance type, launch uses flags mode and never reads stdin (TTY or pipe). Extracted launchMode() as a pure, unit-tested predicate. #33 — GetCallerIdentity hard-failed when an STS VPC interface endpoint with private DNS resolves sts.<region>.amazonaws.com to an unroutable private IP, timing out every spawn operation. GetAccountID and GetCallerIdentityInfo now fall back to EC2 IMDS (instance identity document) for the account ID/region when STS is unreachable; GetCallerIdentityInfo synthesizes a best-effort ARN. The launch audit-identity lookup is now best-effort (account=unknown on total failure) rather than blocking the launch. Note: the sweep/burst cross-account STS calls (devCfg) are intentionally left as-is — they need the dev account's identity, which IMDS can't provide. Tests: launchMode covers the pipe-vs-flags matrix incl. the #34 case; existing substrate/identity tests cover the STS-success path. Build/vet/test green.
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.
Two bugs blocking nf-spawn (spawn invoked from a Nextflow/Java subprocess in aws-microbiome-demo). Both small; grouped because they block the same path.
#34 —
spawn launchfails parsing JSON when stdin is a pipelaunch entered "pipe mode" (read truffle JSON from stdin) whenever stdin wasn't a TTY. A caller passing explicit flags from a piped/non-TTY stdin (Java
ProcessBuilder) therefore hitfailed to parse JSON: unexpected end of JSON inputon every launch.Fix: pipe mode now requires no
--instance-type. With an explicit instance type, launch uses flags mode and never reads stdin (TTY or pipe). Extracted the three-way decision into a pure, unit-testedlaunchMode().#33 — STS GetCallerIdentity times out behind an STS VPC endpoint
When a VPC has an STS interface endpoint with private DNS,
sts.<region>.amazonaws.comresolves to a private IP; from a subnet without a route, every spawn op times out atGetCallerIdentity.Fix:
GetAccountIDandGetCallerIdentityInfofall back to EC2 IMDS (instance identity document → account ID/region) when STS is unreachable;GetCallerIdentityInfosynthesizes a best-effort ARN. The launch audit-identity lookup is now best-effort (account=unknownon total failure) instead of hard-failing the launch.Cross-account sweep/burst STS calls (
devCfg) are intentionally untouched — they need the dev account's identity, which IMDS can't provide.Tests
TestLaunchModecovers the pipe-vs-flags-vs-wizard matrix incl. the #34 ProcessBuilder case; existing substrate/identity tests cover the STS-success path. Build/vet/test green.Closes #33, closes #34.