feat(admission): quota + admission plane — completes placement + quotas + admission - #20
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pymax_concurrent,gpu_max,cost_budget) over aDEFAULT_QUOTA.admit()fail-closed: over any budget → denied, naming the exceeded dimensions.charge()/release()accounting; spend is cumulative (not released).ledger_path) — a CLI enforces a real running budget across processes, not a fresh one each invocation.Wired into the spine
executor.run_spinegainsadmission/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 Nenforces the ledger-backed budget (exit 4 on DENIED, prints usage vs quota); newsourceosctl quotashows a subject's quota + usage.Tests
+9 admission (budgets, charge/release, per-subject isolation, ledger persistence across processes, spine integration) = 90 tools tests green;
validatepasses; CLI enforcement verified across invocations. Wired: validate REQUIRED, compute-plane CapD link, ledger gitignored.