feat: multi-runner batches — count input for matrix builds#57
Merged
Conversation
…es, one label) Matrix builds needed N runners = N hand-wired start/stop jobs + N boot waits. Now one start launches N instances behind the single shared label GitHub already distributes matrix jobs across. - New start inputs: count (default 1) and allow-partial (default false). One RunInstances call with MinCount/MaxCount = count (all-or-nothing); allow-partial opts into MinCount 1 with the realized set in outputs + a warning. - Wait completes only when all N runners register (gh.countOnlineRunners); a bootstrap failure on ANY instance (aws.getBatchBootstrapStatus) fails fast, and handleStartFailure captures every instance's console then terminates them all — no half-fleet leaks. - New outputs: ec2-instance-ids (JSON array); ec2-instance-id stays the first id for compat. Signature/TTL tags apply to every instance in the batch. - Stop accepts ec2-instance-ids (or the scalar): terminates all (idempotent — already-gone instances are skipped, and NotFound no longer burns retries) and deregisters ALL runners sharing the label (gh.removeAllRunners), with per-instance failure reporting. - count 1 default: outputs/behavior unchanged (regression). EIP is single- instance only (ignored with a warning for batches). Capacity fallback retries placement for the whole batch. - Removed now-dead terminateEc2Instance / removeRunner (superseded). Tests: launch/fallback/spot now return instanceIds; getBatchBootstrapStatus, batch handleStartFailure (capture-all-then-terminate-all, preserve-all), config count + stop-with-array validation (190 tests total). README "Matrix builds" section with a full workflow; action.yml inputs/outputs. Closes #45 Signed-off-by: kurok <22548029+kurok@users.noreply.github.com>
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 #45 — roadmap (#49) Phase 3. Sequenced after bootstrap diagnostics (#41), whose per-instance tags make N-way waits debuggable.
Problem
One invocation = one runner. Matrix builds meant N copies of start/stop wired by hand. The action already generates a unique shared label per start — extend "one instance behind a label" to "N behind a label", exactly how GitHub distributes matrix jobs.
What's here
count(default 1) +allow-partial(default false). OneRunInstancescall withMinCount/MaxCount = count(all-or-nothing);allow-partialopts intoMinCount 1with the realized set in outputs + a warning.countrunners are online (gh.countOnlineRunners); a bootstrap failure on any instance (aws.getBatchBootstrapStatus) fails fast. On failure/timeout, every instance's console is captured, then all are terminated — no half-fleet leaks.ec2-instance-ids(JSON array);ec2-instance-idstays the first id for compat. Signature + TTL tags apply to every instance.ec2-instance-ids(or the scalar) — terminates all (idempotent; already-gone instances skipped,NotFoundno longer burns retries) and deregisters all runners sharing the label (gh.removeAllRunners), with per-instance failure reporting.count: 1outputs/behavior byte-identical. EIP is single-instance only (ignored with a warning for batches). Capacity fallback retries placement for the whole batch (partial placement across subnets out of scope).terminateEc2Instance/removeRunner(superseded).Tests / build
instanceIds;getBatchBootstrapStatus(first failed across batch), batchhandleStartFailure(capture-all-then-terminate-all order + preserve-all), configcountvalidation + stop-with-array. 190 tests pass (was 179). Lint clean, dist rebuilt (verify-dist green).Docs
README "Matrix builds (multiple runners)" with a full 4-shard workflow;
action.ymlinputs/outputs.Out of scope (stated in issue)
Heterogeneous batches (call the action twice); queue-depth autoscaling.