Skip to content

Commit 1bfeb6b

Browse files
authored
[iris] Consolidate scheduling context and fix SQL cache misses (#5776)
Profile-driven cleanup of the iris-controller scheduling loop. Merges SchedulingTickContext into SchedulingContext and deletes the create_scheduling_context wrapper layers (Controller and Scheduler methods, from_workers classmethod); Controller.last_scheduling_context now backs the dashboard diagnostics RPC. Converts 19 SQL call sites to expanding bindparam to reuse SQLAlchemy compiled statements. Drops zstd encoder level to -1. Consolidates _building_counts into reads.py with shared snapshots.
1 parent 3a8b6b9 commit 1bfeb6b

22 files changed

Lines changed: 842 additions & 1096 deletions

lib/iris/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Archived design docs (implemented, read code instead): `.agents/projects/2026*_i
2525

2626
```bash
2727
# Unit tests (run from lib/iris/)
28-
cd lib/iris && uv run --group dev python -m pytest --tb=short -m 'not slow and not docker and not e2e' tests/
28+
cd lib/iris && uv run --group dev python -m pytest --tb=short -m 'not slow and not docker and not requires_cluster' tests/
2929
```
3030

3131
See `TESTING.md` for the complete testing policy, E2E test commands, and markers.

lib/iris/src/iris/cluster/controller/budget.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from iris.cluster.controller.db import ControllerDB, Tx
2020
from iris.cluster.controller.schema import job_config_table, tasks_table
2121
from iris.cluster.controller.task_state import ACTIVE_TASK_STATES
22+
from iris.cluster.types import UserBudgetDefaults
2223
from iris.rpc import config_pb2, job_pb2
2324

2425
logger = logging.getLogger(__name__)
@@ -36,26 +37,6 @@ class UserTask(Generic[T]):
3637
_ACTIVE_TASK_STATES = tuple(ACTIVE_TASK_STATES)
3738

3839

39-
@dataclass
40-
class UserBudgetDefaults:
41-
"""Budget settings for users without an explicit user_budgets row.
42-
43-
An absent row means "defaults apply" — we no longer stamp a row into the
44-
table at first-submit time, so the scheduler and launch-job guard both
45-
fall back to these values when the lookup misses.
46-
"""
47-
48-
budget_limit: int = 1000
49-
"""Max budget value applied to users without an override row.
50-
51-
A value of 0 means unlimited; any positive value caps accumulated spend
52-
before :func:`compute_effective_band` downgrades INTERACTIVE work to BATCH.
53-
"""
54-
55-
max_band: int = job_pb2.PRIORITY_BAND_INTERACTIVE
56-
"""Default max priority band (proto int) for users without an override row."""
57-
58-
5940
def resource_value(cpu_millicores: int, memory_bytes: int, accelerator_count: int) -> int:
6041
"""Compute a scalar resource value for budget tracking.
6142

0 commit comments

Comments
 (0)