Repository navigation
Lite fleets run on local Docker; a restarted fleet can be stopped and collected again; release 0.9.0 - #41
Merged
Conversation
stop() kept one journal entry per machine. After stop, start and a second stop, that entry was already marked done, so the second stop sent nothing while the journal said "stopped" and the machines kept running. A stop now has one entry per machine and start. start() also sets the status back to provisioned, unless the fleet is sealed.
FactoryDockerLiteFleet runs the lite fleet in local containers instead of Fly machines: one container and one volume per machine, one private network, the same shared board on the first machine. It answers the provider commands the fleet already sends, so plans, worker programs, logins and all fleet actions are unchanged. Secrets travel as root-only files, never on a command line or in docker inspect. Refs #40.
After a machine restart the board still shows the last turn of a resumed session, but the new runtime had forgotten it. A stop command names the turn the board shows, so it was refused, and quiesce and collect timed out. The runtime now restores that turn when it resumes a session; a turn the board still shows running while the session is idle is closed as interrupted.
…as proof of a start
Three runs from a clean snapshot of beaaf5e on Docker Desktop for Windows: a full Codex fleet with two real model turns, and Claude Code and FLUJO workers enrolling on the board.
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.
Fixes #40.
What changes
A lite fleet can now run on local Docker instead of Fly, with the same plan and the same shared board:
/data, one private network per fleet. The first container holds the board, as on Fly.FactoryCloudLiteFleetalready takes its provider as aninfrastructureobject (the tests use that to stand in for Fly). The newsrc/cloud-lite/docker.mjsis such a provider: it answers the eleven provider commands a fleet sends (apps create,volumes create,machine list,machine exec, ...) with Docker. Deploy, observe, operator messages, stop, start, runtime update, quiesce, collect and retire are the existing code.<machine id>.vm.<app>.internal, the name workers already use on Fly.docker cp) and become environment variables of the worker runtime only. They are not indocker inspect.image, workers start fromnode:24-bookworm-slim. WithoutbundlePath, the installed SDK is packed once into the fleet directory and reused on resume.network, Fly image sources. Nothing is recorded in that case.retire()removes only what carries the fleet's label.Limits, stated in
PUBLIC_SDK.md:region,cpuKindanddiskGbhave no effect on Docker;cpusandmemoryMbbecome container limits; amodelProviderstill needshttpsURLs; every container start installs the worker program again (two to four minutes).Two faults found while testing on real Docker, fixed for Fly as well
stop()kept one journal entry per machine. After stop, start and a second stop, that entry was already done, so the second stop sent nothing while the journal said "stopped" and the machines kept running. A stop now has one entry per machine and start, andstart()sets the status back toprovisioned(not for a sealed fleet).quiesce()andcollect()timed out. The board still showed that turn, the restarted runtime had forgotten it, and a stop names the turn the board shows. The runtime now restores it when it resumes a session; a turn the board still shows running while the session is idle is closed as interrupted.Both have a test that fails without the fix.
Other changes
README.md: a short Docker example under "Go big"; the install line now points at 0.9.0.PUBLIC_SDK.md: new section "Lite fleets on local Docker".scripts/docker-fleet-smoke.mjs(alsonpm run smoke:docker-fleet): the real check, shipped in the package so anyone can run it on their own Docker.test/cloud-lite-docker.test.mjsandtest/cloud-lite-connection.test.mjs.package.json,package-lock.json).Tests
test/cloud-lite-docker.test.mjs, 11 tests against a Docker kept in memory: what a plan turns into; secrets never on a command line or in container settings; the packed bundle and its reuse; the host connection to a real board server; stop and start; runtime update with rollback; collection; retire and its refusal of an unknown container; early refusals; no adoption of existing volumes or networks; and a check that every provider command infleet.mjshas a Docker equivalent, so a new one cannot be forgotten.test/cloud-lite-connection.test.mjsandtest/cloud-lite.test.mjs: one new test each for the two fixes.Real Docker runs
Run with
scripts/docker-fleet-smoke.mjsfrom a clean snapshot ofbeaaf5e(the code of this PR before the record itself was added) on Docker Desktop 29.6.1 for Windows 10, imagenode:24.22.1-bookworm-slim. Record:evidence/docker-fleet-acceptance-20261123.json.Time from start to all agents enrolled: Codex 3 min 24 s on first start and 1 min 27 s after a restart, Claude Code 4 min 18 s, FLUJO 7 min 31 s (its first start installs FLUJO onto the volume).
Not shown by these runs:
workspace-writeandread-onlysandboxes inside containers. The runs used the default.Earlier attempts, for the record: the first real run failed in the check script itself (it compared session IDs too early after a restart). The second failed at the collect step and exposed fault 2 above. Fault 1 was found while writing the check, whose second
stop()did nothing.Local CI before GitHub
The steps of
.github/workflows/public-sdk.yml, run on commitb062c12from a clean source snapshot (git archive) with a cleannpm ci:tar.exeahead of Git's)node:22.17.0-bookworm-slimcontainer, non-root usernode:24.22.1-bookworm-slimcontainer, non-root userEach run:
npm cinpm audit --omit=dev --audit-level=high: passes; it reports 2 moderate findings, the same as onmain(no dependency changed).node scripts/test-temp-guard.mjs <focused list from the workflow>: 304 tests, 304 pass, nothing left in the temp location. (287 onmain; 11 new Docker tests, the 4 existing connection tests now in the list, and 2 new tests for the fixes.)python -B -m unittest discover -s selfhost/modal -p "test_*.py": 11 tests pass.npm pack, a fresh install offlujo-factory-0.9.0.tgzinto an empty folder,scripts/verify-public-sdk.mjs(now also checks the two Docker exports),--helpoffactory-public,factory-liteandfactory-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.The slim Linux images got
python3andgitfrom 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 withcore.autocrlf=false, so its files have the line endings a Linux checkout has.