Skip to content

fix: pass task script via --user-data-file, not bare --user-data path (#13) - #15

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/13-user-data-prefix
Jun 3, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/13-user-data-prefix

Conversation

@scttfrdmn

Copy link
Copy Markdown
Collaborator

Problem

SpawnTaskHandler.submit() passed the task script's temp-file path as the value of --user-data. spawn treats a --user-data value as inline user-data unless it starts with @ (spawn cmd/launch.go:1938-1952), so the literal path string /tmp/nf-spawn-….sh was baked into the instance's user-data and the task script never executed.

Fix

Use the dedicated --user-data-file flag, which reads the file's contents unconditionally. Extracted the argv assembly into a package-scope buildLaunchCommand() so it's unit-testable.

Test

Spock spec asserts the script is carried by --user-data-file (and never a bare --user-data), plus the non-blocking --wait-for-running=false/--wait-for-ssh=false flags and conditional --spot. ./gradlew test green (3 tests).

Fixes #13


Note: this only makes the task script run. Tasks will still hang in PENDING until output staging lands (#14) — the script's results aren't returned to task.workDir. #13 → #14 is the sequence.

…#13)

submit() passed the task script's temp-file path as the value of
--user-data. spawn treats a --user-data value as INLINE user-data unless
it starts with '@', so the literal path string was baked into the
instance's user-data and the task script never executed.

Use the dedicated --user-data-file flag, which reads the file's contents
unconditionally. Extract the argv assembly into a package-scope
buildLaunchCommand() and add a Spock guard test asserting the script is
carried by --user-data-file (never a bare --user-data), plus the
non-blocking wait flags and conditional --spot.

Fixes #13
@scttfrdmn
scttfrdmn merged commit 9c71bcd into main Jun 3, 2026
1 check passed
@scttfrdmn
scttfrdmn deleted the fix/13-user-data-prefix branch June 3, 2026 04:32
@scttfrdmn scttfrdmn mentioned this pull request Jun 3, 2026
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.

--user-data passed as bare path → task script baked in as literal inline string, never runs

1 participant