microsandbox-rb 0.12.0 → 0.14.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72468dc2fa865510c82ecc783988925460acbd7f7d92025f367964277b98e756
4
- data.tar.gz: f4bca46d64a694a76a59b712b8d827e6ddff12ba4cb9708a33951f4969c8fce2
3
+ metadata.gz: 5347e3ff3b98575cd98ee948fce387efc1bde98da5069fb808ed62e8d065a066
4
+ data.tar.gz: 4c143ec287857130709632f19d124c56488fd22837215a85e61e7c52da609884
5
5
  SHA512:
6
- metadata.gz: 31cace38acfb4b535aaeb5f9026acb4c63d5f1376637628c2947e1d5ff9c1492d388cde85f3ba38bd8d462bb0598d12f046467331a6507d6af2cd2720bb57137
7
- data.tar.gz: 97e665bd96d8d7ae0719c34d5a7d7f7823966a70f793d251d034a519ad04da70a8925c0e17c01c854ab074de904aa9a1baa88b148f099afba33c751836f97a60
6
+ metadata.gz: f4d810f63d588b685b0393e93d637fa28554bdbfbf34a09b0b5d0ca45a4962acd9ac9991e0e6bd8157e5ef31b9cf4321d6dd20a703ad7d251099b1d4a951f346
7
+ data.tar.gz: f89447fa04f1bd6112199a7286101c26e1c2bed28d66d08816d171298f357ee412474207b60782b8592838f5191914657adafa3b89745dec9600552cb0507e1b
data/CHANGELOG.md CHANGED
@@ -6,6 +6,156 @@ All notable changes to this gem are documented here. The format is based on
6
6
  microsandbox runtime it embeds; each release notes the upstream runtime tag it
7
7
  wraps, and the README's Versioning section keeps the full gem→runtime map.
8
8
 
