Skip to content

Commit e97f39c

Browse files
committed
docs: update AGENTS.md with & && fix, backgrounded dockerd, label binding
1 parent 43825b0 commit e97f39c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# PROJECT KNOWLEDGE BASE
22

3-
**Generated:** 2026-05-01T14:46:59Z
4-
**Commit:** 66ad287
3+
**Generated:** 2026-05-03T10:30:00Z
4+
**Commit:** 43825b0
55
**Branch:** main
66

77
## OVERVIEW
@@ -79,9 +79,13 @@ Ephemeral self-hosted GitHub Actions runner on Modal. Each job gets a fresh Moda
7979
- **NEVER** skip HMAC signature verification — every webhook must be validated
8080
- **NEVER** read env vars outside `runner/config.py` — centralize all config there
8181
- `debug_endpoint` is protected by `requires_proxy_auth=True` — keep it that way
82+
- **NEVER** chain `& &&` in SANDBOX_CMD — `&` terminates the command, `&&` is then a syntax error (was a bug — fixed in 8b9857f)
83+
- **NEVER** use `sleep infinity` for sandbox keepalive — Modal treats it as an active command, preventing `idle_timeout` from triggering (resource leak)
84+
- **ALWAYS** add unique `job-${{ github.run_id }}` label to workflow `runs-on` for 1:1 runner binding (was a bug — fixed in 8b9857f)
8285

8386
## UNIQUE STYLES
8487
- **Docker-in-Sandbox**: `START_DOCKERD_SH` inline script sets up NAT/iptables-legacy for gVisor compat. Uses `experimental_options={"enable_docker": True}`.
88+
- **Backgrounded dockerd**: Dockerd wait + image load run in background (`&` in subshell). Runner starts immediately without waiting for Docker. Non-Docker jobs skip 60s startup. Docker jobs get dockerd when ready.
8589
- **Image layering**: 3-layer image build (system+Docker → Python deps → runner binary) for cache efficiency
8690
- **JIT config flow**: Webhook → HMAC verify → generate-jitconfig API → spawn sandbox with `GHA_JIT_CONFIG` env
8791
- **Webhook secret rotation**: Supports `WEBHOOK_SECRET_OLD` for zero-downtime rotation
@@ -102,7 +106,7 @@ make logs # modal app logs modal-github-runner
102106
- `app.py` is a thin import shim for backwards compat — real app lives in `runner/main.py`
103107
- Modal secret name is "github-full-secret" (not "github-secret")
104108
- Sandbox timeout is 3 hours (10800s) for long-running jobs
105-
- `SANDBOX_CMD` starts dockerd, waits up to 60s for Docker ready, loads pre-pulled node:22-alpine image, then runs `./run.sh --jitconfig`
109+
- `SANDBOX_CMD` starts dockerd in background, immediately runs `./run.sh --jitconfig`. Dockerd wait + image load are backgrounded — non-Docker jobs skip the 60s wait entirely. Sandbox terminates cleanly after runner exits.
106110
- Pre-pulled `node:22-alpine` image via crane in image build for faster Docker loads
107111
- `MODAL_IMAGE_BUILDER_VERSION=2025.06` set as env default for Docker-in-Sandbox support
108112
- Tests use `_delivery_counter` global for unique delivery IDs across test runs

0 commit comments

Comments
 (0)