Skip to content

Data Plane

The model store is logical, not physical

The union of member disks, content-addressed, with the controller tracking which node holds which hash — the BitTorrent model for a trusted network. No central NAS required; the controller never holds weights and never proxies bytes.

Bootstrap from existing paths keyed by (repo, revision, byte-size); hashes are verified on transfer, not by re-hashing 500 GB files on every inventory.

Source selection

When a node needs a model it doesn't have, the scheduler picks the source by measured throughput:

  1. Fabric peer (same site, 200G/100G direct)
  2. Cross-site peer (over the mesh)
  3. Hugging Face (designated fastest downloader per site, then P2P fan-out)

A new model needed nowhere: the fastest-HF node downloads once, then it propagates peer-to-peer over fabric.

Evict-with-relocation

Disk pressure never deletes blindly:

  1. Check whether a nearby fabric peer already holds the model.
  2. Otherwise relocate it to the suitable node with the most free space.
  3. Then delete locally.

Never delete the last copy. Always respect the reserve floor. (This is the model-librarian policy, promoted into the pool.)

Images: client-held origins, pool-shared layers

Image bytes never transit the controller:

  1. Origin. The client pushes to any OCI registry (ghcr.io, Docker Hub, their own) and submits the job by digest. The pool never requires uploading bytes to the controller.
  2. First pull. The assigned node pulls from the origin. Private registries: the client supplies a short-lived pull credential at submit; the controller hands it only to assigned nodes over the authenticated daemon channel.
  3. Pool-shared layers. Once any node holds a layer, it becomes a pool asset: content-addressed by layer digest, tracked in the controller's layer index (which node holds which layer — kilobytes of metadata), and subsequent nodes fetch from fabric peers instead of the origin. The scheduler prices the remaining diff, not the full image, using per-node layer inventories.
  4. Eviction. Same policy as models: LRU with evict-with-relocation, never the last copy, reserve floor respected.

The "registry mirror" is a site-level optional cache (a donor's NAS, a box with disk and a fat pipe) — a fast local origin, not controller infrastructure. The controller holds no image bytes, ever.

Scanning (some-trust): scan at pull time, verdicts cached pool-wide

The node scans what it executes — locally, at pull time, before the first container starts:

  1. The daemon pulls unknown layers and streams them through Trivy (known CVEs) + ClamAV (known malware) as they download. The scan overlaps the pull, so the added latency is roughly max(0, scan − pull).
  2. Per-layer verdicts (keyed by layer digest) are reported to the controller and cached forever. Layers are immutable and content-verified at pull against the submitted digest, so a verdict for a digest is valid pool-wide.
  3. Any node that later needs the layer checks the cache first and skips the re-scan. Each unique layer is scanned exactly once, by whoever pulls it first.
  4. A dirty verdict rejects the job (image_rejected, client notified) and poisons the cache against that digest pool-wide — no other node ever pulls it.

Why the node and not a designated scanner: the scan protects the donor's hardware from the client's image, and in some-trust the donors are the trusted party — the node is the interested party, so it's the natural place. No extra bandwidth (the bytes are already on disk), no extra role to operate. Verdicts record the attesting node; the operator may restrict verdict-writers to trusted nodes, and the controller spot re-verifies. POST /images/scan pre-warms verdicts on an idle node so the first real job doesn't eat scan latency. Scans never run concurrent with a profiling=true run (disk/CPU noise).

Donor-chosen scanners. The pool does not mandate ClamAV+Trivy — the scanner is a plugin interface, donor-configured:

# /etc/pool/scanner.yaml (donor-owned; controller ships a sane default)
scanner:
  id: "clamav-1.5+trivy-0.66"        # reported with every verdict
  command: ["pool-scan", "{path}"]   # {path} = unpacked layer dir
  timeout_s: 1800

The command emits one JSON verdict per layer to stdout:

{"layer_digest": "sha256:…", "verdict": "clean|dirty|error",
 "scanner_id": "clamav-1.5+trivy-0.66", "details": "…"}

The controller only consumes verdicts, so any tool that honors the interface works. One safety rule: only operator-approved scanner IDs propagate verdicts pool-wide (accepted_scanners in controller config; the reference ClamAV+Trivy build is the default entry). A verdict from an unapproved scanner is recorded but gates only its own node's execution — a donor who plugs in /bin/true weakens nobody's protection but their own. A node with no scanner configured simply never pulls unscanned layers: the scheduler only assigns unknown-layer jobs to nodes whose scanner is accepted. The node always enforces its own scanner's verdict locally before execution, even against a cached clean (defense in depth both directions).

Cost (measured 2026-09-29). ClamAV daemon in multiscan mode on layer-like content (11k small files — .py, .so, libs — the shape of an unpacked image): ~74 MB/s on 2 vCPUs (single-threaded: ~6 MB/s, so multiscan is mandatory; the clamscan CLI is disqualified by its ~15–20s per-invocation DB reload). A 20-core Spark should reach a few hundred MB/s. The scan streams with the layer download, so the added latency on a first pull is roughly max(0, scan − pull) — tens of seconds for a typical 15–20 GB image on a 1 Gbps link, once per unique layer, pool-wide, ever. Trivy adds seconds (manifest analysis, not byte scanning). Steady-state task throughput is identical to running the image unsupervised: the scan never sits in front of a second job.