diff --git a/docs/deploy.md b/docs/deploy.md index 6b528245..8a543fa0 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -124,6 +124,7 @@ fragment the warm pools): | `medium` | 2 | 1G | | `large` | 4 | 4G | | `xlarge` | 4 | 8G | +| `2xlarge` | 8 | 16G | ### Dataset volumes diff --git a/docs/mcp.md b/docs/mcp.md index 05303b1e..2ac80f31 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -24,7 +24,7 @@ Build: `cd mcp && go build -o sandbox-mcp .` | tool | what it does | |---|---| -| `create_sandbox` | claim a microVM and return its id plus deadline; optional `template`, `net` (`none` default, or `egress`), `size` (`small` default, `medium`, `large`, `xlarge`) and `ttl_seconds` (0 means one hour); warm claims take milliseconds, nothing renews the deadline | +| `create_sandbox` | claim a microVM and return its id plus deadline; optional `template`, `net` (`none` default, or `egress`), `size` (`small` default, `medium`, `large`, `xlarge`, `2xlarge`) and `ttl_seconds` (0 means one hour); warm claims take milliseconds, nothing renews the deadline | | `exec` | run a shell command to completion (5-minute cap); returns stdout, stderr and the exit code; a hibernated sandbox wakes transparently | | `spawn` | start a command detached and return its pid; output goes to a 256 KiB ring buffer that `logs` replays | | `ps` | list tracked processes (exec, spawn, pty) with state, exit code and start time | diff --git a/docs/sdk-python.md b/docs/sdk-python.md index 35f42bda..a73bf0e7 100644 --- a/docs/sdk-python.md +++ b/docs/sdk-python.md @@ -95,7 +95,7 @@ sb = client.new("ghcr.io/cocoonstack/sandbox/rt:24.04", | parameter | values | default | meaning | |---|---|---|---| | `net` | `"none"`, `"egress"` | `"none"` | Cloud Hypervisor network shape: `none` disables the NIC and uses vsock-only I/O; `egress` attaches a bridge/CNI NIC | -| `size` | `"small"`, `"medium"`, `"large"`, `"xlarge"` | `"small"` | resource tier: 1cpu/512M, 2cpu/1G, 4cpu/4G, 4cpu/8G | +| `size` | `"small"`, `"medium"`, `"large"`, `"xlarge"`, `"2xlarge"` | `"small"` | resource tier: 1cpu/512M, 2cpu/1G, 4cpu/4G, 4cpu/8G, 8cpu/16G | | `volumes` | bare names or `{name, mount?, mode?}` mappings | `None` | attach and mount up to eight unique catalog dataset disks; an omitted mount defaults to `/volumes/`; `mode` is `"ro"` (default) or `"rw"` — `"rw"` requires the catalog entry's `writable: true`; accepted by `Client.new` and `Template.new` | | `mount` | bool | `True` | mount every requested volume. `False` attaches the devices and leaves the mounting to the workload; a mapping carrying `mount` is then a `TypeError` | | `ttl_seconds` | int | server default 5m | sandbox TTL, server-capped at 24h. The node reaps the sandbox after the TTL even if the client vanishes | diff --git a/mcp/tools.go b/mcp/tools.go index b2fb71cb..9bc168fd 100644 --- a/mcp/tools.go +++ b/mcp/tools.go @@ -14,7 +14,7 @@ import ( var tools = []tool{ { "create_sandbox", "Claim a fresh microVM sandbox and return its id plus deadline. Warm claims take milliseconds; a cold template boots in well under a second. Every sandbox-scoped tool takes the returned sandbox_id. The sandbox is destroyed at its deadline unless released earlier; nothing renews it.", - schema(props{"template": str("template image ref, or a name published by promote; empty uses the server default"), "net": str("network lane: none (default, no NIC, vsock-only I/O) or egress (bridge NIC, outbound network)"), "size": str("resource tier: small (default), medium, large, xlarge"), "ttl_seconds": integer("sandbox lifetime in seconds; 0 means one hour, and nothing renews it")}), toolCreateSandbox, + schema(props{"template": str("template image ref, or a name published by promote; empty uses the server default"), "net": str("network lane: none (default, no NIC, vsock-only I/O) or egress (bridge NIC, outbound network)"), "size": str("resource tier: small (default), medium, large, xlarge, 2xlarge"), "ttl_seconds": integer("sandbox lifetime in seconds; 0 means one hour, and nothing renews it")}), toolCreateSandbox, }, { "exec", "Run a shell command in a sandbox, wait for it to exit, and return stdout, stderr, and the exit code as JSON. The call is cut off after 5 minutes; for servers or long jobs use spawn instead. A hibernated sandbox wakes transparently on this call.", diff --git a/sandboxd/types/types.go b/sandboxd/types/types.go index 7128721c..9438f6b5 100644 --- a/sandboxd/types/types.go +++ b/sandboxd/types/types.go @@ -20,10 +20,11 @@ const ( NetNone NetShape = "none" NetEgress NetShape = "egress" - SizeSmall Size = "small" - SizeMedium Size = "medium" - SizeLarge Size = "large" - SizeXLarge Size = "xlarge" + SizeSmall Size = "small" + SizeMedium Size = "medium" + SizeLarge Size = "large" + SizeXLarge Size = "xlarge" + Size2XLarge Size = "2xlarge" RestoreCopy RestoreMode = "copy" RestoreOnDemand RestoreMode = "ondemand" @@ -47,10 +48,11 @@ var ( VolumeNameRe = regexp.MustCompile(`^[a-z][a-z0-9_-]{0,19}$`) sizeSpecs = map[Size]SizeSpec{ - SizeSmall: {CPU: 1, Memory: "512M", MemoryBytes: 512 << 20}, - SizeMedium: {CPU: 2, Memory: "1G", MemoryBytes: 1 << 30}, - SizeLarge: {CPU: 4, Memory: "4G", MemoryBytes: 4 << 30}, - SizeXLarge: {CPU: 4, Memory: "8G", MemoryBytes: 8 << 30}, + SizeSmall: {CPU: 1, Memory: "512M", MemoryBytes: 512 << 20}, + SizeMedium: {CPU: 2, Memory: "1G", MemoryBytes: 1 << 30}, + SizeLarge: {CPU: 4, Memory: "4G", MemoryBytes: 4 << 30}, + SizeXLarge: {CPU: 4, Memory: "8G", MemoryBytes: 8 << 30}, + Size2XLarge: {CPU: 8, Memory: "16G", MemoryBytes: 16 << 30}, } guestOSMountRoots = []string{ diff --git a/sdk/go/options.go b/sdk/go/options.go index a24f65bc..d15b47e2 100644 --- a/sdk/go/options.go +++ b/sdk/go/options.go @@ -11,10 +11,11 @@ const ( // NetEgress attaches the node's bridge or CNI network. NetEgress NetShape = "egress" - Small Size = "small" - Medium Size = "medium" - Large Size = "large" - XLarge Size = "xlarge" + Small Size = "small" + Medium Size = "medium" + Large Size = "large" + XLarge Size = "xlarge" + XXLarge Size = "2xlarge" volumeModeRO = "ro" volumeModeRW = "rw"