1919from iris .cluster .controller .db import ControllerDB , Tx
2020from iris .cluster .controller .schema import job_config_table , tasks_table
2121from iris .cluster .controller .task_state import ACTIVE_TASK_STATES
22+ from iris .cluster .types import UserBudgetDefaults
2223from iris .rpc import config_pb2 , job_pb2
2324
2425logger = 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-
5940def 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