Containerise agent-server and apps#6
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switch from systemd to containerised approach for hosting appx on a remote server
See
docs/plans/builder-containers-plan.mdfor details