Skip to content

[WIP] feat(minimald): --gvproxy-bin flag + just recipes for #478 networking/VM bring-up - #574

Closed
norrietaylor wants to merge 2 commits into
mainfrom
feat/gvproxy-bin-and-just
Closed

[WIP] feat(minimald): --gvproxy-bin flag + just recipes for #478 networking/VM bring-up#574
norrietaylor wants to merge 2 commits into
mainfrom
feat/gvproxy-bin-and-just

Conversation

@norrietaylor

@norrietaylor norrietaylor commented Jun 25, 2026

Copy link
Copy Markdown
Member

Dev-ergonomics for working the #478 networking epic locally. Two independent commits, no behavior change to existing flows.

Commits

  • feat(minimald): add --gvproxy-bin flag — the daemon resolved the gvproxy ("gvisor-tap-vsock") switch binary only from the fixed install path /usr/lib/minimal/bin/gvproxy, so exercising the OwnIp data plane on a dev host meant installing gvproxy system-wide (sudo). Adds minimald run --gvproxy-bin <path> to point the per-host switch at any binary — e.g. one fetched by scripts/fetch-gvproxy.sh — with no system install. Unset preserves the previous default path.
  • build: add just recipes for #478 bring-up — captures the Lane A (native netns proofs, mesh proof, networking feature suites) and Lane B (minvmd VM E2E) command sequences as just recipes that mirror ci-netns.yml and ci-linux-kvm.yml, so a dev reproduces each lane with one command instead of reassembling the env-var soup. Adds fetch-gvproxy, setup-minvmd, setup-kvm-group, test-netns, test-mesh-netns, test-net-features, test-minvmd-e2e, and a run-minimald recipe that wires the new --gvproxy-bin flag to a fetched gvproxy.

Verification

  • cargo build -p minimald — clean
  • cargo fmt -p minimald -- --check — clean
  • cargo clippy -p minimald --all-targets -- -D warnings — clean
  • just --list parses; recipes exercised locally (just test-netns / test-net-features / test-mesh-netns green; --gvproxy-bin used to run a privileged dev daemon with no system gvproxy install).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a new optional command-line flag to let you override the path to the networking helper binary.
    • Added several new convenience commands for running networking checks, VM setup, and end-to-end local testing.
    • Added a ready-to-use command for starting the service with the custom binary path.

norrietaylor and others added 2 commits June 25, 2026 00:31
The daemon resolved the gvproxy ("gvisor-tap-vsock") switch binary only
from the fixed install path `/usr/lib/minimal/bin/gvproxy`, so exercising
the OwnIp data plane on a dev host required installing gvproxy
system-wide (sudo). Add `minimald run --gvproxy-bin <path>` to point the
per-host switch at an arbitrary binary — e.g. one fetched by
scripts/fetch-gvproxy.sh — with no system install. Unset preserves the
previous default path. The flag survives the `--detach` re-exec since
spawn_detached forwards argv verbatim.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Capture the Lane A (native netns proofs, mesh proof, networking feature
suites) and Lane B (minvmd VM E2E) command sequences as just recipes that
mirror ci-netns.yml and ci-linux-kvm.yml, so a dev reproduces each lane
with one command instead of reassembling the env-var soup by hand. Also
adds fetch-gvproxy, setup-minvmd, setup-kvm-group, and a run-minimald
recipe that wires the new --gvproxy-bin flag to a fetched gvproxy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds a --gvproxy-bin CLI override, threads it into minimald::server::Config, and updates the daemon comment to describe the override. It also extends justfile with gvproxy download, networking test lanes, and VM bring-up recipes.

Changes

gvproxy override and workflow recipes

Layer / File(s) Summary
CLI override wiring
crates/minimald/src/main.rs, crates/minimald/src/server.rs
The CLI accepts an optional gvproxy binary path, the micro-vm init path still leaves it unset, minimald::server::Config receives the cloned CLI value, and the server comment describes the override path.
gvproxy fetch and run recipes
justfile
The justfile defines shared architecture and prefix variables, adds fetch-gvproxy, and adds run-minimald that invokes minimald run --gvproxy-bin with the fetched binary.
Networking test lane A
justfile
The justfile adds test-netns, test-mesh-netns, test-net-features, and test-net-lane-a recipes that run the networking test commands with GVPROXY_BIN wiring.
VM bring-up and E2E lane
justfile
The justfile adds setup-minvmd, test-minvmd-e2e, and setup-kvm-group for VM artifact fetching, KVM-scoped E2E runs, and the KVM group setup message.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant MinimaldRun
  participant ListenArgs
  participant MinimaldServerConfig
  participant OwnIpSwitch
  User->>MinimaldRun: passes --gvproxy-bin <path>
  MinimaldRun->>ListenArgs: stores gvproxy_bin
  ListenArgs->>MinimaldServerConfig: clones gvproxy_bin
  MinimaldServerConfig->>OwnIpSwitch: uses override
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • gominimal/minimal#503: Shares the --gvproxy-bin override and scripts/fetch-gvproxy.sh flow for fetching and using gvproxy.

Suggested reviewers

  • bryan-minimal

Poem

I thumped through the tunnels, all bright and neat,
With gvproxy packed for each hopping feat.
One justfile nibble, two VM moonbeams,
Now minimald follows my rabbit dreams.
🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the two main changes: the new --gvproxy-bin flag and the added just recipes for networking/VM bring-up.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@justfile`:
- Around line 41-47: The mesh_uc7 recipe can invoke sudo with an empty binary
path if the cargo/jq pipeline returns nothing, so add an explicit guard after
resolving bin in the justfile recipe. In the recipe that sets bin and runs
"$bin", check that mesh_uc7 binary resolution succeeded and fail early with a
clear message before the sudo execution if it did not.
- Around line 68-80: The test-minvmd-e2e Just recipe assumes .scratch artifacts
already exist, so it can fail on a clean checkout. Update the test-minvmd-e2e
target in the justfile to depend on setup-minvmd before running the two sg kvm
cargo test commands, so the generated boot and rootfs files are prepared first
and the recipe is runnable directly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 48a11be4-5423-41ed-a6ec-e6b3bf59472b

📥 Commits

Reviewing files that changed from the base of the PR and between c1333e0 and 81ee649.

📒 Files selected for processing (3)
  • crates/minimald/src/main.rs
  • crates/minimald/src/server.rs
  • justfile

Comment thread justfile
Comment on lines +41 to +47
bin=$(cargo test -p minimald --features networking-wg --test mesh_uc7 \
--no-run --message-format=json \
| jq -r 'select(.executable != null and (.target.name? == "mesh_uc7")) | .executable' \
| tail -1)
echo "mesh_uc7 binary: $bin"
sudo -E MINIMALD_NETNS_TEST=1 GVPROXY_BIN="$PWD/.scratch/gvproxy" \
"$bin" --include-ignored --nocapture

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Guard against empty mesh_uc7 executable resolution before sudo execution.

If the JSON filter returns nothing, "$bin" is empty and the recipe fails with a non-actionable error. Add an explicit check with a clear message.

Suggested patch
     bin=$(cargo test -p minimald --features networking-wg --test mesh_uc7 \
             --no-run --message-format=json \
           | jq -r 'select(.executable != null and (.target.name? == "mesh_uc7")) | .executable' \
           | tail -1)
+    if [[ -z "${bin:-}" ]]; then
+        echo "mesh_uc7 executable not found; cargo test --no-run did not emit a binary path" >&2
+        exit 1
+    fi
     echo "mesh_uc7 binary: $bin"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
bin=$(cargo test -p minimald --features networking-wg --test mesh_uc7 \
--no-run --message-format=json \
| jq -r 'select(.executable != null and (.target.name? == "mesh_uc7")) | .executable' \
| tail -1)
echo "mesh_uc7 binary: $bin"
sudo -E MINIMALD_NETNS_TEST=1 GVPROXY_BIN="$PWD/.scratch/gvproxy" \
"$bin" --include-ignored --nocapture
bin=$(cargo test -p minimald --features networking-wg --test mesh_uc7 \
--no-run --message-format=json \
| jq -r 'select(.executable != null and (.target.name? == "mesh_uc7")) | .executable' \
| tail -1)
if [[ -z "${bin:-}" ]]; then
echo "mesh_uc7 executable not found; cargo test --no-run did not emit a binary path" >&2
exit 1
fi
echo "mesh_uc7 binary: $bin"
sudo -E MINIMALD_NETNS_TEST=1 GVPROXY_BIN="$PWD/.scratch/gvproxy" \
"$bin" --include-ignored --nocapture
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@justfile` around lines 41 - 47, The mesh_uc7 recipe can invoke sudo with an
empty binary path if the cargo/jq pipeline returns nothing, so add an explicit
guard after resolving bin in the justfile recipe. In the recipe that sets bin
and runs "$bin", check that mesh_uc7 binary resolution succeeded and fail early
with a clear message before the sudo execution if it did not.

