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§
- Deploy
DnsSource - The internal-DNS control-plane source (Linux): snapshots the co-located fleet
from the
DeployStorereplica state into the two maps the resolver needs — IP →(project, workload)(the source-IP reverse map, from every replica so an unknown source is recognised as such) and(project, workload)→ healthy replica IPs (the name → IP forward map, mirroringDeployEndpointResolver’s healthy-running filter). A workload resolves ONLY to its own project’s healthy replicas; the isolation scoping itself lives in the pure resolver, which keys its answer by the source IP’s project. - Node
Compute Control - The node’s
ComputeControl: restart a replica (stop it + drop its observed state so the reconcile loop relaunches it). BacksPOST /api/compute/maintenance/restart(admin-scoped). Resolves the target replica’s backend from its persisted state and callsComputeBackend::stop; the server nudges the reconcile loop afterwards so relaunch is prompt. - Node
Compute Exec - The node’s
ComputeExec: resolve a workload’s running replica from the control-plane state, pick its backend, and run the command inside it. BacksPOST /api/compute/{name}/exec; the API gates it behind theallow_compute_execposture. Only the shared-kernel backends (nativecontainer, remotedocker) actually implementComputeBackend::exec; the rest surface asExecError::Unsupported. - Node
Compute Volumes - The node’s
ComputeVolumes: list + reclaim persistent volumes. BacksGET /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 — socompute rm <workload>(which unregisters it, then the reconcile loop stops the replica) is the safe precondition for reclaiming its volume.
Functions§
- adopt_
running_ replica_ ips - Adopt the IPs of already-running replicas into each compute backend’s
fresh-on-boot IP pool, so the backend reserves live addresses before the
reconcile loop allocates any new one. Reads every persisted replica across all
projects, parses each endpoint’s IPv4 address (from the routable endpoint host,
falling back to the
<ip>:<port>backend_ref), groups them by backend, and hands each backend the(workload, replica, ip)tuples for its own replicas. - 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 nativecontainerbackend; Linux +/dev/kvm⇒ the in-processvmm-embeddedmicroVM backend (strongest isolation). Absent config ⇒ an empty registry + a node advertising nothing, so the reconcile loop stays a no-op. - spawn_
internal_ dns - Start the per-project internal DNS resolver task when it is enabled and the
container backend + bridge are active. Binds UDP
gateway:53(the bridge gateway the container backend assigns), forwarding non-internal queries tocompute.dns_upstream. Returns the detached task handle, orNonewhen the resolver is off, the container backend isn’t present (nothing to serve names for), or the subnet/upstream is malformed. Linux-only: it binds a socket and is meaningful only where the container/bridge code runs; a non-Linux node returnsNone(the seam is compiled out).