Expand description
Windows cellos_core::ports::CellBackend — isolates a cell in a Windows
Job Object for hosts where the Linux-only backends (Firecracker, gVisor)
cannot run.
§What a Job Object gives us
A Job Object is the closest Windows analogue to a cgroup-v2 leaf: a kernel object that owns a set of processes and enforces aggregate limits over them. This backend creates one job per cell and uses it for three things:
- Process-tree containment — the workload and every descendant it spawns are members of the job, so teardown is a single kernel call that cannot leak orphans.
- Resource caps —
spec.run.limits.memoryMaxBytesmaps to a job-wideJOB_OBJECT_LIMIT_JOB_MEMORYcap, andspec.run.limits.cpuMaxmaps to a hard CPU-rate cap (JOBOBJECT_CPU_RATE_CONTROL_INFORMATION). - Residue-free teardown — the job is created with
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, so closing the last handle (or an explicitTerminateJobObjectindestroy) kills everything still inside.
§Honest scope (v1)
A Job Object is process-level containment, not a virtualization boundary.
It does not provide a separate kernel, syscall emulation, a filesystem mount
namespace, or network-egress enforcement. Its isolation strength is in the
same tier as the Linux proprietary (cellos-host-cellos) cgroup-only
backend — weaker than gVisor (runsc) and far weaker than a Firecracker
microVM. Operators who need a hardware/syscall boundary must run the cell on
a Linux host with CELLOS_CELL_BACKEND=firecracker (or gvisor).
Two limitations are enforced fail-closed rather than silently ignored:
- Network egress is not enforced. Windows has no
nftequivalent wired here, so a spec that declaresauthority.egressRulesgets a prominent per-cell warning.CellHandle.nft_rules_appliedis alwaysNone. secretDelivery: envis refused when the spec also declaressecretRefs. This backend owns execution (it spawns the workload itself), so the supervisor’s host-subprocess env-injection path is bypassed; rather than run the workload without its secrets,createreturnsInvalidSpec. Use a broker-socket delivery mode (the default,runtimeLeasedBroker) where the child fetches secrets over a socket.
§Platform gating
The real implementation (backend, job) is compiled only on Windows. On
every other target the crate exposes a small stub WindowsCellBackend whose
CellBackend methods return a clear Host error, so cargo check --workspace and cargo doc stay green on Linux/macOS.
Structs§
- Windows
Cell Backend - Non-Windows stub for the Windows Job Object backend.