@multiplayer-app/sandbox 4.0.0-wip-yjs-state-changes.0 → 6.0.0-sandbox-docker-image.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -42,6 +42,54 @@ sandbox start --token <token> --worker-id worker-eu-01 \
|
|
|
42
42
|
--sandbox-url http://localhost:3011 --max-vms 5
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
## Run as a Docker container
|
|
46
|
+
|
|
47
|
+
Build the worker image from the repository:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
pnpm --filter @multiplayer-app/sandbox run docker:build
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The image starts `sandbox start` by default and needs no inbound port:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
docker run --rm \
|
|
57
|
+
-e WORKER_TOKEN=<token> \
|
|
58
|
+
-e WORKER_ID=worker-docker-01 \
|
|
59
|
+
multiplayer-sandbox-worker:local
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
To let the worker launch ordinary Docker executors, mount the host daemon:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
docker run --rm \
|
|
66
|
+
-e WORKER_TOKEN=<token> \
|
|
67
|
+
--network host \
|
|
68
|
+
-v /var/run/docker.sock:/var/run/docker.sock \
|
|
69
|
+
multiplayer-sandbox-worker:local
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Host networking is required for the Docker executor because it publishes guest
|
|
73
|
+
ports on the host daemon's loopback interface and the worker proxies to those
|
|
74
|
+
ports. The per-stack guest images must also already exist in that daemon.
|
|
75
|
+
|
|
76
|
+
For QEMU/KVM, also mount the downloaded base images and expose KVM:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
docker run --rm \
|
|
80
|
+
-e WORKER_TOKEN=<token> \
|
|
81
|
+
-e VM_IMAGES_DIR=/vm-images \
|
|
82
|
+
--device /dev/kvm \
|
|
83
|
+
-v "$HOME/.multiplayer/vm-images/$(uname -m):/vm-images:ro" \
|
|
84
|
+
multiplayer-sandbox-worker:local
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The container includes the Docker and QEMU CLIs. Docker Sandboxes still require
|
|
88
|
+
an `sbx` installation and daemon connection supplied by the operator;
|
|
89
|
+
Firecracker requires a compatible Linux host, `/dev/kvm`, and the Firecracker
|
|
90
|
+
binary. Cloud runners use the normal AWS environment variables or workload
|
|
91
|
+
credentials.
|
|
92
|
+
|
|
45
93
|
For the `qemu` engine, the host needs QEMU (`qemu-system-*`) installed; for
|
|
46
94
|
`firecracker`, a Linux host with `/dev/kvm`; for `docker`, just a running Docker
|
|
47
95
|
daemon (Docker Desktop/OrbStack) plus local images from
|
package/dist/cli.js
CHANGED
|
@@ -28,7 +28,7 @@ var import_config5 = require("dotenv/config");
|
|
|
28
28
|
var import_commander = require("commander");
|
|
29
29
|
|
|
30
30
|
// package.json
|
|
31
|
-
var version = "
|
|
31
|
+
var version = "6.0.0-sandbox-docker-image.0";
|
|
32
32
|
|
|
33
33
|
// src/config.ts
|
|
34
34
|
var import_os2 = __toESM(require("os"));
|