Skip to content

feat: make the stack images ready for Incus - #5424

Merged
yannickmonney merged 1 commit into
mainfrom
feat/incus-stack-images
Nov 12, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
feat/incus-stack-images

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Milestone M2 of the Incus runtime program, which ships on the stable line (see .agents/repo.md, Git). One lane, TI-07, built on M1 (#5423).

What it does

Every change is inert under Docker Compose: no ENTRYPOINT changes, and Compose sets none of the new variables.

  • /init: dumb-init 1.2.5 with patches/dumb-init/maxsig-64.patch (MAXSIG 64) in the six stack images, so a stop under Incus (SIGPWR, or SIGRTMIN+3 in a race) shuts the payload down cleanly.
  • dev.tale.infra-formats labels on the proxy and the egress.
  • Proxy: TALE_PROXY_ROLE=switch runs Caddyfile.switch: a static upstream list with active checks of the admission probes, no reload per flip.
  • Platform GET /api/admission, backend GET /admission (withdraw markers); /api/health unchanged.
  • db: /dev/shm tmpfs from TALE_SHM_SIZE when set; egress: setpriv bounding-set drop when it holds extra capabilities; platform SSRF fence accepts established/related first.

How it was tested

  • Unit and guard tests for each image and entrypoint (OCI metadata, compose parity, db entrypoint, egress firewall, SSRF fence, privilege drop, admission probes), typecheck and lint.
  • Docker: compose generated by the CLI with these images vs M1's: PID 1, stop exit codes and times unchanged; db shuts down and restarts with no recovery.
  • Incus 7.6 lab: db stop under /init clean (CLI, REST, under load); egress capability bound and DNS; marker withdraw/restart.
  • S20, the colour switch behind main's Caddy edge: 20 flips, 9,072,570 requests, 0 failures; streams end only when the old colour stops.

The full check on the lab VM has known environment reds that also fail on main (the compose-plugin cached site plans test, a session-manager timing test); CI is the gate.

What follows

M3 (managed Incus: TI-03, TI-06 and the rest), M4 (workspace).

The Incus runtime runs the stack's own images as OCI instances. Each
change here is inert under Docker Compose: no ENTRYPOINT changes, and
Compose sets none of the new variables.

- /init: one byte-identical stage in the six stack images (db, platform,
  proxy, sandbox, sandbox-egress, sandbox-llm-gateway) builds dumb-init
  1.2.5 from its sha256-pinned source on alpine:3.20 (the egress pin),
  with patches/dumb-init/maxsig-64.patch (MAXSIG 31 -> 64), statically,
  and copies it to /init, labelled dev.tale.init=dumb-init-1.2.5+maxsig64.
  liblxc halts PID 1 with SIGPWR, or SIGRTMIN+3 when PID 1 blocks it;
  only a real-time rewrite catches the second. patches/README.md says
  why, the proof and when it goes.
- dev.tale.infra-formats: switch-upstreams/1 on the proxy,
  names-hosts/1 on the egress (the stop-gated infrastructure tier).
- proxy: TALE_PROXY_ROLE=switch installs Caddyfile.switch: :3000 and
  :3005 balance over /switch/<role>.upstreams with active checks of the
  admission probes every 2 s, lb_try_duration 5s, flush_interval -1,
  trusted_proxies private_ranges, admin on localhost:2019 and :2020
  liveness; no reload, no stream_close_delay. It refuses to start
  without both upstream files; any other role is refused. edge stays
  the default.
- platform: GET /api/admission answers 503 withdrawn while
  /tmp/platform-withdrawn or the shutdown marker exists, 503 starting
  until /tmp/platform-ready, else 200, no-store with the serving
  identity. /api/health is unchanged: the edge checks it through the
  switch.
- backend: GET /admission answers 503 while /tmp/backend-withdrawn
  exists, else 200, with no database call.
- platform entrypoint: the four run markers are deleted as root before
  gosu for every role (a failed delete warns), and the SSRF fence
  accepts replies on established connections first, as the egress does.
- db: TALE_SHM_SIZE mounts a tmpfs on /dev/shm when set and root.
- egress: util-linux setpriv narrows the bounding set to the seven
  capabilities only when CapBnd holds a bit outside 0x14e3 and
  CAP_SETPCAP is effective; under Compose (cap_drop ALL plus the seven)
  it is skipped and says so.

Tests: oci-image-metadata holds the six stages byte-equal and pinned,
the patch to its one change, /init copied, the labels, and Docker's
ENTRYPOINT; compose-parity holds the switch role (rendered), the
Caddyfile.switch settings, TALE_PROXY_ROLE and TALE_SHM_SIZE unset in
both pipelines, and the egress mask equal to Compose's caps;
server.test.ts and app.admission.test.ts every admission answer;
privilege-drop and ssrf-firewall guards the markers and the reply
accept; db and egress entrypoint tests the shm mount and setpriv.
tools/cli/turbo.json and its guard hash the new outside files.
@yannickmonney
yannickmonney force-pushed the feat/incus-stack-images branch from c2b4b6b to 19a27f5 Compare November 12, 2026 19:36
@yannickmonney
yannickmonney merged commit 5adcf24 into main Nov 12, 2026
115 of 117 checks passed
@yannickmonney
yannickmonney deleted the feat/incus-stack-images branch November 12, 2026 20:12
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