@machinen/runtime 0.3.4 → 0.4.1
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/API.md +26954 -2722
- package/README.md +12 -13
- package/dist/index.d.ts +5541 -110
- package/dist/index.js +27559 -4922
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -8,8 +8,9 @@ drive microVMs from your own Node.js code instead of through the CLI.
|
|
|
8
8
|
- **Run a Linux workload in a VM** with first-class control: stream
|
|
9
9
|
stdout/stderr, exec commands inside, write files in, await exit.
|
|
10
10
|
- **Snapshot a running process to disk and resume it later** —
|
|
11
|
-
possibly on a different machine
|
|
12
|
-
|
|
11
|
+
possibly on a different machine with the same guest architecture.
|
|
12
|
+
Memory and VM device state come back; host-local pieces such as port
|
|
13
|
+
forwards are declared again on restore.
|
|
13
14
|
- **Clone a running VM into a sibling.** Both copies run independently
|
|
14
15
|
from the same instant, diverging from a shared heap. Useful for
|
|
15
16
|
branching warmed-up state into N parallel runs.
|
|
@@ -28,19 +29,17 @@ If you want a CLI rather than a library, see
|
|
|
28
29
|
npm i @machinen/runtime
|
|
29
30
|
```
|
|
30
31
|
|
|
31
|
-
You also need a VMM
|
|
32
|
-
(`@machinen/
|
|
33
|
-
`@machinen/
|
|
34
|
-
automatically as an optional dependency. If you'd rather install it
|
|
35
|
-
explicitly:
|
|
32
|
+
You also need a native package with the VMM and host tools. The matching one
|
|
33
|
+
for your host (`@machinen/native-arm64-darwin`,
|
|
34
|
+
`@machinen/native-arm64-linux`, or `@machinen/native-x64-linux`) is pulled in
|
|
35
|
+
automatically as an optional dependency. If you'd rather install it explicitly:
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
npm i @machinen/
|
|
38
|
+
npm i @machinen/native-arm64-darwin # or native-arm64-linux / native-x64-linux
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
First boot fetches the kernel + base rootfs from
|
|
42
|
-
release
|
|
43
|
-
CLI](https://cli.github.com/) (`gh auth login`).
|
|
41
|
+
First boot fetches the matching kernel + base rootfs from the public
|
|
42
|
+
companion GitHub release over HTTPS; no `gh auth login` is needed.
|
|
44
43
|
|
|
45
44
|
## A taste
|
|
46
45
|
|
|
@@ -48,7 +47,7 @@ CLI](https://cli.github.com/) (`gh auth login`).
|
|
|
48
47
|
import { boot } from "@machinen/runtime";
|
|
49
48
|
|
|
50
49
|
const vm = await boot({
|
|
51
|
-
image: "./rootfs-debian-arm64.tar.gz",
|
|
50
|
+
image: "./rootfs-debian-arm64.tar.gz", // or rootfs-debian-amd64.tar.gz on amd64 Linux
|
|
52
51
|
cmd: ["/bin/sh"],
|
|
53
52
|
});
|
|
54
53
|
|
|
@@ -100,7 +99,7 @@ namespace patterns.
|
|
|
100
99
|
| `machinen:boot` | `boot()` lifecycle — VMM spawn, vsock bridge, registry |
|
|
101
100
|
| `machinen:provision` | `provision()` steps — install hook, tar-to-disk, repack |
|
|
102
101
|
| `machinen:exec` | vsock exec — connect retries, frames, exit codes |
|
|
103
|
-
| `machinen:snapshot` |
|
|
102
|
+
| `machinen:snapshot` | snapshot trigger, vmstate/CRIU wait, console-log inspection |
|
|
104
103
|
| `machinen:attach` | attach lookup, VM resolution |
|
|
105
104
|
| `machinen:registry` | `~/.machinen/vms/` reads, writes, stale-entry pruning |
|
|
106
105
|
| `machinen:gvproxy` | sidecar spawn, port-forward setup |
|