Repository navigation
[Bugfix][Router] Accept single-label static backend URLs - #1154
spicysharkco wants to merge 1 commit into
Conversation
Carry vllm-project#737 forward with guarded single-label hostnames and remove the redundant localhost alternative. Preserve existing multi-label inputs. Cover URL validation and static backend filtering in the utility tests. Co-authored-by: Abdullah AlOsaimi <abdullah@osaimi.dev> Co-authored-by: Rui Zhang <51696593+ruizhang0101@users.noreply.github.com> Signed-off-by: spicysharkco <321699413+spicysharkco@users.noreply.github.com>
There was a problem hiding this comment.
Code Review
This pull request updates the URL validation regex in src/vllm_router/utils.py to support single-label hostnames (ensuring they do not start or end with a hyphen) and removes the explicit localhost match since it is covered by the new pattern. It also adds comprehensive unit tests in src/tests/test_utils.py to verify this behavior. There are no review comments, so I have no feedback to provide.
|
Thanks for picking this up. We run the router with single-label backend names ( @ruizhang0101 the workflow runs here currently show |
|
#737 is closed in favor of this pr. |
…laybook Point the single-label hostname patch at upstream PR vllm-project#1154, which superseded the now-closed vllm-project#737. Record that the DNS resolver change is proposed upstream for the shared client only (vllm-project#1161/vllm-project#1162), and that upstream vllm-project#1164's 503 must not replace the fork's documented 502 envelope on a refresh. Add the evidence-based playbook for getting fixes merged upstream. Docs only; does not trigger an image release. Standard pre-commit hooks pass on the changed files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A5cnah4yC2sS7LEZ8mdrTd Signed-off-by: ci-sim <ci@sim>
This carries #737 by @osaimi forward. #737's current head, with the update from @ruizhang0101, already has the hyphen guard the automated review asked for. Its first commit has no sign-off, so the DCO check there still fails. This PR adds the tests and a signed-off commit, and drops the
localhostalternative that the single-label pattern already covers. Happy to close it if you prefer to update #737 instead.With
--static-backends http://oss-20b:8000, the router logsSkipping invalid URL: http://oss-20b:8000and drops the backend.validate_url()accepts dotted domains,localhost, and IPv4, but no other single-label host (src/vllm_router/utils.py:173-175). The new pattern accepts service names with ports or paths, including underscores, and rejects a leading or trailing hyphen on single-label hosts.localhoststill matches it. Multi-label hosts keep the current pattern, so every URL main accepts today is still accepted. IPv6 validation is outside this change.Startup and dynamic configuration both go through
parse_static_urls()(src/vllm_router/app.py:202,src/vllm_router/dynamic_config.py:178). YAML and Helm pass backend strings to it; service discovery adds no second URL-format check.Run from the repository root with router and test dependencies installed:
PYTHONPATH=src python -m pytest src/tests/test_utils.py -k 'validate_url or parse_static_urls' -q PYTHONPATH=src python -m pytest src/tests/test_utils.py src/tests/test_parser.py src/tests/test_static_service_discovery.py -q pre-commit run --files src/vllm_router/utils.py src/tests/test_utils.py5 failed, 14 passed, 12 deselected.19 passed, 12 deselected; related suite:56 passed.git diff --checkis clean.Overlap checked: open and closed PRs and issues for
validate_url,"single-label","Skipping invalid URL","static-backends" hostname,"docker compose" hostname, and"invalid URL". Only #737 addresses this bug. Main has no later fix, and there are no maintained release branches.Not tested: deployed inference, end-to-end routing, or Helm functionality.
Related issues: N/A; this follows #737.
[Bugfix][Router]prefixes.