mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
refactor(make): stop queueing bootstrap for a machine-wide gate slot
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
8e588cec8c
commit
c9697cbce5
3 changed files with 6 additions and 7 deletions
|
|
@ -53,7 +53,7 @@ When you fix violations gated by `ruff-strict-budget.json`, `type-discipline-bud
|
|||
|
||||
`make check` (f.k.a. `make pre-commit`, which still works identically as an alias) saves its complete output to a log file in .git (overwriting previous logs) and prints that path as its first and last output lines. To inspect a run, read or grep that log instead of re-running the multi-minute checks just to see a different slice
|
||||
|
||||
`make check`, `make lint`, `make bootstrap`, `scripts/pre_commit_lint.sh`, and the standalone budget gates (`scripts/ruff_strict_gate.py`, `scripts/type_discipline_gate.py`, `scripts/type_check_gate.py`) each hold one of `LITELLM_GATE_SLOTS` machine-wide slots (default 2, see `scripts/gate_slot_lock.py`), so when other sessions or worktrees on the same box are already running heavy work, yours prints "all N machine-wide slots are busy; queueing" and then stays quiet until a slot frees. Queueing is expected, so give the command a long timeout and let it wait rather than killing it, retrying it, or assuming it hung. Don't defeat the queue by setting `LITELLM_GATE_SLOTS=0` or raising the slot count, and don't fan heavy targets out into parallel shells, since they'd only queue behind each other anyway. Prefer top-level `make check` / `make lint` over `check-inner` / `lint-inner`: the inner targets are still slot-aware, but they take a slot per nested gate over the run instead of one slot for the whole thing
|
||||
`make check`, `make lint`, `scripts/pre_commit_lint.sh`, and the standalone budget gates (`scripts/ruff_strict_gate.py`, `scripts/type_discipline_gate.py`, `scripts/type_check_gate.py`) each hold one of `LITELLM_GATE_SLOTS` machine-wide slots (default 2, see `scripts/gate_slot_lock.py`), so when other sessions or worktrees on the same box are already running heavy work, yours prints "all N machine-wide slots are busy; queueing" and then stays quiet until a slot frees. Queueing is expected, so give the command a long timeout and let it wait rather than killing it, retrying it, or assuming it hung. Don't defeat the queue by setting `LITELLM_GATE_SLOTS=0` or raising the slot count, and don't fan heavy targets out into parallel shells, since they'd only queue behind each other anyway. Prefer top-level `make check` / `make lint` over `check-inner` / `lint-inner`: the inner targets are still slot-aware, but they take a slot per nested gate over the run instead of one slot for the whole thing
|
||||
|
||||
If you're trying to create a new function that relies on untyped stuff, instead of adding more Any's and pushing `reportAny` / `reportExplicitAny` closer to their basedpyright ceilings, just validate it in the caller with Pydantic (a model or `TypeAdapter` that returns the typed thing or raises will do) and then pass the now typed variable in
|
||||
|
||||
|
|
|
|||
9
Makefile
9
Makefile
|
|
@ -9,7 +9,7 @@
|
|||
lint-ruff-budget lint-ruff-budget-update lint-budget-update lint-gate \
|
||||
install-dev install-proxy-dev install-test-deps install-hooks \
|
||||
install-helm-unittest check-circular-imports check-import-safety check check-inner pre-commit \
|
||||
lint-install lint-fetch-base bootstrap bootstrap-inner
|
||||
lint-install lint-fetch-base bootstrap
|
||||
|
||||
# Default target
|
||||
help:
|
||||
|
|
@ -53,7 +53,7 @@ help:
|
|||
@echo " make test-integration - Run integration tests"
|
||||
@echo " make test-unit-helm - Run helm unit tests"
|
||||
@echo ""
|
||||
@echo "Heavy targets (check, bootstrap, lint) queue for LITELLM_GATE_SLOTS machine-wide"
|
||||
@echo "Heavy targets (check, lint) queue for LITELLM_GATE_SLOTS machine-wide"
|
||||
@echo "slots (default 2; 0 disables) so parallel sessions don't thrash one machine."
|
||||
|
||||
UV := uv
|
||||
|
|
@ -80,10 +80,9 @@ info:
|
|||
install-dev:
|
||||
$(UV) sync --inexact --frozen
|
||||
|
||||
# Deliberately unqueued: provisioning is I/O bound, so it doesn't need one of the
|
||||
# machine-wide slots the CPU-bound gates below share.
|
||||
bootstrap:
|
||||
@$(GATE_SLOT_LOCK) $(MAKE) bootstrap-inner
|
||||
|
||||
bootstrap-inner:
|
||||
$(UV) sync --inexact --frozen --extra proxy --group proxy-dev --group e2e-dev
|
||||
$(UV_RUN) python scripts/prisma_generate_if_needed.py
|
||||
cd ui/litellm-dashboard && ../../scripts/with_dashboard_node.sh npm install --no-audit --no-fund
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Machine-wide slot lock for this repo's heavy entrypoints.
|
||||
|
||||
`make check`, `make bootstrap`, `make lint`, and the standalone budget gates
|
||||
`make check`, `make lint`, and the standalone budget gates
|
||||
(scripts/ruff_strict_gate.py, scripts/type_discipline_gate.py,
|
||||
scripts/type_check_gate.py) each hold one of N machine-wide slots while they
|
||||
run, so however many sessions and worktrees share one machine, at most N of
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue