Sandboxes
A sandbox is an isolated Linux machine for one task. It is a gVisor container on a host in the region you choose,
with its own network namespace and limits on CPU, memory, processes and disk. Its root filesystem is read-only;
/work is its writable volume and home directory. See Images. Its id starts with
sbx_, for example sbx_4f9k2m8q1z7x3c5v.
What you choose at creation
Section titled “What you choose at creation”| Field | Default | Meaning |
|---|---|---|
image | base | The filesystem it starts from. See Images. |
size | small | vCPU, memory and disk. See Sizes. |
region | us-east | Where it runs. Always pass it: the default may have no host. See Regions. |
idle_timeout_s | 600 | Seconds without activity before it is destroyed. See Timeouts. |
hard_timeout_s | 3600 | Seconds after creation when it is destroyed regardless. |
egress_policy_id | none | Which outbound connections are allowed, on top of the built-in deny-list. |
env | none | Environment variables for commands and SSH sessions in the sandbox. The control plane does not store them. |
metadata | none | Up to 20 string key and value pairs of your own, returned with the sandbox. |
snapshot_id | none | Start from a snapshot instead of the image. |
curl https://api.wardcase.com/v1/sandboxes \-H "Authorization: Bearer $VIVARIUM_API_KEY" \-H "Content-Type: application/json" \-d '{"image":"python","size":"small","region":"eu-west","idle_timeout_s":600}'The response is the sandbox with status creating. It moves to running when its host reports it ready.
What you get back
Section titled “What you get back”Besides the fields above, a sandbox carries its status, created_at, ready_at, last_activity_at, expires_at
(when the hard timeout will destroy it), and ssh_command, for example
ssh sbx_4f9k2m8q1z7x3c5v@ssh.wardcase.com. When it ends, ended_at and end_reason say when and why: api, idle_timeout,
hard_timeout, abuse, host_lost or failed.
How it ends
Section titled “How it ends”- You destroy it with
DELETE /v1/sandboxes/{id}, orkill()in the SDKs. The API answers202and the status moves tostopping, thenstopped. - Its idle timeout or hard timeout passes.
- Abuse detection kills it.
- Its host is lost.
Everything in the sandbox’s filesystem is deleted when it ends. Take a snapshot first if you need it later. Usage stops being metered at the same time.
See Statuses for every state a sandbox can be in.
Where to reach it
Section titled “Where to reach it”- API:
https://api.wardcase.com/v1/sandboxes/{id} - SSH:
ssh.wardcase.com, username is the sandbox id - Exposed ports:
https://8000-4f9k2m8q1z7x3c5v.wardcase.comfor port 8000 ofsbx_4f9k2m8q1z7x3c5v