Skip to content

Docker fleets: set-up once (prebuild, fast restarts), a model on the same computer, the stricter sandboxes as a choice; release 0.10.0 - #44

Merged
flujo-app merged 6 commits into
mainfrom
docker-local
Nov 23, 2026
Merged

flujo-app merged 6 commits into
mainfrom
docker-local

Conversation

@flujo-app

Copy link
Copy Markdown
Owner

Fixes #42. Fixes #43.

Three additions to the Docker fleet from 0.9.0 (#41), each asked for after the first real runs, and each checked with real containers.

1. The set-up runs once

Before, every container installed system packages, the worker program and the SDK itself, at every start: one and a half to seven and a half minutes each.

  • deploy(plan, { prebuild: true }) runs the set-up once, in an image built just in time, and starts every container from it. The image is named factory-worker:<program>-<hash>; the hash follows from the base image, the SDK bundle and the worker program, so a later fleet with the same three builds nothing. The build context goes to docker build as one tar stream.
  • A container that is started again skips the set-up. The start script records the finished set-up (bundle and program) in the container and checks that record first. A Fly Machine starts from its image every time, finds no record and sets itself up as before, so nothing changes on Fly.
  • cloudLiteImageSetup(bundleSha256, { workerProgram }) is the set-up as a script for an image build; fleet.infrastructure.buildImage(...) builds one without deploying.

Measured (Claude Code, 2 containers x 2 agents): image built once in 3 min 43 s; then all agents enrolled 4 s after the deploy and were back 5 s after a stop and start. In the 0.9.0 record a restart took 1 min 27 s (Codex).

2. A model on the same computer

validateModelProvider now accepts plain http for names of this computer only: localhost, 127.0.0.1, [::1] and host.docker.internal. Every other address still needs https.

  • A Docker fleet takes http://host.docker.internal:<port>/v1 and refuses localhost with the reason (inside a container that is the container itself).
  • A Fly fleet refuses all of them before anything is created: a Fly machine cannot reach the computer that deploys it.
  • Local lite workers (factory-lite ... --model-provider) may use localhost.

3. The stricter sandboxes, as an explicit choice

Found in a real run: with sandbox: 'workspace-write' every command of a Codex agent in a container failed with bwrap: No permissions to create new namespace. The worker program runs agent commands in an isolated area of its own, and a default container may not create one. In 0.9.0 such a plan was accepted and the agents could then run nothing.

  • A Docker fleet now refuses workspace-write and read-only and says why.
  • new FactoryDockerLiteFleet({ ..., nestedSandbox: true }) allows them: the fleet's containers then run without Docker's system-call filter (--security-opt seccomp=unconfined). The guide states the trade: agent commands are held more tightly, the container as a whole loses one of Docker's own protections. No extra privileges are added.
  • The setting travels in the machine settings, so a container replaced by updateRuntime keeps it.

Other changes

  • scripts/docker-fleet-smoke.mjs: --prebuild, --model-url / --model / --model-api, --reply (for a model too small to use tools), --teams (a real turn of every agent), --sandbox, --cpus, --memory.
  • PUBLIC_SDK.md: the three topics above, why diskGb has no effect on Docker, and the new runs. README.md: the Docker example uses prebuild: true.
  • Release 0.10.0 (package.json, package-lock.json, install lines).

Tests

Six new tests, 310 in the workflow's list (304 before):

  • test/cloud-lite-docker.test.mjs: the start script's order (bundle checked every time, record written only after every step, runtime started either way) and the image set-up script; prebuild (one build, reuse by a second fleet, a separate image per program, the same name on resume, refused settings, nothing built when Docker does not run); the stricter sandbox refused without nestedSandbox, allowed with it and kept across a runtime update; local model addresses on a Docker fleet.
  • test/model-provider.test.mjs: which addresses may be plain http, look-alikes refused, and what each worker program is given.
  • test/cloud-lite-provider.test.mjs: the Fly refusal, with nothing recorded.

Real Docker runs

Docker Desktop 29.6.1 for Windows 10 (8 CPUs and 19.5 GB for Docker), base image node:24.22.1-bookworm-slim. Record: evidence/docker-fleet-runs-20261123.json.

Run What it did Result
Claude Code, 2 x 2, subscription token, pre-built image a claim on the shared board by an agent in the second container, before and after a stop and start (2 real turns); runtime update; collection; removal 11 of 11 checks, 4 min 20 s including the image build
Ten teams of nine workers and a lead: 10 containers, 100 Claude Code agents, pre-built image every agent took one real turn: each worker recorded its own claim and messaged its lead, each lead read its inbox and found its 9 messages; 100 claims on the board 8 of 8 checks, 4 min 17 s including the image build; the 100 turns took 87 s
Codex, 2 x 2, model on the same computer (Ollama, Responses interface) an agent completed a turn with the model's answer pass
Claude Code, 2 x 2, model on the same computer (Messages interface) the same pass, 14 s with the image already built
FLUJO, 2 x 2, model on the same computer (chat interface) the same pass
Codex, workspace-write, nestedSandbox: true the agent's command wrote a file in its work folder and could not write one outside it (checked by looking at the files) pass
Claude Code, workspace-write, nestedSandbox: true the same pass

About the model on the same computer: it was Maykeye/TinyLLama-v0, 9 MB of weights that were already on the computer, served by Ollama 0.32.14. It writes story-like text and cannot use tools. These three runs show that a worker in a container reaches a model on this computer over plain http and completes a turn with its answer. They do not show useful work by a local model.

Not shown: useful work or board tool calls by a local model, Docker on a Linux host, the read-only sandbox, more than ten machines.

Earlier attempts, for the record: the first local-model run failed because the tiny model, as first packaged, refused the "thinking" setting Codex sends (fixed in the model's packaging, not in FACTORY). The first sandbox run is the one that exposed the bubblewrap failure. Two short runs were void because a batch I believed stopped was still running against the same folders; both were repeated alone.

Local CI before GitHub

The steps of .github/workflows/public-sdk.yml, run on commit 445c450 from a clean source snapshot (git archive) with a clean npm ci:

Platform Node npm Python Result
Windows 10 (Git Bash, Windows tar.exe ahead of Git's) 22.17.0 10.9.2 3.13.1 pass
Windows 10 (same) 24.22.1 11.19.1 3.13.1 pass
Linux, node:22.17.0-bookworm-slim container, non-root user 22.17.0 10.9.2 3.11.2 pass
Linux, node:24.22.1-bookworm-slim container, non-root user 24.22.1 11.19.1 3.11.2 pass

Each run:

  • npm ci
  • npm audit --omit=dev --audit-level=high: passes; it reports 2 moderate findings, the same as on main (no dependency changed).
  • node scripts/test-temp-guard.mjs <focused list from the workflow>: 31 files, 310 tests, 310 pass, nothing left in the temp location.
  • python -B -m unittest discover -s selfhost/modal -p "test_*.py": 11 tests pass.
  • npm pack, a fresh install of flujo-factory-0.10.0.tgz into an empty folder, scripts/verify-public-sdk.mjs, --help of factory-public, factory-lite and factory-evidence, factory-selfhost profiles, and the installed MCP stdio test: pass.
  • node scripts/test-temp-guard.mjs test/generic-swarm-evidence.test.mjs: 7 tests pass.

A first pass on the commit before this one failed at the package check on Linux: I had listed a constant among the exports it expects to be functions. The last commit fixes that, and the table is for the fixed commit.

The slim Linux images got python3 and git from Debian inside the container first, as the GitHub runner has both. The Linux container is Debian 12, not the runner's Ubuntu image. The Linux snapshot was made with core.autocrlf=false, so its files have the line endings a Linux checkout has.

…e image); a model server on this computer may be plain http
… a teams mode; docs for set-up once and local models
… new options and runs; release 0.10.0

A default container may not create the isolated area the worker program runs agent commands in, so workspace-write and read-only failed there. They are now refused unless the fleet was created with nestedSandbox: true, which runs its containers without Docker's system-call filter. Refs #42, #43.
Seven runs on Docker Desktop for Windows: Claude Code with real turns from a pre-built image, ten teams of nine workers and a lead with a real turn each, Codex, Claude Code and FLUJO answering through a model served on the same computer, and the workspace-write sandbox for Codex and Claude Code.
@flujo-app flujo-app added the enhancement New feature or request label Nov 23, 2026
@flujo-app
flujo-app merged commit 9d362fe into main Nov 23, 2026
2 checks passed
@flujo-app
flujo-app deleted the docker-local branch November 23, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

1 participant