Repository navigation
refactor(ec2): decouple creation result from control plane - #5312
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
c452fb1 to
6a5790d
Compare
6a5790d to
3179711
Compare
3179711 to
0d1969f
Compare
0d1969f to
f990720
Compare
There was a problem hiding this comment.
Approving — clean refactor, and the classification logic all carried over faithfully (retryable sets, $fault/HTTP checks, the fleet-error path, and the spot→on-demand failover). Bounding the identifiers is a nice touch.
One side note, purely observability: the failure warns now log failureCodes instead of the error. Since createEc2Runner swallows AWS errors and returns a result (only AbortError rethrows), the raw error never reaches the outer logger.error either. Recognised AWS errors still surface as aws-name:/aws-code:, but anything that yields no codes — a non-AWS error, or a name/code filtered out by SAFE_FAILURE_IDENTIFIER — just logs failureCodes: [] with nothing to go on. Might be worth keeping error.message alongside the codes so the odd unexpected failure stays debuggable.
Tiny thing: a CreateFleet failure logs "Create fleet request failed." twice now.
f990720 to
6f33eb2
Compare
6f33eb2 to
9f10450
Compare
9f10450 to
3238d64
Compare
3238d64 to
0010801
Compare
0010801 to
5f5dfec
Compare
## Description Improves EC2 failure observability following #5312. Caught EC2 failures now retain the error message alongside bounded `failureCodes`, so unexpected failures remain diagnosable even when no identifier is accepted. The redundant inner CreateFleet warning was also removed; the outer handler now emits that warning once after converting the swallowed request failure into its result. ## Test Plan - Focused EC2 Vitest suite: 72 tests passed. - ESLint passed for the changed TypeScript file. - Source-only TypeScript check passed for `runners.ts`. - Pre-commit checks and `git diff --check` passed. The broader compute-provider TypeScript project check remains blocked by existing Vitest configuration/dependency-version errors unrelated to this change. ## Related Issues Depends on #5312.
## Description Adds the TypeScript implementation of the GitHub Actions runner scale-set control plane on top of the Terraform orchestration introduced by #5299. This PR includes: - A reusable GitHub Actions scale-set client that supports GitHub.com, GHES, and data-residency endpoints; GitHub App access tokens; runner-group and scale-set discovery/registration; JIT runner configuration; runner removal; and message-session polling, acknowledgement, job acquisition, refresh, and close. - A long-running scale-set controller service for ECS. It loads versioned runner configuration from SSM Parameter Store, runs independent reconcilers for each runner configuration, exposes liveness/readiness endpoints, and performs bounded shutdown and session recovery. - A scale-set compute-provider contract and EC2 implementation. The provider reconciles capacity from `totalAssignedJobs`, generates JIT configurations for launches, tracks provider-owned instances with tags, preserves busy or unknown runners during scale-down, and supports task-role or assumed-role credentials. - Configuration, authentication, transport, retry, cancellation, ownership, lifecycle, health, and reconciliation safeguards. Sensitive tokens, message bodies, and JIT configurations are excluded from manifests and logs; disabling TLS verification is scoped to the relevant client instead of changing global Node.js state. - Unit-test coverage for the scale-set client and HTTP/session behavior, service configuration and credentials, controller lifecycle and health, and EC2 provider configuration, inventory, reconciliation, scale-up, and scale-down. The Terraform documentation and workflow changes are tracked separately in #5347. ## Test Plan - Added focused TypeScript tests alongside the client, service, controller, and compute-provider implementations. - The scale-set service package provides `typecheck`, `build`, `format-check`, `lint`, and `test` targets for CI validation. - End-to-end ECS deployment is not part of this PR; the service consumes the scale-set configuration and IAM contracts supplied by the Terraform stack. ## Related Issues - Stacked on #5299. - Builds on the EC2 orchestration boundary from #5312. - Follow-up documentation and workflow changes: #5347. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Guilherme Caulada <[email protected]>
Description
Separates the result returned by shared EC2 runner creation from the control-plane
CreateRunnerResultcontract.createEc2Runner()andEc2RunnerResourceOperations.create()now returnEc2RunnerCreateResult, containing created instance IDs, the failed-instance count, and bounded AWS failure identifiers.The control-plane adapter converts that result into its existing
CreateRunnerResultand applies retryable or non-retryable classification usingscaleErrors. The core contract and existing pool and scale-up behavior remain unchanged.Test Plan
git diff --checkand pre-commit checks passed.Related Issues
Depends on #5301.