Skip to content

SSM: SendCommand should (optionally) execute the shell command, not always return empty Success #345

Closed

Description

@scttfrdmn

Summary

SendCommand/GetCommandInvocation exist (added in #258) but the emulator is a success-stub: sendCommand immediately records Status="Success" with empty StandardOutputContent/StandardErrorContent and never runs the command's shell. So a test can verify that a command was sent, but not what it did — there's no way to assert the effect (e.g. a file written, an exit code, captured stdout).

Why

spawn's cohort MPI path uses SSM Run Command for two behaviors that can only be behavior-tested against real AWS today:

  1. Control-plane peer distribution — the Assembler base64 -ds the peers JSON and writes /etc/spawn/job-array-peers.json on every node via RunShellScript. Against the stub we can confirm the push was issued, but not that the file content is correct.
  2. MPI-readiness Enroller — probes command -v mpirun / fi_info -p efa and keys off the invocation's ResponseCode. The stub always returns ResponseCode=0, so the not-ready path can't be exercised.

Ask

Offer a way for GetCommandInvocation to return meaningful results, e.g. one of:

  • A programmable-response hook: register per-(instance, document/command-substring) canned {Status, ResponseCode, StdOut, StdErr} so tests can assert both directions.
  • Or an opt-in execute mode for AWS-RunShellScript that actually runs the commands parameter in a sandboxed shell and captures real output/exit code.

Even just the programmable-response hook (no real shell) would unblock asserting push payloads and non-zero readiness probes.

Context

Found while adding the cohort MPI integration to spawn (SSM Assembler + Enroller). Companion to the placement-group EC2 gap I'm filing separately. Follows #258 (which added the SendCommand/GetCommandInvocation surface).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ssmtype: feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions