Skip to content

Add Fly.io Sprites as a sandbox provider - #481

Draft
indrazm wants to merge 4 commits into
mainfrom
aven/3ea9bc16
Draft

indrazm wants to merge 4 commits into
mainfrom
aven/3ea9bc16

Conversation

@indrazm

@indrazm indrazm commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds Fly.io Sprites (fly.io/sprites) as a fourth Aven Cloud sandbox provider, next to boat, spaces and lizard: sandbox/src/sprites/, the protocol provider names, template runtime id 00000000-0000-4000-8000-000000000005, control-plane settings and spend rates, the Settings > Sandbox form, .env.example, and decision 0399.

Why

Sprites are persistent Linux VMs built for agents: a computer appears in about a second, keeps a 100 GB disk across idle pauses, answers on its own HTTPS URL and sleeps when nothing is happening. Their API is smaller than the other providers', and that shape decided the provider:

  • Waking is a command. GET /v1/sprites/{name} both wakes a sleeping Sprite and says whether it still exists; PUT …/fs/write drops runner-boot.env; POST …/exec runs the boot script that installs aven under /home/sprite/.local/bin and starts aven runner run. A row whose Sprite is gone recreates the same name instead of leaking a new one.
  • A task hold keeps it awake. Sprites have no pause call, and a pause drops open TCP connections, which would cut the runner's socket. The boot script registers a task hold on /.sprite/api.sock for an hour, extend renews it (clamped to that hour), and stop ends the runner and deletes the hold. With no hold the Sprite pauses itself, which is what frees it — so stopMode stays native_resume and supportsMaxLifetime is true.
  • No saved environment. A checkpoint is restored into the same Sprite and cannot be started as a new one, so saveEnvironment answers failed with that reason, readEnvironment null and removeEnvironment true (nothing remote to delete).
  • One size. 8 vCPU, managed RAM and 100 GB, so the boat machine type is ignored and the spend brake prices a flat 483,000 µ$/hour (8 vCPU at $0.0385 and 8 GB at $0.021875) plus hot storage at $0.50/GB-month.

Checks

  • bun run typecheck clean, bun run lint clean, bun fmt --check clean.
  • bun test apps packages sandbox tooling → 3410 pass, 2 skip, 0 fail, including new sprites client/config/provider tests (create → boot → exec order, hold renewal, stop, 404 handling, and the three exec response shapes), and a control-plane test that saving Sprites stores its machine's rates and offers the template.
  • bunx playwright test e2e/cloud-settings.spec.ts → 3 passed: Settings > Sandbox offers Sprites and saves it as the platform (provider: "sprites"), with the platform API answered by the test so the run's shared settings stay untouched.

Not verified

Nothing ran against api.sprites.dev — no token was available, so the client is written from the published OpenAPI and tested against a mocked fetch only. The first real install tests the boot script inside a Sprite (the sprite user's sudo, curl --unix-socket /.sprite/api.sock for the hold) and the POST …/exec response, which the spec documents as a bare 200: the parser accepts {stdout, stderr, exitCode}, NDJSON progress events, or plain text, but that is an inference.

sandbox/src/sprites/ is a provider like the others: a client of the
Sprites API, a boot script that installs the runner and starts it, a wake
flow that creates the Sprite when Sprites has lost it, and a stop that
ends the runner and releases the task hold keeping the Sprite awake.
Sprites have no pause call, so the hold is what keeps a computer running
while Aven uses it, and it sleeping on its own is what frees it.

Signed-off-by: Indra Zulfi Mushoddaq <114550938+indrazm@users.noreply.github.com>
The platform accepts sprites as the sandbox platform, prices a flat 8 vCPU
and 8 GB machine for the spend brake, and names its API address and token
in the form. An e2e spec saves it as the platform and reads it back.

Signed-off-by: Indra Zulfi Mushoddaq <114550938+indrazm@users.noreply.github.com>
Records why the provider looks the way it does: the task hold instead of a
pause call, no saved environments because a checkpoint cannot become a new
Sprite, and one fixed machine size in the spend brake.

Signed-off-by: Indra Zulfi Mushoddaq <114550938+indrazm@users.noreply.github.com>
Saving Sprites as the real platform left every later spec in the run with
an Aven Cloud computer it could not boot, so they never started a run.
The Settings form is now checked with the platform API answered by the
test, as the rest of that page is, and the control plane's own test saves
Sprites and reads back the rates it stores.

Signed-off-by: Indra Zulfi Mushoddaq <114550938+indrazm@users.noreply.github.com>
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