Forking Sandboxes
Install dependencies once, then fork into independent sandboxes that run in parallel.
sandbox-fork
Demonstrates sb.fork(): install dependencies once into a base sandbox, then branch into two independent sandboxes that run different workloads in parallel — without repeating the install.
Setup
bunx alineo-cli init # starts OpenSandbox in Docker (one-time setup)Run
bun install
bun startWhat it does
- Creates a
python:3.11-slimsandbox and installsnumpy - Forks into two independent sandboxes (
track-a,track-b) from the post-install state - Runs a different numpy computation on each fork in parallel
- Lists the checkpoints recorded on the original sandbox
- Closes all three sandboxes
Both forks start with numpy already installed — neither pays the pip install cost again.