Skip to content

ci(deploy): dump the instance console when the health gate fails [skip release] - #231

Merged
johncarmack1984 merged 1 commit into
mainfrom
ci/console-dump-on-failed-health-gate
Sep 15, 2026
Merged

johncarmack1984 merged 1 commit into
mainfrom
ci/console-dump-on-failed-health-gate

Conversation

@johncarmack1984

Copy link
Copy Markdown
Member

Follow-up to #230. When deploy-server's /health poll fails, the instance was replaced but never served, and the only place that shows is the instance console: user-data runs under cloud-init, and nothing reaches the /vegify/server log group until the server is up. Today's three failed deploys (v1.0.50–v1.0.52) had their cause, dnf OOM-killed on a new AL2023 AMI, visible only in aws ec2 get-console-output, which nothing in the run could show.

Changes

  • deploy.yml: a failure-only step after the health poll prints the last 200 console lines of the VegifyServer instance (id from cdk-out.json). Assign-then-print, so a CLI failure is reported rather than hidden by a pipe. Skips cleanly when the deploy step itself failed and there is no cdk-out.json.
  • ci-stack.ts: the GitHub deploy role gains ec2:GetConsoleOutput, read-only, scoped to arn:aws:ec2:us-east-1:<account>:instance/*. deploy-ci.yml path-triggers on this file, so the merge deploys VegifyCi itself.

[skip release]: neither file is a server- or web-relevant path, so the deploy run this merge triggers deploys nothing and cuts no version.

Verification

  • pnpm --filter @vegify/infra build clean; cdk --app 'tsx bin/ci.ts' synth VegifyCi renders the new statement as ReadInstanceConsoleOnFailedHealthGate.
  • Workflow YAML parses; the new step is the last one in deploy-server with if: failure().
  • just check green.

…p release]

When deploy-server's /health poll fails the box was replaced but never served, and
the only place that failure shows is the instance console: user-data runs under
cloud-init and nothing reaches the /vegify/server log group until the server is up.
On 2026-09-15 three deploys died at that poll and the cause (dnf OOM-killed on a new
AL2023 AMI) was visible only there.

- deploy.yml: a failure-only step after the poll prints the last 200 console lines
  of the VegifyServer instance from cdk-out.json (assign-then-print so a CLI failure
  is reported, not hidden).
- ci-stack.ts: the GitHub deploy role gets ec2:GetConsoleOutput, read-only, scoped
  to instances in the deploy region. deploy-ci.yml ships it on merge.
@johncarmack1984
johncarmack1984 merged commit 375e772 into main Sep 15, 2026
9 checks passed
@johncarmack1984
johncarmack1984 deleted the ci/console-dump-on-failed-health-gate branch September 15, 2026 23:52
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.

1 participant