Skip to content

Retire namespace resource quotas now that the queue owns the limit - #209

Merged
artempartos merged 1 commit into
developfrom
refactor/retire-namespace-quotas
Sep 5, 2026
Merged

artempartos merged 1 commit into
developfrom
refactor/retire-namespace-quotas

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

Summary

Concurrency used to be a Kubernetes ResourceQuota per scope: an over-capacity launch failed at provisioning with a 403, which is exactly the failure the admission queue replaces with a counted, ordered wait.

Production cut over on 2026-09-05. The quotas were converted into per-scope session limits, the 62 quota objects were deleted from the cluster under a reviewed UID allowlist, and the runtime has not written one since.

What is left is a table nobody reads and an admin form that still accepts edits to it. A knob that governs nothing is worse than no knob, so the model, its table, the admin form and the conversion tooling go.

Why this is a separate change

Neither half could have shipped with the queue itself:

  • DB Migrate runs before the pod rollout. Dropping the table while old pods still read it on every session launch is a window of failed launches, not a clean swap. Production is now fully on code that never touches it.
  • The rows were the input to the conversion. legacy_plan divided each namespace quota into a session count, which is how production carried its existing limits into the queue — so the tooling could not be deleted before it had run. It has.

What stays

session_admission:remove_legacy_quotas. Other deployments still carry real ResourceQuota objects that have to be deleted once, against a reviewed {namespace, uid} allowlist, and that task never needed the database model.

Namespace isolation, NetworkPolicies and per-Pod CPU/memory limits are untouched. The runtime still bootstraps all of them; the assertion that it no longer writes a quota is now pinned by a test.

Type of change

  • Refactor
  • Breaking change

BREAKING CHANGE: namespace_resource_quotas is dropped. Per-scope CPU and memory ceilings are no longer configurable per project or user. Concurrency is the session queue's job, and per-Pod limits still bound a single session's footprint.

How was this tested?

docker compose exec -T web make check_all — green in full.

The runtime's namespace-bootstrap test now asserts create_resource_quota is never called, so a future change that reintroduces quota creation fails rather than silently double-limiting alongside the queue.

Checklist

  • I read CONTRIBUTING.md.
  • All commits are signed off for the DCO.
  • make check_all passes locally.
  • Added/updated tests.
  • Updated documentation.
  • Commits use descriptive messages.

Concurrency used to be a Kubernetes ResourceQuota per scope: an over-capacity
launch failed at provisioning with a 403, which is the failure the admission
queue replaces with a counted, ordered wait.

Production cut over on 2026-09-05. The quotas were converted into per-scope
session limits, the 62 quota objects were deleted from the cluster under a
reviewed UID allowlist, and the runtime has not written one since. What is left
is a table nobody reads and an admin form that still accepts edits to it — a
knob that governs nothing is worse than no knob.

So the model, its table, the admin form and the conversion tooling go. This
could not have shipped with the queue itself, for two reasons that have since
been settled: DB Migrate runs before the pod rollout, so dropping the table
while old pods still read it is a window of failed launches; and the rows were
the input to the conversion, so legacy_plan could not be deleted before it had
run. Both are now behind us.

session_admission:remove_legacy_quotas stays. Other deployments still carry
real ResourceQuota objects that have to be deleted once, and that task never
needed the database model.

BREAKING CHANGE: namespace_resource_quotas is dropped. Per-scope CPU and memory
ceilings are no longer configurable; per-Pod limits and namespace isolation are
unchanged, and concurrency is now the session queue's job.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit a764052 into develop Sep 5, 2026
7 checks passed
aixle-com Bot pushed a commit that referenced this pull request Nov 8, 2026
aixle-com Bot pushed a commit that referenced this pull request Nov 9, 2026
…meral registration's name (task #209, Fix CR round 1)

- RegistrationsController#create: a non-string name reaches Registration.register! as nil
  again, so an ephemeral request answers 422 ephemeral_not_supported, not 500.
- Revert item 7 to the documented pattern: TenantScope.owned(Runner) and
  TenantScope.owns_runner? hold the ownership rule, Runner.visible_for_project is the
  picker scope; Runner.of_tenant and #of_tenant? are removed.
- Docs: drop the Runner exception, reword the no-IO validation bullet.

Signed-off-by: Aixle Flow <[email protected]>
NOX73 added a commit that referenced this pull request Nov 9, 2026
… (task #209) (#670)

* refactor(runners): typed long-poll messages, gateway request schemas, config rules in ConfigSchema, action-only runner policies, one tenant rule (task #209)

- Runners::Operations: the runner_env_<id> channel carries typed JSON
  messages (op_enqueued, poll_waiting); the poll: prefix goes.
- Gateway request bodies and the long-poll query are checked against JSON
  Schemas in runner/protocol/schemas/v1/ through Runners::ProtocolSchema.
- ManualAdapter's config rules move to Runners::ConfigSchema as pure
  functions; Runner's validation calls only ConfigSchema, and only when
  config or runner_type changes. Runners::Save saves with a plain save.
- Runner policies authorize the action only; the controllers' lookup decides
  which runner a request may touch. RunnerManagement goes; Runners::Form
  holds the shared form pieces.
- Runner.of_tenant / Runner#of_tenant? hold the tenant rule; TenantScope,
  visible_for_project and RunnerReference#owned_runner call them.
  TenantScope.owns_runner? goes.

Signed-off-by: Aixle Flow <[email protected]>

* refactor(runners): keep the tenant rule in TenantScope, guard an ephemeral registration's name (task #209, Fix CR round 1)

- RegistrationsController#create: a non-string name reaches Registration.register! as nil
  again, so an ephemeral request answers 422 ephemeral_not_supported, not 500.
- Revert item 7 to the documented pattern: TenantScope.owned(Runner) and
  TenantScope.owns_runner? hold the ownership rule, Runner.visible_for_project is the
  picker scope; Runner.of_tenant and #of_tenant? are removed.
- Docs: drop the Runner exception, reword the no-IO validation bullet.

Signed-off-by: Aixle Flow <[email protected]>

---------

Signed-off-by: Aixle Flow <[email protected]>
Co-authored-by: Aixle Flow <[email protected]>
aixle-com Bot pushed a commit that referenced this pull request Nov 10, 2026
Conflicts resolved:
- Files touched on staging only by the pre-squash branches of task #209 (PR #669)
  and task #211 (PRs #667/#668) take develop's version, which carries the
  reviewed, merged form of the same work (#670, #671, #672).
- test/integration/web/company/billing_test.rb: keeps the billing redesign's
  (#646) test body with develop's 14-day trial values (#678).
- CHANGELOG.md: develop's 1.11.0 entry for the 14-day trial; the billing
  redesign entry already present above is kept once.

Signed-off-by: Alex <[email protected]>
aixle-com Bot pushed a commit that referenced this pull request Nov 10, 2026
…ner?)

The develop merge into staging (1176114) took develop's runner_test.rb but
kept the stale pre-squash #209 versions of tenant_scope.rb,
runner_reference.rb and runner.rb, which had no TenantScope.owns_runner?.
Restore develop's versions of the three files.

Signed-off-by: Alex <[email protected]>
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