Skip to main content

Crate cellos_host_gvisor

Crate cellos_host_gvisor 

Source
Expand description

gVisor [CellBackend] — uses runsc, the gVisor OCI runtime, to isolate a cell without /dev/kvm.

L2-06-5 status: skeleton.

This backend is targeted at environments where a hardware-virt backend (Firecracker) is unavailable — primarily GKE pods (KVM is gated behind the kvm feature flag, and nested virt is paid) and a subset of CI runners (e.g. GitHub ubuntu-latest without /dev/kvm exposed). gVisor’s user-mode kernel (runsc) intercepts the workload’s syscalls and provides a defence-in-depth boundary that Linux namespaces alone do not.

§Scope of the skeleton

The OCI bundle generator and the command-line plumbing for runsc run / runsc kill / runsc delete are stubs that:

  1. translate an [ExecutionCellDocument] into the on-disk pieces runsc expects (bundle directory containing config.json and a rootfs/),
  2. shell out to runsc with the documented argument shape,
  3. wait for the container process to exit and surface its exit code.

The skeleton is unit-tested for the bundle generator (pure function, no runsc required) and is gated behind #[cfg(target_os = "linux")] because:

  • runsc is Linux-only (it relies on ptrace/KVM/systrap switches that exist nowhere else),
  • the OCI runtime spec referenced in config.json uses Linux namespaces directly, so a portable stub would lie about what the backend does.

On non-Linux hosts the crate compiles to an empty surface so downstream workspace crates can still use cellos_host_gvisor::*; in cfg(target_os = "linux") blocks without breaking macOS/dev builds.

Structs§

BundleConfig
Minimal OCI bundle config — what we hand to runsc via config.json.
GVisorCellBackend
gVisor-backed CellBackend.

Enums§

BundleConfigError
Generator error. Kept simple and self-describing; surfaced verbatim in the supervisor’s CellosError::Backend wrapping at the call site (backend::GVisorCellBackend::create).

Functions§

generate_bundle_config
Translate an ExecutionCellDocument into a BundleConfig.