9
+ ## [0.14.0] - 2026-08-24
10
+
11
+ Runtime tag unchanged — still upstream **`v0.6.9`**.
12
+
13
+ ### Added
14
+
15
+ - **Companion gem `microsandbox-rb-binaries`** (source in `binaries/`): the
16
+ prebuilt `msb` microVM runtime and the `libkrunfw` firmware, shipped as one
17
+ gem per platform (`arm64-darwin`, `x86_64-linux-gnu`, `aarch64-linux-gnu`;
18
+ the Linux binaries are glibc-linked, hence `required_rubygems_version >=
19
+ 3.3.11`). Install it alongside `microsandbox-rb` at the same version and your
20
+ bundle carries the runtime instead of downloading it into `~/.microsandbox`
21
+ on first use. There is no dependency edge in either direction — RubyGems has
22
+ no optional dependencies, and cloud-only users should not be made to fetch
23
+ ~50 MB of binaries. Motivated by upstream
24
+ [superradcompany/microsandbox#1305](https://github.com/superradcompany/microsandbox/issues/1305).
25
+ - **A new tier in the runtime resolver.** `require "microsandbox"` activates the
26
+ companion gem (if installed at the same version and built for the same
27
+ upstream runtime) and hands
28
+ its `msb` to the core's set-once SDK slot; the firmware is found by the
29
+ runtime's `../lib` adjacency, exactly as in the Python/Node SDKs. The
30
+ effective order is now `MSB_PATH` → `microsandbox-rb-binaries` → config file →
31
+ `~/.microsandbox/bin/msb` → `msb` on `PATH`, and
32
+ `Microsandbox.runtime_path` reports the winner. Activation never raises: a
33
+ missing gem is silent, and a gem built for a *different* runtime is reported
34
+ with a warning and skipped rather than handed to the core.
35
+ - **Lock-step guard for the new gem.** `Microsandbox::Binaries::VERSION` must
36
+ equal `Microsandbox::VERSION` and `Microsandbox::Binaries::RUNTIME_VERSION`
37
+ must equal `Microsandbox::RUNTIME_VERSION`; `spec/unit/version_spec.rb`
38
+ asserts both, so a stale companion can't ship.
39
+ - **Vendoring/build pipeline** for the companion gem:
40
+ `rake -C binaries vendor[<platform>]` downloads the upstream release bundle and
41
+ verifies every file against that release's `checksums.sha256` as committed
42
+ in `binaries/checksums/<tag>.sha256` (fail-closed — a missing entry, a digest
43
+ mismatch, an unexpected file, or a live release file that disagrees with the
44
+ committed one aborts), `rake -C binaries build[<platform>]` re-verifies the staged tree
45
+ against its manifest before packaging, `rake -C binaries verify` runs the
46
+ vendored `msb` on the host, and `vendor:all` covers every platform from any
47
+ host. CI builds all three platform gems on every run, and `release.yml`
48
+ builds and publishes them on each version tag in a separate
49
+ `publish-binaries` job that runs after the SDK gem is live (a companion-gem
50
+ failure is its own red job and never blocks the SDK release; re-runs are
51
+ idempotent). The companion gem has its own RubyGems trusted-publisher entry.
52
+
53
+ ### Changed
54
+
55
+ - **The SDK gem is now SDK-only: nothing is provisioned at build or install
56
+ time.** The core crate's default `prebuilt` feature — whose `build.rs`
57
+ downloaded the *host* runtime into `~/.microsandbox` while compiling the
58
+ extension — is off (`default-features = false`, features `keyring`, `net`,
59
+ `ssh`, matching the official SDKs). The *guest* agent `agentd` is still
60
+ embedded into the extension at build time, via a direct
61
+ `microsandbox-runtime` dependency with just the `prebuilt` sub-feature that
62
+ fetches it. Host runtime provisioning is now the companion gem's job, with the
63
+ first-use download as fallback.
64
+ - **`Microsandbox.runtime_path=` is a no-op when the companion gem is active** —
65
+ it targets the same set-once slot the gem already claimed at load time. Use
66
+ the `MSB_PATH` environment variable to override a bundled runtime.
67
+ - **`Microsandbox.ensure_runtime!` skips the installer entirely** when the
68
+ resolved runtime is the companion gem's `msb`: those binaries are already the
69
+ matching version, so nothing is downloaded or touched in `~/.microsandbox`.
70
+ Without the gem, behaviour is unchanged — the version-correcting first-use
71
+ download into `~/.microsandbox` remains the lowest tier, still opt-out-able
72
+ with `MICROSANDBOX_NO_AUTO_INSTALL`.
73
+ - `Gemfile` now uses `gemspec glob: "{,*}.gemspec"` so Bundler resolves only the
74
+ root gemspec; its default glob would also evaluate the nested
75
+ `binaries/microsandbox-rb-binaries.gemspec` in every `bundle exec` process.
76
+
77
+ ## [0.13.0] - 2026-08-18
78
+
79
+ Adopts upstream runtime **`v0.6.8` → `v0.6.9`**.
80
+
81
+ ### Breaking
82
+
83
+ - **A bare `MSB_API_KEY` no longer selects the cloud backend** (upstream
84
+ backend-selection hardening: "a bare API key is credential material, not
85
+ backend intent"). Cloud intent must now be explicit: set `MSB_BACKEND=cloud`
86
+ (with a non-empty `MSB_API_KEY`), select a cloud profile, or call
87
+ `Microsandbox.set_default_backend(:cloud, ...)`. Code that relied on
88
+ exporting only `MSB_API_KEY` now silently runs on the **local** backend —
89
+ audit deployment environments when upgrading.
90
+ - **Invalid cloud configuration fails closed** instead of silently falling
91
+ back to local execution: `MSB_BACKEND=cloud` without a usable API key or
92
+ cloud profile raises {Microsandbox::InvalidConfigError} at first use rather
93
+ than dispatching sandboxes locally.
94
+ - **Snapshot payload integrity is opt-in** (upstream #1346). New snapshots no
95
+ longer record a content digest unless created with
96
+ `record_integrity: true` (previously documented as a no-op because schema-1
97
+ always recorded integrity — that default reversed upstream, as hashing
98
+ large allocated uppers is expensive). {Microsandbox::Snapshot.verify} on a
99
+ snapshot without recorded integrity now reports
100
+ `SnapshotVerifyReport#status == :not_recorded` (with `#algorithm` /
101
+ `#content_digest` nil, `#verified?` false) instead of always `:verified`.
102
+
103
+ ### Added
104
+
105
+ `v0.6.9` SDK parity (matching the official Python binding surface):
106
+
107
+ - **Default-workload execution** — `Sandbox.create` is strictly boot-only, so
108
+ the image's resolved OCI `ENTRYPOINT`+`CMD` now runs via
109
+ {Microsandbox::Sandbox#exec_default} (buffered),
110
+ {Microsandbox::Sandbox#exec_default_stream} (streaming), and
111
+ {Microsandbox::Sandbox#attach_default} (interactive). New
112
+ {Microsandbox::NoDefaultCommandError} when the image resolves no executable
113
+ command. New `cmd:` create keyword overrides the durable image CMD (an
114
+ explicit `[]` clears it) without executing anything at create time.
115
+ - **Flat OCI root disks** — `RootDisk.flat(size_mib, fstype:, clone:)` boots
116
+ from a single complete ext4 root disk materialized from the OCI image
117
+ (skips the overlay stack; content-addressed and cached; `clone:` picks
118
+ `:auto`/`:copy`/`:reflink` private-disk cloning).
119
+ - **Root-disk resizing** — `modify(root_disk_size:)` grows the managed upper
120
+ or flat root disk (MiB).
121
+ - **Per-sandbox network rate limits** — `rate_limiter:` create keyword with
122
+ per-direction (`egress:`/`ingress:`) `bandwidth:`/`ops:` token buckets
123
+ (`size:`, `refill_time_ms:`, `one_time_burst:`).
124
+ - **Host vsock routes** — `vsock:` create keyword exposes host Unix sockets
125
+ on guest-to-host vsock ports: `{ "/host/api.sock" => 5000 }` or an Array of
126
+ `{host_socket:, port:, socket_type: :stream|:dgram}`.
127
+ - **Active backend context** — {Microsandbox.default_backend_info} returns a
128
+ secret-safe {Microsandbox::BackendInfo} (`kind`, `api_url`, `source`,
129
+ `profile`; never the API key).
130
+ - **Default volume** — {Microsandbox::Volume.get_default} (cloud backend;
131
+ local raises {Microsandbox::UnsupportedError}) and
132
+ `VolumeInfo#default?`. The full `VolumeInfo#fs` surface works against cloud
133
+ default and managed directory volumes as of `v0.6.9`.
134
+
135
+ Not exposed, matching the official Python binding at `v0.6.9`:
136
+ `DeploymentProfile`/CPU-placement/THP create options (upstream wires them via
137
+ `config.json`/CLI only so far) and the Rust-only sparse
138
+ `SandboxConfigPatch`/`builder.configure` surface.
139
+
140
+ ### Fixed
141
+
142
+ - `entrypoint: []` now clears the image's `ENTRYPOINT` (blocking the
143
+ image-config merge), matching the upstream builder contract and the Python
144
+ binding. Previously the empty array was silently dropped in the native
145
+ layer, so the image ENTRYPOINT survived — observable under the new
146
+ `exec_default`/`attach_default`, which would have run the wrong command.
147
+ `nil` (the default) still inherits the image value.
148
+
149
+ ### Runtime
150
+
151
+ - Upstream `v0.6.9` runtime changes carried without further Ruby surface
152
+ change: NUMA-aware placement profiles, degraded placement under pressure,
153
+ integrated host performance stack (topology-aware CPU placement, THP
154
+ policy, bounded block writeback), long-link-target preservation in saved
155
+ image archives, nested OCI image index loads, backpressured published-port
156
+ data preservation, DNS network-rule parsing in release builds, and
157
+ child-process reaping in `agentd`.
158
+
9
159
  ## [0.12.0] - 2026-07-30
10
160
 
11
161
  Adopts upstream runtime **`v0.6.7` → `v0.6.8`** and mirrors its breaking SDK
@@ -881,7 +1031,8 @@ microsandbox runtime, aligned with the official Python/Node/Go SDKs.
881
1031
  core crate has Apple-native deps). Until precompiled gems are published,
882
1032
  installing from source requires a Rust toolchain (stable >= 1.91).
883
1033
 
884
- [Unreleased]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.9.0...HEAD
1034
+ [Unreleased]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.14.0...HEAD
1035
+ [0.14.0]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.13.0...v0.14.0
885
1036
  [0.9.0]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.8.2...v0.9.0
886
1037
  [0.8.2]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.8.1...v0.8.2
887
1038
  [0.8.1]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.8.0...v0.8.1