Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
cov/c3 ▾

Modern-Apps.git / infra / agents / README.md

README.md1.9 KiBRenderedCodeRaw
1# Agents sandbox (compose project `agents`)
2
3- Runner: `agent-runner` (Tokio+axum, `infra/agents/runner/`) serves the
4 `proto` HTTP API from inside the sandbox: per-slot checkouts at
5 `/builds/slots/slot-N`, `bash -lc` exec in its own process group (Build
6 kind serialized on a single permit), path confinement, `git` ops.
7- Image: `Dockerfile.builder` builds the runner, then extends
8 `location-share-builder:local` with ripgrep, user `agent` (10001), and a
9 small-Gradle profile; ENTRYPOINT runs the runner under tini.
10- Isolation: `builder` runs as 10001, caps (6 CPU/14 GB/4k pids),
11 `cap_drop: ALL`, no-new-privileges, only on `agents-internal` (sealed)
12 and `agents-egress` (172.31.250.0/24, host-firewalled from RFC1918).
13- Orchestrator: `agentd` (separate image) talks to `http://builder:7070`,
14 serves the UI as `agents-ui` on prod net, pushes via the mirror volume.
15- Release back-pressure: `release-signal` mirrors prod's
16 `/srv/release_in_progress` into `/signal/release` for agentd to defer.
17
18Deploy (once, on the host as root, from /root/agent-world/Modern-Apps):
191. `git clone <Modern-Apps> /root/agent-world/Modern-Apps`
202. Review `infra/agents/host-setup.sh`, then `sudo bash infra/agents/host-setup.sh`
213. Copy `infra/agents/.env.example` to `/root/agent-world/.env`, fill secrets
224. Ensure base exists: `docker compose -f /root/location_share_server/compose.yml --profile release build builder`
235. `docker compose -p agents -f infra/agents/compose.yml up -d --build`
24
25Verify: `docker compose -p agents ps`; `docker exec agents-builder-1 curl -s localhost:7070/v1/health`;
26agentd UI via Caddy; run one `agent/` task end to end, then check
27`docker stats` (builder ≤ 6 CPU/14 GB) and `iptables -S DOCKER-USER`.
28
29Stop/remove (never touches `location-share`):
30`docker compose -p agents -f infra/agents/compose.yml down` (add `-v` to
31drop agents-* volumes too; the builds image + mirror stay until deleted).