mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-12-04 00:56:43 +09:00
## Summary - Fix race condition where GHA runner systemd service auto-starts on VM boot and accepts CI jobs before Docker is available - Add defense-in-depth Docker readiness check in the emulator test workflow ## Changes - **`infrastructure/compute/startup_scripts/github_runner.sh`** — Stop the runner service at the very top of the startup script, before any package installations, preventing premature job acceptance - **`.github/workflows/ci.yml`** — Add a "Wait for Docker to be available" step with 60s retry loop in `backend-emulator-tests` job - **`docs/SELF-HOSTED-RUNNERS.md`** — Document Bug 8 in the Historical Bugs section ## Root Cause When runner VMs are stopped/started by the runner_manager, the GHA runner systemd service (from `svc.sh install` on a previous boot) auto-starts immediately on boot. The GCE startup script runs concurrently but only stops/re-registers the runner service after installing Docker and other dependencies. During this window, the runner can accept jobs that fail because Docker isn't ready yet. ## Testing - [x] Infrastructure-only change — no unit tests applicable - [x] Verified startup script logic is correct (subshell for cd, idempotent) - [x] CI workflow change adds graceful retry, not a breaking change ## Review - [x] Local CodeRabbit review completed (no findings) - [x] Documentation updated ## Note The startup script change will trigger Pulumi to detect a metadata change on runner VMs. Run `pulumi up` locally before merging per project convention. @coderabbitai ignore --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>