@multiplayer-app/sandbox 3.0.0-wip-yjs-state-changes.0 → 5.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 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
@@ -114,12 +162,15 @@ Architecture-specific tags use `<version>-<arch>` so a separate publishing
114
162
  workflow can push them and optionally create a multi-architecture `<version>`
115
163
  manifest. The build script never uploads files or pushes images.
116
164
 
117
- Tags matching `sandbox-v*` run three release jobs: npm package publication and
118
- the two architecture-specific base-image publishers start after lint in
119
- parallel; once both architectures are available, a final job creates the
120
- multi-architecture Docker tags. The publisher expects the repository variable
121
- `SANDBOX_BASE_IMAGES_S3_BUCKET`, the existing `DOCKERHUB_ORGANIZATION` variable,
122
- and the existing `AWS_ROLE_ARN` and `DOCKERHUB_OIDC_ID` secrets.
165
+ Tags matching `sandbox-v*` run npm package publication alongside base-image
166
+ publishers for every combination of `test`, `staging`, `production`, and `demo`
167
+ with `x86_64` and `aarch64`; these jobs publish only QEMU, Firecracker, and
168
+ Lambda artifacts to each environment's S3 bucket. Each S3 publisher enters its
169
+ GitHub environment and expects `ARTIFACTS_S3_BUCKET` plus `AWS_ROLE_ARN` there.
170
+ Container images are published globally exactly once per architecture by a
171
+ separate job, followed by one global multi-architecture manifest job. Those jobs
172
+ use the repository-level `DOCKERHUB_ORGANIZATION` variable and
173
+ `DOCKERHUB_OIDC_ID` secret and do not enter a GitHub environment.
123
174
 
124
175
  The runner-specific paths intentionally duplicate shared artifacts. That keeps
125
176
  each S3 prefix self-contained and allows runner formats to evolve independently.
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 = "3.0.0-wip-yjs-state-changes.0";
31
+ var version = "5.0.0-sandbox-docker-image.0";
32
32
 
33
33
  // src/config.ts
34
34
  var import_os2 = __toESM(require("os"));