Skip to content

Commit c721b31

Browse files
committed
Interleave sandbox instructions
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent 5b253a4 commit c721b31

File tree

1 file changed

+39
-19
lines changed

1 file changed

+39
-19
lines changed

docs/mac/sandboxes.md

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,40 @@ Use sandboxes when you want fast isolation without changing your persistent envi
3030
+------------------------------------------------------------------+
3131
```
3232

33+
## Use cases
34+
35+
Sandboxes are designed for short-lived workloads and experimentation:
36+
37+
- **AI coding agents** - copy a repo in, let the agent work, copy results out, then delete if needed.
38+
- **CI and testing** - run builds and repeatable test suites in a clean environment.
39+
- **Untrusted code** - isolate risky runs from your main services.
40+
- **Comparison builds** - run multiple versions of tooling side-by-side without rebuilding your persistent VM.
41+
42+
You can launch sandboxes from the CLI, [Go SDK](/platform/go-sdk/), or [REST API](/reference/api).
43+
44+
3345
## Launch, use, and delete
3446

35-
Launch a sandbox:
47+
Launch an ephemeral sandbox that is deleted when you reboot it or stop Slicer for Mac:
3648

3749
```bash
3850
slicer vm launch sbox
3951
```
4052

53+
To launch a sandbox that's persistent and survives with a permanent disk:
54+
55+
```bash
56+
slicer vm launch sbox --persistent
57+
```
58+
59+
Launch a sandbox with memorable tags that you can query later on through the API or `slicer vm list`:
60+
61+
```bash
62+
slicer vm launch sbox \
63+
--tag owner=alex \
64+
--tag task=k3s
65+
```
66+
4167
Check what is running:
4268

4369
```bash
@@ -56,38 +82,32 @@ Open an interactive shell:
5682
slicer vm shell sbox-1
5783
```
5884

59-
Stop and remove the sandbox when you are done:
85+
Stop and remove an ephemeral sandbox:
6086

6187
```bash
88+
slicer vm shutdown sbox-1
89+
90+
# Or
6291
slicer vm delete sbox-1
6392
```
6493

65-
## Persistent sandboxes
66-
67-
By default, sandboxes are ephemeral - they are deleted when the daemon stops. To create a sandbox that retains its disk and survives restarts, use `--persistent`:
94+
Stop a persistent sandbox (and retain it):
6895

6996
```bash
70-
slicer vm launch sbox --persistent
97+
slicer vm shutdown sbox-1
7198
```
7299

73-
If the daemon restarts (e.g. after a reboot or sleep), persistent sandboxes are not automatically re-launched. To bring one back:
100+
Permanently delete a persistent sandbox:
74101

75102
```bash
76-
slicer relaunch sbox-1
103+
slicer vm delete sbox-1
77104
```
78105

79-
This boots the VM from its existing disk. Any data written to the filesystem is still there.
80-
81-
## Use cases
82-
83-
Sandboxes are designed for short-lived workloads and experimentation:
106+
Relaunch a persistent sandbox (after a `slicer vm shutdown` or running `sudo reboot` in the guest):
84107

85-
- **AI coding agents** - copy a repo in, let the agent work, copy results out, then delete if needed.
86-
- **CI and testing** - run builds and repeatable test suites in a clean environment.
87-
- **Untrusted code** - isolate risky runs from your main services.
88-
- **Comparison builds** - run multiple versions of tooling side-by-side without rebuilding your persistent VM.
89-
90-
You can launch sandboxes from the CLI, [Go SDK](/platform/go-sdk/), or [REST API](/reference/api).
108+
```bash
109+
slicer relaunch sbox-1
110+
```
91111

92112
## Customise sandbox resources
93113

0 commit comments

Comments
 (0)