Skip to content

Containerise agent-server and apps#6

Merged
neuromaxer merged 7 commits into
mainfrom
containerise-stage-1
Jun 13, 2026
Merged

Containerise agent-server and apps#6
neuromaxer merged 7 commits into
mainfrom
containerise-stage-1

Conversation

@neuromaxer

@neuromaxer neuromaxer commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Switch from systemd to containerised approach for hosting appx on a remote server

See docs/plans/builder-containers-plan.md for details

Promote the Stage 0 spike image from "keeps itself alive for docker exec" to
running agent-server, with the deploy-app skill + Vite app template baked in.
Packaging only — the deletion-tested Stage 0 security recipe is transcribed
verbatim (no --privileged, no SYS_ADMIN, no /dev/fuse, no no-new-privileges;
file-cap newuidmap, native overlay, tailored seccomp; outer process uid 1000).

- container/Dockerfile: add a Node 22 build stage (npm ci && build && prune
  --omit=dev) and copy the pruned runtime (dist/ + prod node_modules) into the
  unchanged ubuntu:24.04 rootless-podman stage. Install Node 22 in the final
  stage via NodeSource. Bake builder-agent/skills/deploy-app -> PI_SKILL_PATHS
  and builder-agent/templates/vite-spa -> APPX_TEMPLATE_DIR. Built from repo
  root; add a root .dockerignore.
- container/entrypoint.sh: keep the stale XDG_RUNTIME_DIR wipe + podman info
  warmup verbatim; exec `node dist/server.js` as PID 1 instead of sleep infinity.
- container/run-outer.sh: add -p 127.0.0.1:4001:4001 and the app range
  -p 127.0.0.1:10000-10199:10000-10199 (matches appx PublishedPortRangeEnd);
  pass -e ANTHROPIC_API_KEY / -e AGENT_SERVER_TOKEN by name (never baked).
  Security flags + volumes untouched. gen-seccomp.sh build context updated.
- scripts/container-smoke.sh (new): deterministic, no-LLM Stage 2 gate (31/31
  green on Ubuntu 26.04) — build/run/health, project create + seeding +
  deployment.json, build the seeded template once under nested podman, run
  DEV+PROD, host curl both, redeploy isolation, restart survival +
  `podman start --all`, plus docker-inspect security assertions.
- .github/workflows/container-smoke.yml (new): nightly + on-demand CI on a full
  ubuntu-latest VM.
- docs + SPIKE-FINDINGS: Stage 2 results, decisions (NodeSource, build-once),
  metrics (Node v22, ~1.03GB image, ~55s cold build, ~13s nested inner build),
  and the Stage 2->3 handoff (what's still missing for the live appx-managed flow).
…er stages

- Stage 3 (appx supervises the outer container) is done (smoke-green 38/38);
  detail lives in the sibling appx phase_9_plan.md.
- Record cross-cutting findings from Stage 3 bring-up/testing: Bedrock
  Settings-UI key is an upstream Pi apiKey->bearerToken gap (env-var
  workaround); non-default provider endpoints need egress allowlist entries
  (bedrock-runtime.* added); HTTPS_PROXY is honoured by podman (NO_PROXY
  registry bypass); appRunning TCP-dial false-positive after outer restart.
- Split staging: new Stage 4 (productionize: appx as a systemd service in
  container mode) and move hardening to Stage 5; add the upstream-Pi Bedrock
  fix to Stage 5.
@neuromaxer neuromaxer merged commit b9bf9cb into main Jun 13, 2026
1 check passed
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