microsandbox-rb 0.5.7
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +94 -0
- data/Cargo.lock +7455 -0
- data/Cargo.toml +16 -0
- data/DESIGN.md +159 -0
- data/LICENSE +201 -0
- data/README.md +328 -0
- data/ext/microsandbox/Cargo.toml +45 -0
- data/ext/microsandbox/extconf.rb +14 -0
- data/ext/microsandbox/src/conv.rs +74 -0
- data/ext/microsandbox/src/error.rs +72 -0
- data/ext/microsandbox/src/exec.rs +158 -0
- data/ext/microsandbox/src/image.rs +114 -0
- data/ext/microsandbox/src/lib.rs +84 -0
- data/ext/microsandbox/src/runtime.rs +92 -0
- data/ext/microsandbox/src/sandbox.rs +812 -0
- data/ext/microsandbox/src/snapshot.rs +158 -0
- data/ext/microsandbox/src/stream.rs +86 -0
- data/ext/microsandbox/src/volume.rs +97 -0
- data/lib/microsandbox/errors.rb +68 -0
- data/lib/microsandbox/exec_handle.rb +154 -0
- data/lib/microsandbox/exec_output.rb +55 -0
- data/lib/microsandbox/fs.rb +172 -0
- data/lib/microsandbox/image.rb +111 -0
- data/lib/microsandbox/log_entry.rb +38 -0
- data/lib/microsandbox/metrics.rb +55 -0
- data/lib/microsandbox/sandbox.rb +461 -0
- data/lib/microsandbox/snapshot.rb +155 -0
- data/lib/microsandbox/streams.rb +54 -0
- data/lib/microsandbox/version.rb +7 -0
- data/lib/microsandbox/volume.rb +79 -0
- data/lib/microsandbox.rb +78 -0
- data/rust-toolchain.toml +5 -0
- data/sig/microsandbox.rbs +321 -0
- metadata +101 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: d79b0ba5b32f44bda4e984d0a231c842a0ce938ffe6859776ead5270c1043561
|
|
4
|
+
data.tar.gz: 96a97a6c3008070fdb3c32189973736f72d522942d94761d2656e0ffa0dfc030
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 75291b5c9e1de3fe6b8b444d327d1716be099846fb87121ed9d5d00bf514bae39168cb4f7d246dabe6e41e8383b975f10e2bb7d68e0080ee9fb4ff59d546fad5
|
|
7
|
+
data.tar.gz: eaeb263b8b666f55f6614d88f9a2643379820d7f3be293c2b87ab1810bf164be3a7c6e5f5cb36860abcbd6ab03120cd7f7a91bdaeb1652e5048f369b396758ef
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this gem are documented here. The format is based on
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/), and the version tracks the
|
|
5
|
+
upstream microsandbox runtime.
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
Closes the `Sandbox`-class lifecycle gap with the official Python/Node/Go SDKs.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Asynchronous lifecycle controls on `Microsandbox::Sandbox`: `request_stop`,
|
|
14
|
+
`request_kill`, `request_drain` (send the request without waiting),
|
|
15
|
+
`wait_until_stopped` (blocks and returns a `Microsandbox::SandboxStopResult`),
|
|
16
|
+
`owns_lifecycle?`, and `detach` (disarm stop-on-drop and keep the sandbox
|
|
17
|
+
running). Mirrors the official SDKs' lifecycle surface.
|
|
18
|
+
- `Microsandbox::SandboxStopResult` value object (`name`, `status`, `exit_code`,
|
|
19
|
+
`signal`, `source`, `observed_at`, `stopped?`/`crashed?`).
|
|
20
|
+
- `Microsandbox::Sandbox.list_with(labels:)` — list sandboxes filtered by
|
|
21
|
+
AND-matched labels.
|
|
22
|
+
- `Microsandbox.all_sandbox_metrics` — latest metrics for every running
|
|
23
|
+
sandbox, keyed by name (mirrors `all_sandbox_metrics`/`allSandboxMetrics`).
|
|
24
|
+
- `Microsandbox::VolumeAlreadyExistsError`, mapped from the core
|
|
25
|
+
`VolumeAlreadyExists` variant.
|
|
26
|
+
- Streaming observability: `Sandbox#metrics_stream(interval:)` →
|
|
27
|
+
`Microsandbox::MetricsStream` and `Sandbox#log_stream(sources:, since_ms:,
|
|
28
|
+
from_cursor:, until_ms:, follow:)` → `Microsandbox::LogStream`, both
|
|
29
|
+
`Enumerable` (over `Metrics` / `LogEntry`) draining the underlying core stream
|
|
30
|
+
with the GVL released.
|
|
31
|
+
- Snapshots: `Microsandbox::Snapshot.create`/`get`/`list`/`remove`/`verify`/
|
|
32
|
+
`export`/`import` with `SnapshotInfo` and `SnapshotVerifyReport` value
|
|
33
|
+
objects. Boot from a snapshot via `Sandbox.create(from_snapshot:)`.
|
|
34
|
+
- Expanded `Sandbox.create` options: `log_level`, `quiet_logs`, `security`
|
|
35
|
+
(`default`/`restricted`), `oci_upper_size`, `max_duration`, `idle_timeout`,
|
|
36
|
+
`ports_udp`, `rlimits`, `pull_policy` (`always`/`if-missing`/`never`),
|
|
37
|
+
`secrets` (placeholder-protected, TLS-substituted per allowed host), and the
|
|
38
|
+
`allow_all`/`non_local` network policy presets (alongside the existing
|
|
39
|
+
`public_only`/`none`).
|
|
40
|
+
- Per-exec resource limits: `rlimits:` on `Sandbox#exec`/`#shell`/`#exec_stream`/
|
|
41
|
+
`#shell_stream` (e.g. `rlimits: { nofile: 65_535, cpu: [10, 20] }`).
|
|
42
|
+
- CI now runs the real-microVM integration suite (`spec/integration`) on a
|
|
43
|
+
KVM-enabled runner, so the Rust↔core round-trip is exercised in automation —
|
|
44
|
+
not just compilation and unit tests.
|
|
45
|
+
|
|
46
|
+
## [0.5.7] - 2026-06-17
|
|
47
|
+
|
|
48
|
+
Initial release of the Ruby SDK — native bindings (magnus + rb-sys) over the
|
|
49
|
+
microsandbox runtime, aligned with the official Python/Node/Go SDKs.
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- `Microsandbox::Sandbox` lifecycle: `create` (with block-scoped auto-stop),
|
|
54
|
+
`start`, `get`, `list`, `remove`, `stop`, `kill`.
|
|
55
|
+
- Command execution: `Sandbox#exec` and `Sandbox#shell` returning
|
|
56
|
+
`Microsandbox::ExecOutput` (`exit_code`, `success?`, `stdout`/`stderr`,
|
|
57
|
+
`stdout_bytes`/`stderr_bytes`), with `cwd`, `user`, `env`, `timeout`, `tty`,
|
|
58
|
+
and `stdin` options.
|
|
59
|
+
- Streaming execution: `Sandbox#exec_stream`/`#shell_stream` returning an
|
|
60
|
+
`Enumerable` `Microsandbox::ExecHandle` over `Microsandbox::ExecEvent`s, with
|
|
61
|
+
a stdin sink (`#stdin`), `#wait`/`#collect`, and `#signal`/`#kill`/`#resize`.
|
|
62
|
+
- OCI image-cache management: `Microsandbox::Image.get`/`list`/`inspect`/
|
|
63
|
+
`remove`/`prune` with `ImageInfo`/`ImageDetail`/`ImagePruneReport`.
|
|
64
|
+
- Named volumes: `Microsandbox::Volume.create`/`get`/`list`/`remove` with
|
|
65
|
+
`VolumeInfo`, plus `volumes:` mounts (`{ bind: }` / `{ named: }`) and
|
|
66
|
+
`from_snapshot:` boot in `Sandbox.create`.
|
|
67
|
+
- Guest filesystem (`Sandbox#fs`): `read`, `read_text`, `write`, `list`,
|
|
68
|
+
`mkdir`, `remove`, `remove_dir`, `copy`, `rename`, `exists?`, `stat`,
|
|
69
|
+
`copy_from_host`, `copy_to_host`, with `FsEntry`/`FsMetadata` value objects.
|
|
70
|
+
- Observability: `Sandbox#metrics` (`Microsandbox::Metrics`) and `Sandbox#logs`
|
|
71
|
+
(`Microsandbox::LogEntry`).
|
|
72
|
+
- Create options: `image`, `cpus`, `memory`, `env`, `workdir`, `shell`, `user`,
|
|
73
|
+
`hostname`, `labels`, `scripts`, `entrypoint`, `ports`, `network`
|
|
74
|
+
(`public_only`/`none`), `detached`, `replace`/`replace_with_timeout`.
|
|
75
|
+
- Typed error hierarchy rooted at `Microsandbox::Error`, each carrying a stable
|
|
76
|
+
`#code`, mapped from the core `MicrosandboxError`.
|
|
77
|
+
- Runtime management: `Microsandbox.install`, `.installed?`, `.runtime_path`,
|
|
78
|
+
`.runtime_path=`.
|
|
79
|
+
- The GVL is released during blocking sandbox calls so other Ruby threads keep
|
|
80
|
+
running.
|
|
81
|
+
|
|
82
|
+
### Known limitations / roadmap
|
|
83
|
+
|
|
84
|
+
- Streaming logs/metrics (`log_stream`, `metrics_stream`), snapshot
|
|
85
|
+
creation/management, SSH, the raw agent client, and fine-grained
|
|
86
|
+
networking/secrets/patches are not yet exposed. The native layer is
|
|
87
|
+
structured to add them module-by-module.
|
|
88
|
+
- The release pipeline (`.github/workflows/release.yml`) builds precompiled
|
|
89
|
+
platform gems via `rake-compiler-dock` and publishes via Trusted Publishing;
|
|
90
|
+
the `arm64-darwin` cross-build needs validation on the first tagged run (the
|
|
91
|
+
core crate has Apple-native deps). Until precompiled gems are published,
|
|
92
|
+
installing from source requires a Rust toolchain (stable >= 1.91).
|
|
93
|
+
|
|
94
|
+
[0.5.7]: https://github.com/superradcompany/microsandbox/releases/tag/v0.5.7
|