vibe-schedulerDocumentation

Isolated principal execution (#236)

Status: implemented in source; real Linux qualification remains pending. This opt-in executor runs an authority-bound CPU job in a Docker container on a single-user Linux daemon target. It reuses the managed-container lifecycle for immutable worker identity, uncertain outcomes, cancellation and restart. Native shared-account execution and PBS/Slurm targets cannot satisfy a container binding. Per-user PBS and Slurm connections use a separate pbs or slurm profile. No existing job, service, account, image or runtime is migrated or changed by installing this source.

What enforces the boundary

Each accepted binding includes a single qualified image ID, program name and source revision. The authority supplies it; clients cannot select their UID, account, target, image, mounts or engine options. The target must independently approve the exact whole binding under its external configuration. Distinct principals cannot share a UID/account grant. The permanent gateway claims ledger continues to prevent reassignment after configuration entries are removed.

Before transferring the payload, the broker obtains a read-only vq broker isolation-check receipt. It requires the running daemon’s current binding capability, open admission, matching state root, and a locally cached image matching the recorded image ID and provenance labels. Old helpers/daemons, unsupported engines, missing grants and maintenance holds refuse the request. Placement, transfer replay, target intake and dispatch recheck their respective boundary; there is no native or scheduler fallback. The ordinary keyed submit still owns the job ID, payload transaction and idempotency key.

The container uses the binding’s non-root numeric UID as both UID and GID. The account name is a logical identity in the binding, not a command to create or switch to a host login account. Each job has a fresh copied workspace inside a private authority-owned parent. Only that copy is mounted. The original job record, other workspaces, engine/daemon sockets, SSH credentials, configuration and host runtime generations are not mounted or passed through the environment.

The enforced profile uses:

  • A read-only immutable image; declared image volumes are refused. The submitted argv overrides the image entrypoint without shell interpolation.

  • No network, no IPC sharing, private PID/UTS/cgroup namespaces, no extra devices or groups, all capabilities dropped, and no-new-privileges.

  • The engine’s built-in seccomp profile, plus CPU/memory/no-swap limits and a 256-process limit. /tmp is a private 64 MiB noexec/nosuid/nodev tmpfs.

  • Exactly one read/write job workspace bind mount with private propagation; no peer or control-plane mounts. Container inspection verifies confinement before start, control, result collection and recovery. A mismatch retains the reservation and authorizes no guessed start, signal or removal.

The supported engine is rootful Linux Docker on a local Unix endpoint, with cgroup v2, seccomp and the required CPU/memory/swap/PID limit support. Rootless engines, user-namespace remapping, remote engines, multi-user daemons, scheduler lanes, GPUs, retries and automatic sibling restart are currently refused. Docker engine administrators and native workloads running as the authority are trusted; this does not isolate their access to the authority’s files. Do not run untrusted native jobs under that authority. Kernel/engine vulnerabilities remain outside the promised namespace boundary; this is not a universal adversarial sandbox.

External configuration and image preparation

Build and qualify an image separately; the executor never builds or pulls one. Use its immutable local sha256: image ID, not a tag or a registry manifest whose local image identity differs. The image must contain the required runtime, all offline dependencies and these labels:

org.vibyverse.program=vibeqc-release
org.vibyverse.source-sha=cccccccccccccccccccccccccccccccccccccccc

Labels are checked against the configured binding, but are declarations rather than scientific/provenance qualification by themselves. Verify the installed package version, native libraries, source and scientific behavior independently. Do not replace an existing calculation’s qualified runtime with this image. Retain the image for the lifetime of every pending/running bound job.

Extend a gateway principal’s execution requirement with a new execution generation. A previously recorded generation is immutable, including one recorded before the container runtime field existed:

[gateway.projects.group-a.execution_bindings.alice]
execution_id = "alice-docker-001"
target = "isolated-target"
account = "worker_alice"
uid = 21001

[gateway.projects.group-a.execution_bindings.alice.container]
image = "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
program = "vibeqc-release"
source_sha = "cccccccccccccccccccccccccccccccccccccccc"

Keep the gateway’s stable execution_authority and existing program/resource policy. This first executor supports one image/program per immutable generation. The target independently grants the full binding:

[isolated_executor]
enabled = true

[isolated_executor.bindings.alice-docker-001]
execution_id = "alice-docker-001"
authority = "authority-one"
project = "group-a"
principal = "alice"
target = "isolated-target"
account = "worker_alice"
uid = 21001

[isolated_executor.bindings.alice-docker-001.container]
image = "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
program = "vibeqc-release"
source_sha = "cccccccccccccccccccccccccccccccccccccccc"

These are synthetic values for a disposable qualification environment, not live site settings. Leave the profile disabled on production targets until that qualification is complete. The selected target needs a running daemon containing this executor; replacing only the command-line helper cannot advertise support. Build replacement runtimes separately and retain active generations as usual. Configuration reload may retain normal maintenance holds; do not bypass them.

The broker passes an internal vq-isolated envelope through normal keyed submission. It contains the immutable binding and original argv; it is not an installed shell wrapper and must not be substituted with one. Native registry resolution is replaced by the pinned image/source identity, never silently applied a second time to the payload. The requested program/revision must match that image. The original request and image identity stay recorded through replay.

Completion, outputs and retained state

Create intent, full container ID, immutable image and confinement binding are persisted before start. A lost create response reconciles the same container; it never creates a replacement. Changing the current configuration does not replace a running worker. Restart uses its recorded binding and authenticates the same engine/container. Owner cancellation waits for proven worker exit; a successful signal call alone does not release capacity.

The private execution copy is writable by its container UID, inside a 0700 parent inaccessible through other jobs’ mounts. Outputs may themselves have UID-private permissions, so terminal collection uses the engine’s archive API. It publishes only regular files/directories into the original job workspace, ignoring links, devices and reserved _vq metadata, and refusing traversal or symlinked destination directories. Collection is bounded to 1 GiB of archive bytes, 100,000 entries and 60 seconds; this is a collection bound, not a disk quota on the active workspace. Configure site storage limits separately. Input links/special files are refused. Full scientific results must be files; stdout/stderr retain the managed executor’s bounded terminal log tails.

The authority writes its own terminal receipt without exposing engine labels or host mount paths. It removes only the authenticated stopped container after successful publication. A publication failure leaves the same stopped container and reservation for recovery; it does not report completed retrieval. Private execution copies remain retained for operator cleanup after verified terminal collection. Never delete live binding files or workspaces to clear a reservation.

Local evidence and remaining real-target qualification

tests/test_isolated_executor_236.py exercises the actual broker envelope and keyed target intake, Docker create arguments, inspection guards, separate principal workspaces/UIDs, safe filesystem/archive handling, lost-create recovery, restart and cancellation with a controlled engine. Existing managed-container, broker, gateway and daemon tests cover compatibility. These tests make no real container or live target claims.

Before production enablement, qualify on a disposable Linux host with two principal bindings and preloaded, verified images:

  1. Through the gateway/connector/broker path, submit one small job per principal. Verify effective UID/GID, process/mount/network namespaces, cgroup limits, source/image identity and successful checksummed output collection.

  2. From each running workload attempt peer-workspace/result reads, peer-process signals, engine/daemon/admin-socket access, credential reads, writes to the read-only runtime and network connections. Demonstrate denials with positive controls for allowed own-workspace reads/writes. Inspect the actual Docker metadata and kernel enforcement, not only emitted command-line options.

  3. Exercise interrupted submit/create acknowledgements, broker and daemon restart, maintenance holds, cancellation, terminal publication, image loss and policy revocation. Confirm the existing worker identity and idempotency key remain fixed, and unrelated running calculations continue unchanged.

  4. Perform the external non-VPN client pilot: submit, observe and download a verified result without target credentials. Record scientific/runtime qualification separately; source tests are not a science PASS.

The development machine’s local checks do not replace these observations. Keep site endpoints, identities and qualification evidence outside product checkouts. #236 remains open until the relevant real-target and external-client acceptance passes. Browser principal mapping and own-job views are implemented separately under #237; neither browser nor execution access grants the other.

Implementation references: Docker’s container execution options and default seccomp profile.