Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/monetize

crates/mock-upcloud/kvm-guest/Cargo.toml

# **`draupnir-guest` — the real KVM behind `mock_upcloud::kvm::GuestEngine`.**
#
# ## Why this is a DETACHED workspace and not a member of `monetize`
#
# `mock-upcloud`'s own manifest wrote the rule down: draupnir's live KVM backend
# depends on `tunnr-vm` BY PATH, an optional dependency is still resolved into
# the lockfile whether or not its feature is on, and naming draupnir anywhere in
# the open `monetize` workspace would make a fresh clone of it require sibling
# checkouts that have nothing to do with that repository. That is the exact
# failure the workspace already paid for once with Skidbladnir.
#
# So this crate carries its own `[workspace]` table. Cargo therefore excludes it
# from `monetize`'s workspace entirely: `cargo metadata`, `cargo build` and
# `cargo test` over `monetize` never see it, `monetize`'s Cargo.lock never grows
# a draupnir row, and `cargo test -p mock-upcloud` still needs no hypervisor.
# It lives HERE, beside the seam it fills, because the clause table it must
# honour is `mock-upcloud`'s module doc and a binding in another repo would be a
# second, staler copy of it.
#
# ## Why it does not pull tunnr either
#
# `draupnir` is taken with `default-features = false` and the `backend-qemu`
# feature: draupnir renders the argv and spawns the guest ITSELF (`draupnir::qemu`)
# and `backend-tunnr` stays off, so `tunnr-vm` is not resolved here at all.
#
# ## Why draupnir is a SIBLING path, and why that costs a monetize clone nothing
#
# `path = "../../../../draupnir"` is the estate's convention: every nordisk repo
# is a sibling checkout (draupnir itself names tunnr as `../tunnr`). Because this
# crate has its own `[workspace]` and its own Cargo.lock, that path is resolved
# ONLY when someone builds this crate; a clone of monetize alone never needs a
# draupnir beside it. Do not "fix" this by making the crate a workspace member:
# that is precisely what would drag draupnir into monetize's lockfile.
# `version` stays beside the path so cargo can resolve it once draupnir publishes.
# The draupnir it needs is `agent/faithful-guest` (86da811, `draupnir::qemu`);
# until that merges, point a sibling `draupnir` at that branch to build.
#
# ## The mock with real machines
#
#     cargo run --release --bin mock-upcloud-kvm -- --port 8099 --root /tmp/mock-upcloud-kvm
#
# The mock-upcloud API with DraupnirGuest injected: POST /1.3/server boots a
# real QEMU, `state` follows it, GET /mock/guest/{uuid} shows what it left.
#
# ## Run the measurement
#
#     cargo run --release --bin faithful-guest-proof -- \
#         --iso /path/gunnar-installer-open-fullk.iso --frame-ms 200
[workspace]

[package]
name = "draupnir-guest"
version = "0.1.0"
edition = "2021"
rust-version = "1.85"
license = "AGPL-3.0-only"
publish = false
description = "The DraupnirGuest: a real QEMU behind mock-upcloud's GuestEngine seam, on the machine shape UpCloud hands out"

[dependencies]
# The seam, and the clause table. A path dep pointing UP one directory: this
# crate is inside mock-upcloud's own directory precisely so the two cannot drift.
mock-upcloud = { path = ".." }
# The hypervisor door. `backend-qemu` is draupnir's own QEMU (argv + spawn + QMP
# screendump + qcow2), which needs no tunnr.
draupnir = { version = "0.2.0", path = "../../../../draupnir", default-features = false, features = ["backend-qemu"] }

# The mock with real machines needs a runtime for the mock's own socket, a
# signal to kill its guests on the way out, and a timer for the 200 ms frames.
# Both are already in mock-upcloud's tree, so this adds no new package.
tokio = { version = "1", features = ["rt-multi-thread", "signal", "time", "macros"] }
serde_json = "1"

[[bin]]
name = "mock-upcloud-kvm"
path = "src/bin/mock_upcloud_kvm.rs"

[[bin]]
name = "faithful-guest-proof"
path = "src/bin/faithful_guest_proof.rs"

[[bin]]
name = "utility-fabric-proof"
path = "src/bin/utility_fabric_proof.rs"