Skip to content

feat(admission): quota + admission plane — completes placement + quotas + admission - #20

Merged
mdheller merged 1 commit into
mainfrom
feat/quota-admission
Aug 4, 2026
Merged

feat(admission): quota + admission plane — completes placement + quotas + admission#20
mdheller merged 1 commit into
mainfrom
feat/quota-admission

Conversation

@mdheller

@mdheller mdheller commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What

place() decided where a workload runs; admission decides whether a subject may run it right now, under per-account/per-project budgets — the multi-tenant, cost-governance third of the cloud-shell fog spec's Control-Plane Agent (placement + quotas + admission). Without it, the plane would happily schedule infinite workloads; that's not a production platform.

tools/admission.py

  • Per-subject quotas (max_concurrent, gpu_max, cost_budget) over a DEFAULT_QUOTA.
  • admit() fail-closed: over any budget → denied, naming the exceeded dimensions.
  • charge() / release() accounting; spend is cumulative (not released).
  • File-backed ledger (ledger_path) — a CLI enforces a real running budget across processes, not a fresh one each invocation.

Wired into the spine

executor.run_spine gains admission/admission_key/cost; the check runs before the Grant is minted, so an over-quota subject never receives a capability (status: denied, nothing placed/granted/dispatched).

CLI

sourceosctl run --cost N enforces the ledger-backed budget (exit 4 on DENIED, prints usage vs quota); new sourceosctl quota shows a subject's quota + usage.

run #1 (gpu) → ran … quota usage: {gpu: 1}
run #2 (gpu) → ran … quota usage: {gpu: 2}
run #3 (gpu) → DENIED (fail-closed): quota exceeded: gpu_max

Tests

+9 admission (budgets, charge/release, per-subject isolation, ledger persistence across processes, spine integration) = 90 tools tests green; validate passes; CLI enforcement verified across invocations. Wired: validate REQUIRED, compute-plane CapD link, ledger gitignored.

…e Agent

place() decided WHERE; admission decides WHETHER a subject may run right now, under
per-account/per-project budgets — the multi-tenant, cost-governance third of the
Control-Plane Agent (placement + quotas + admission).

tools/admission.py — AdmissionController:
  - per-subject quotas (max_concurrent, gpu_max, cost_budget) over a DEFAULT_QUOTA.
  - admit() fail-closed: over any budget -> denied, with the exceeded dimensions named.
  - charge()/release() consumption accounting; spend is cumulative (not released).
  - file-backed ledger (ledger_path) so a CLI enforces a REAL running budget across
    processes, not a fresh one each invocation.

Wired into the spine: executor.run_spine gains admission/admission_key/cost; the check
runs BEFORE the Grant is minted, so an over-quota subject never receives a capability
(status "denied", nothing placed/granted/dispatched).

sourceosctl: `run --cost N` enforces the ledger-backed budget (exit 4 on DENIED, prints
usage vs quota); new `quota` subcommand shows a subject's quota + usage. Verified across
invocations: two GPU runs, third DENIED at gpu_max, fail-closed.

Tests: +9 admission (budgets, charge/release, isolation, ledger persistence, spine
integration) = 90 tools tests green. Wired validate REQUIRED, compute-plane CapD link,
ledger gitignored.
@mdheller
mdheller merged commit 2d1b366 into main Aug 4, 2026
1 check passed
@mdheller
mdheller deleted the feat/quota-admission branch August 4, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant