Skip to content

Containerise agent-server and apps#4

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

Containerise agent-server and apps#4
neuromaxer merged 9 commits into
mainfrom
containerise-stage-1

Conversation

@neuromaxer

@neuromaxer neuromaxer commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

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

See docs/plans/phase_9_plan.md for details

@neuromaxer neuromaxer changed the title Containerise Apps Containerise agent-server and apps Jun 12, 2026
appx now creates, supervises, and routes to the agent-server outer
container itself (container mode), so a fresh boot brings the whole stack
up with no manual `docker run`.

- internal/containerruntime: Supervisor interface + docker-CLI impl + fake
  CommandRunner. EnsureRunning (absent->create / stopped->start / running->
  noop, then poll GET / until healthy); Recreate is explicit-only; spec
  drift never auto-recreates. ContainerSpec.RunArgs transcribes the proven
  run-outer.sh flag set verbatim (no --privileged/--cap-add/--fuse/
  no-new-privileges; loopback-only publishes). BuildSpec, LoadOrCreateToken
  (0600), DetectBin, BridgeGateway.
- cmd/appx/main.go: APPX_AGENT_CONTAINER wiring; EnsureRunning before
  reconcile with per-class remediation; token mandatory + persisted 0600 +
  injected into container env and proxy clients; --recreate-agent-container;
  egress bound on the docker bridge gateway with HTTPS_PROXY/NODE_USE_ENV_
  PROXY/--add-host; container-mode NO_PROXY bypasses image registries;
  APPX_AGENT_ENV_PASSTHROUGH forwards extra secrets by name.
- internal/egress: configurable bind addr for the CONNECT proxy + internal
  listener; scoped DNS-wildcard allowlist matching; bedrock-runtime.*.
  amazonaws.com:443 in DefaultAllowlist.
- deploy: container-mode branches in system-setup.sh/tools-install.sh/
  bootstrap.sh (skip appx-agent user + agent-server.service, install seccomp
  to /etc/appx, build/pull pinned outer image, docker access); ship the
  seccomp profile under deploy/builder-container/.
- scripts/smoke-deploy.sh: deterministic NO-LLM cross-service gate exercising
  the appx proxy (38/38 green).
- docs/plans/phase_9_plan.md: Stage 3 results + deviations; staging renumbered
  (Stage 4 productionize, Stage 5 hardening).

Findings recorded: HTTPS_PROXY is honoured by podman (registry pulls needed a
NO_PROXY bypass); appRunning TCP-dial false-positives after outer restart via
docker-proxy; Bedrock Settings-UI key is an upstream Pi apiKey->bearerToken gap
(env-var workaround via passthrough + bedrock-runtime allowlist).
@neuromaxer neuromaxer merged commit 671cb9e into main Jun 13, 2026
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