Repository navigation
Done
Labels
Description
Split out of #3807 / PR #3816 so the runtime-packages work can merge without it.
Goal
On the Fly Machines runtime, bake the instance's runtime packages into a derived agent image once per (base image digest, package list), instead of installing them at every Machine start (#3816's behaviour). Every Machine then launches from the derived digest.
Starting point
The implementation from PR #3816 is kept on branch 3807-derived-fly-image-reference (cfbdeca). Main files:
packages/core/src/agents/runtime/fly/derivedImage.tsfly/registry.tsfly/wrapperBuild.tstest/flyDerivedImage.test.ts
It uses a build Machine in the agent app to install, capture a layer, verify it against dpkg -L, and push to registry.fly.io, with in-process caching and capacity accounting.
Known requirements (from live runs and reviews on #3816)
- R0 (live failure, fixed on the branch): the layer capture skipped files on an overlay root (device-number filter), so an 881-byte layer shipped and the agent got
figlet: command not found. Keep the publish-time check: everydpkg -Lfile is present, and the layer is at least the installed size. - Capacity (F5, F13, R1):
- a build Machine counts against
PROPR_FLY_MACHINES_MAXand the org limit for as long as it may exist; - a lost create response or an unconfirmed delete keeps the slot until reconciled;
- leftovers are found by name prefix at startup;
- a run never has a build Machine and its agent Machine at once on the Free Plan.
- a build Machine counts against
- Cache identity (F6, R3): a mutable base tag is re-resolved per run, and a derived digest whose tag or manifest disappeared is dropped and rebuilt.
- Failures (R2): a failed apt build is cached per (base digest, list) with a backoff. Prevalidation against the Debian index runs only when a new build is needed (F12).
- Fallback (F9): a failed build falls back to install-at-start from the original image, never a partially built one.
- Deletes (R6): build Machine removal has its own retry window, independent of the build deadline.
- Compute usage (R7): build wait and install are reported as their own fields, and wall time is measured from dispatch.
Acceptance
- Live (
fly-e2e.yml,agent_runtime=fly-machines):- the first run builds a derived image and the agent finds the package;
- a second run with the same list reuses the digest, with no build Machine;
- changing the list builds a new digest;
- teardown leaves no Machines.
- Unit tests for each requirement above.
- Docs: the per-runtime package table in
agent-runtime.mdand the Fly tutorial.
Activity
chore: drop derived Fly image; install packages at Machine start
chore: hold Fly capacity slot while a recovery Machine may exist
propr-dev commentedon Nov 26, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-53821/claude-opus-5-5-fly-machines-bake-runtime-20261126-2328-m2d3758-epic-runtime-abstraction-sc0issue-3821-20261126-2328-claude-opus-5-5-m2d🔍 Track Task Execution
integry commentedon Dec 1, 2026
Done in #3825, which merged into the runtime epic; the epic merged into
mainwith #3774 and ships in 0.9.4.