Quickstarts

Quickstart: Sandboxes (coming soon)

Isolated environments for running untrusted code - placeholder for an upcoming product.

Sandboxes are not available yet. To run code in gVisor isolation today, use Workers one-off jobs.

Variables used below: $HOSTBASE_TOKEN (access token), $REF (project ref). SDKs: @hostbase/management (TypeScript) and hostbase_management (Python); full reference at /docs/api.

Today: a one-off job on a Worker

The same API shape is the starting point for Sandboxes.

curl -X POST https://host.ulewicz.space/api/v1/projects/$REF/workers/runner/jobs -H "Authorization: Bearer $HOSTBASE_TOKEN" -H "Content-Type: application/json" -d '{"command":"python","args":["-c","print(1+1)"],"timeout_s":30}'
await hb.runWorkerJob({ ref, name: "runner", body: { command: "python", args: ["-c", "print(1+1)"], timeout_s: 30 } as never });
hb.run_worker_job(ref=ref, name="runner", body={"command": "python", "args": ["-c", "print(1+1)"], "timeout_s": 30})

Next: /docs/quickstart/workers.