Many identical boxes
Start many warm clones of one snapshot for RL rollouts, agent swarms or sharded tests, collect the results, remove them.
Some work wants the same machine many times over: a reinforcement-learning rollout that must start from the exact same state every time, a problem split across ten agents, a test suite cut into shards. Set the machine up once, snapshot it while it runs, and start as many clones as you need. Each one is the snapshot brought back to life in about 0.3 s, with every process already running, under its own name and IP.
Set up once
kvbox new env --size s
kvbox exec env -- './setup.sh && setsid -f ./server > server.log 2>&1 < /dev/null'
kvbox snapshots new env env-readySnapshot a running box: memory and processes are in the snapshot, so a server you started, a model you loaded or a cache you warmed is there in every clone, with nothing to start again (Snapshots).
Fan out
for i in $(seq 1 8); do kvbox new --from env-ready run$i --json & done; wait
for i in $(seq 1 8); do kvbox exec run$i --timeout 600 --json -- "./rollout --seed $i" > result-$i.json & done; wait
for i in $(seq 1 8); do kvbox rm run$i -y; doneEach exec exits with its command's status and, with --json, prints {"output": "...", "exit_code": N}, so a script can tell which runs failed. The clones cannot reach each other; to let a coordinator box call workers, link them.
Things to know
- Clones are made on the host that holds the snapshot, so they share its RAM. A clone that would not fit is refused;
kvbox vm topshows how the running ones are doing. - Every clone starts from the same instant, clock included: give each its own seed or task through
exec. - To copy a single running box without keeping a snapshot,
kvbox vm fork <box>does both steps in one.