Skip to main content

Module compute

Module compute 

Source
Expand description

Compute-backend assembly (moved from the binary — node-library N2).

Builds this node’s compute BackendRegistry and scheduler Node inventory from the optional [compute] config, capability-detecting Docker, native-container, and embedded-VMM backends. Lives here (not in the backend-agnostic boatramp-server) because it depends on the concrete backend crates; the binary and future assemble() call build_compute.

Structs§

NodeComputeExec
The node’s ComputeExec: resolve a workload’s running replica from the control-plane state, pick its backend, and run the command inside it. Backs POST /api/compute/{name}/exec; the API gates it behind the allow_compute_exec posture. Only the shared-kernel backends (native container, remote docker) actually implement ComputeBackend::exec; the rest surface as ExecError::Unsupported.
NodeComputeVolumes
The node’s ComputeVolumes: list + reclaim persistent volumes. Backs GET /api/compute/volumes + DELETE /api/compute/volumes/{name} (admin-scoped). Lists every volume-capable backend’s on-node volumes, flags which are still referenced by a registered workload’s active spec (in use vs orphaned), and refuses to remove an in-use volume unless forced — so compute rm <workload> (which unregisters it, then the reconcile loop stops the replica) is the safe precondition for reclaiming its volume.

Functions§

build_compute
Build this node’s compute [BackendRegistry] + scheduler [Node] inventory from the optional [compute] config. Backends are capability-detected: a reachable Docker daemon ⇒ docker; Linux ⇒ the native container backend; Linux + /dev/kvm ⇒ the in-process vmm-embedded microVM backend (strongest isolation). Absent config ⇒ an empty registry + a node advertising nothing, so the reconcile loop stays a no-op.