Skip to content

--count/--mpi job arrays ship DOUBLE-gzipped user-data: cloud-init runs nothing, members never enroll, and the failed cohort leaves instances running #671

Closed

Description

@scttfrdmn

Summary

No job-array/MPI instance boots its bootstrap. cmd/launch_jobarray.go:88-112 base64-decodes instanceConfig.UserData. Since encodeUserData (launch_config.go:357) that value is gzip, not text. The code then appends "\n" + mpiScript to the compressed bytes and calls encodeUserData again. What ships is gzip( gzip(bootstrap) + "\n" + mpiScript ).

cloud-init unwraps one gzip layer, finds binary, and skips it:

__init__.py[WARNING]: Unhandled non-multipart (text/x-not-multipart) userdata: 'b'\x1f\x8b\x08\x00...

/var/lib/cloud/instance/scripts/ is empty, cloud-init finishes at 7 s uptime, spored is not installed, and there is no peers file or hostfile.

Repro (0.116.0 @528e038, us-east-1)

spawn launch gchp-spawn-smoke --instance-type c8g.48xlarge --count 2 --job-array-name gchp-spawn-smoke \
  --mpi --efa --skip-mpi-install --mpi-processes-per-node 24 --ttl 1h --on-complete terminate --command "..."

→ gchp-spawn-smoke-{0,1}: terminal/PhaseBudgetExceeded at phase=enrolled after 2 rung(s) (~5.5 min), plus could not delete abandoned placement group ... InvalidPlacementGroup.InUse.

Second bug, same run: the failed cohort leaves its instances RUNNING

After "job array launch failed (2/2 members)", both c8g.48xlarge were still running ($7.66/hr each). That's also why the PG was "in use". Since spored never installed, nothing on-instance enforces spawn:ttl either. Only the reaper Lambda stands between this and indefinite billing, if the account has it (#624). I terminated them by hand after 7.4 min ($1.9). A cohort that goes terminal must terminate the members it launched before returning, and then delete the PG.

Fix

  • Build the combined script from the plain-text base script, i.e. keep the unencoded script on the config, or gunzip before appending. Then encode once.
  • Add a test that decodes the final UserData once (base64 → gunzip) and asserts it starts with #! and contains both the bootstrap and the MPI block.
  • Add an e2e/smoke check that a --count 2 --mpi member reaches enrolled. This has evidently been broken since user-data gzip landed.
  • On cohort terminal failure: terminate the members, then delete the PG.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions