Skip to content

Commit 3147597

Browse files
committed
ci: patch vllm metrics route discovery
Signed-off-by: Sumanth Kamenani <skamenan@redhat.com>
1 parent 36da067 commit 3147597

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/actions/setup-vllm-gpu/action.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,31 @@ runs:
9595
python -c "import torch; print(f'CUDA device count: {torch.cuda.device_count()}')"
9696
vllm --version
9797
98+
- name: Patch vLLM metrics route discovery
99+
shell: bash
100+
run: |
101+
source /tmp/vllm-env/bin/activate
102+
103+
python - <<'PY'
104+
from __future__ import annotations
105+
106+
from pathlib import Path
107+
import prometheus_fastapi_instrumentator.routing as routing
108+
109+
routing_path = Path(routing.__file__)
110+
source = routing_path.read_text()
111+
old = "route_name = route.path"
112+
new = (
113+
"route_name = getattr(route, 'path', None)\n"
114+
" if route_name is None:\n"
115+
" continue"
116+
)
117+
if old not in source:
118+
raise SystemExit(f"Expected route.path assignment not found in {routing_path}")
119+
routing_path.write_text(source.replace(old, new, 1))
120+
print(f"Patched {routing_path}")
121+
PY
122+
98123
- name: Resolve model identifier
99124
shell: bash
100125
env:

0 commit comments

Comments
 (0)