Comment thread justfile
Comment on lines +68 to +80
test-minvmd-e2e:
#!/usr/bin/env bash
set -euo pipefail
krun="{{krun_prefix}}"
common="LIBKRUN_PREFIX=$krun LD_LIBRARY_PATH=$krun MINVMD_E2E=1 \
MINVMD_KERNEL_PATH=$PWD/.scratch/vmlinuz \
MINVMD_ROOTFS_PATH=$PWD/.scratch/rootfs.img \
MINVMD_INITRAMFS=$PWD/.scratch/initramfs.cpio"
sg kvm -c "env $common MINVMD_BOOT_LOG=$PWD/.scratch/boot-e2e.log \
cargo test -p minvmd --test boot_e2e -- --include-ignored --nocapture"
sg kvm -c "env $common \
cargo test -p minvmd --test minimald_session_e2e -- --include-ignored --nocapture --exact minimald_exec_over_bridge"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

test-minvmd-e2e should depend on setup-minvmd for first-run reliability.

On a clean repo, this recipe can fail because .scratch/vmlinuz, .scratch/rootfs.img, and .scratch/initramfs.cpio may not exist yet. Add setup-minvmd as a prerequisite so Lane B is runnable directly.

Suggested patch
-test-minvmd-e2e:
+test-minvmd-e2e: setup-minvmd
     #!/usr/bin/env bash
     set -euo pipefail
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
test-minvmd-e2e:
#!/usr/bin/env bash
set -euo pipefail
krun="{{krun_prefix}}"
common="LIBKRUN_PREFIX=$krun LD_LIBRARY_PATH=$krun MINVMD_E2E=1 \
MINVMD_KERNEL_PATH=$PWD/.scratch/vmlinuz \
MINVMD_ROOTFS_PATH=$PWD/.scratch/rootfs.img \
MINVMD_INITRAMFS=$PWD/.scratch/initramfs.cpio"
sg kvm -c "env $common MINVMD_BOOT_LOG=$PWD/.scratch/boot-e2e.log \
cargo test -p minvmd --test boot_e2e -- --include-ignored --nocapture"
sg kvm -c "env $common \
cargo test -p minvmd --test minimald_session_e2e -- --include-ignored --nocapture --exact minimald_exec_over_bridge"
test-minvmd-e2e: setup-minvmd
#!/usr/bin/env bash
set -euo pipefail
krun="{{krun_prefix}}"
common="LIBKRUN_PREFIX=$krun LD_LIBRARY_PATH=$krun MINVMD_E2E=1 \
MINVMD_KERNEL_PATH=$PWD/.scratch/vmlinuz \
MINVMD_ROOTFS_PATH=$PWD/.scratch/rootfs.img \
MINVMD_INITRAMFS=$PWD/.scratch/initramfs.cpio"
sg kvm -c "env $common MINVMD_BOOT_LOG=$PWD/.scratch/boot-e2e.log \
cargo test -p minvmd --test boot_e2e -- --include-ignored --nocapture"
sg kvm -c "env $common \
cargo test -p minvmd --test minimald_session_e2e -- --include-ignored --nocapture --exact minimald_exec_over_bridge"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@justfile` around lines 68 - 80, The test-minvmd-e2e Just recipe assumes
.scratch artifacts already exist, so it can fail on a clean checkout. Update the
test-minvmd-e2e target in the justfile to depend on setup-minvmd before running
the two sg kvm cargo test commands, so the generated boot and rootfs files are
prepared first and the recipe is runnable directly.

@norrietaylor norrietaylor changed the title feat(minimald): --gvproxy-bin flag + just recipes for #478 networking/VM bring-up [WIP] feat(minimald): --gvproxy-bin flag + just recipes for #478 networking/VM bring-up Jun 25, 2026
@norrietaylor
norrietaylor marked this pull request as draft June 25, 2026 15:47
@norrietaylor

Copy link
Copy Markdown
Member Author

closing as won't do

@norrietaylor
norrietaylor deleted the feat/gvproxy-bin-and-just branch June 25, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant