feat(vm): add openshell-vm crate with libkrun microVM gateway#611
Draft
feat(vm): add openshell-vm crate with libkrun microVM gateway#611
Conversation
Fix targeted gvproxy kill to use tracked PID from runtime state instead of pkill, gate diagnostic dump behind OPENSHELL_VM_DIAG env var, stream SHA-256 hashing to avoid buffering entire files, clarify operator precedence in env var validation, replace hand-rolled JSON parser with serde_json, deduplicate required_runtime_lib_name(), and add openshell-vm to AGENTS.md architecture table.
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
Adds the
openshell-vmcrate — a new microVM runtime that uses libkrun to boot lightweight VMs with hardware isolation. On macOS ARM64 it leverages Apple's Hypervisor.framework; on Linux it uses KVM. This provides a single-binary alternative to the Docker/k3s-based gateway deployment.Changes
crates/openshell-vm/crate with:lib.rs: VmConfig builder, libkrun FFI wrapper, VM lifecycle (launch, exec, reset)ffi.rs: Dynamic loading oflibkrun.dylib/libkrun.sovialibloadingexec.rs:openshell-vm execsupport to run commands inside a running VM via vsockmain.rs: Standalone CLI binary with--exec,--port,--vcpus,--mem,--net,--resetflagsbuild-rootfs.sh,openshell-vm-init.sh,sync-vm-rootfs.sh,check-vm-capabilities.sh, helper Python scriptstasks/vm.tomland associated scriptsarchitecture/custom-vm-runtime.mdopenshell-coreandopenshell-bootstrapfor VM rootfs/runtime directoriestests/gateway_integration.rsTesting
crates/openshell-vm/tests/gateway_integration.rs)mise run pre-commitpassesChecklist
architecture/custom-vm-runtime.md)