mirror of
https://github.com/wirenboard/agent-vm.git
synced 2026-07-09 16:00:54 +00:00
The name `agent-vm` was overloaded: it's both the runtime tool (Rust binary on npm) AND the OCI image the tool boots inside each microVM. Users seeing `ghcr.io/wirenboard/agent-vm:latest` would reasonably guess that's where the *runtime* lives, but it's actually the guest rootfs. Rename the ghcr package to `agent-vm-template` and add OCI labels (`org.opencontainers.image.title` / `description`) that explicitly say "guest template image — install the runtime via npm". The description shows on the ghcr.io package page. Also rename the local-registry tag (`localhost:5000/agent-vm-template:latest`) for consistency with the dev workflow. Touches: - DEFAULT_IMAGE_REF and every help/doctring referencing the ghcr image (setup.rs, run.rs, pull.rs, image_api_version.rs, image_check.rs). - images/Dockerfile — new header + OCI labels. - images/build.sh — local registry tag. - .github/workflows/build-image.yml — IMAGE env. - README.md + npm-dist/README.md. - image_check tests updated to assert the new name. Bumps to v0.1.4 so npm + ghcr converge on the new name. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| agent-vm | ||
| agent-vm-linux-x64 | ||
| .gitignore | ||
| README.md | ||
npm-dist
Templates and tooling for distributing agent-vm via npm.
Layout
agent-vm/— the user-facing main package. Tiny JS launcher (bin/agent-vm.js) that detects${platform}-${arch}at runtime andexecves the prebuilt native binary from the matching per-platform subpackage. Declares per-platform subpackages asoptionalDependenciesso npm installs only the right one.agent-vm-linux-x64/— per-platform subpackage. Ships the prebuiltbin/agent-vm, the patchedbin/msb, andlib/libkrunfw.so.5.2.1. agent-vm findsmsbandlibkrunfwviacurrent_exe()-relative paths so a user's separate microsandbox install never shadows them.- Future per-platform subpackages:
-linux-arm64,-darwin-arm64,-darwin-x64,-win32-x64. Add to the launcher'sPLATFORM_PACKAGESmap and to the main package'soptionalDependencies.
How releases happen
CI populates each subpackage's bin/ and lib/ with freshly
cross-compiled artifacts, rewrites every package.json version
field to match the release tag, and runs npm publish for each
package. See .github/workflows/release-npm.yml.
The OCI image is on a separate cadence (hourly cron) — see
.github/workflows/build-image.yml. Binary releases pin the
default image to ghcr.io/wirenboard/agent-vm-template:latest; users
override per-launch via --image or AGENT_VM_IMAGE_TAG.
Local smoke test
To verify the launcher resolves a subpackage correctly without
publishing, drop a prebuilt binary into a subpackage's bin/ and
npm link it:
# build the binary
cargo build --release -p agent-vm
cargo build --release --manifest-path vendor/microsandbox/Cargo.toml \
-p microsandbox-cli --bin msb
cp target/release/agent-vm npm-dist/agent-vm-linux-x64/bin/
cp vendor/microsandbox/target/release/msb npm-dist/agent-vm-linux-x64/bin/
cp ~/.microsandbox/lib/libkrunfw.so.5.2.1 npm-dist/agent-vm-linux-x64/lib/
cd npm-dist/agent-vm-linux-x64 && npm link && cd ..
cd npm-dist/agent-vm && npm link @wirenboard/agent-vm-linux-x64 && npm link
agent-vm --help # should exec target/release/agent-vm