Repository navigation
Conversation
docs/contracts.md describes what controllers and guests exchange: the pool status files, the control channel and its stats request, and the NixOS module. testdata/contract holds the examples every implementation's tests read, so controllers in other vmkit versions or languages can share a host.
One library crate, Linux only, async on tokio for I/O. checks.rust runs rustfmt, clippy (pedantic, warnings denied) and the tests; the dev shell has the toolchain.
… in Rust run_as drops to an account in pre_exec, setting the parent-death signal after the credentials change resets it.
hyper over the API socket, one connection per call, driven to its end before the call returns, so none is left open against the VMM's connection limit.
Times that may be unset (no stats yet, never resized, not calm) are Options instead of zero times.
Status files keep the format docs/contracts.md describes; the tests read the same fixtures as the Go ones, and what Rust writes matches them byte for byte.
An Exchange reads one request line and sends one reply within 5 s; reply() tells whether the reply was delivered. Callers add reply fields with a struct holding Reply flattened.
vmkit names no controller that uses it.
The crate does what the Go packages did, module for module, and keeps to docs/contracts.md, so a controller on v0.1 (Go, kept on the go branch) shares a host with one on the crate. The README describes the crate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vmkit becomes one Rust crate, module for module with the Go packages it replaces. I/O is async on tokio.
The cross-process formats are now written down in
docs/contracts.md: the pool status files, the control channel and itsstatsrequest, and the module. They are pinned by fixtures that both implementations' tests read. Go reads them ongo(9485632, main plus the contract tests), and Rust reads them here. A controller on v0.1 (Go) and one on this crate can share a host.API changes from Go:
Options, not zero times: no stats yet, never resized, not calm, never denied.read_statusesreturnsNonewhen no pool publishes.Exchangeinstead ofAnswer's callback: callers callread_lineorread_request, thenreply, andreplyreturns whether the reply was delivered. To add reply fields, a struct holdsReplyunder#[serde(flatten)].Account::run_as(&mut Command)replacesCredential(): it sets groups, gid and uid inpre_exec, and sets the parent-death signal after them.The module check's networks and pools are renamed from consumer names to
interactiveandbatch.Evidence
Before: the Go tests (39) pass against
testdata/contractongo.After:
checks.rustpasses: rustfmt, clippy pedantic with-D warnings, and 38 tests. These include the same contract cases:checks.modulepasses. Every commit was checked on its own with rustfmt, clippy, the Rust tests, and the Go tests where Go is still present.Merge Danger
Door: two-way
Go stays available on the
gobranch and thev0.1.0/v0.1.1tags.Blast Radius: consumers
A consumer whose
vmkitflake input followsmainand copies it into its Go build would stop building. Hold the merge until workbench in Rust validates the crate, then tagv0.2.0. Go consumers stay onv0.1.xand get the module from that tag's input.