refactor(dash_sc/proxy): switch forward addr config to SERVICE_ROUTE#1069
Open
sunmiaozju wants to merge 1 commit into
Open
refactor(dash_sc/proxy): switch forward addr config to SERVICE_ROUTE#1069sunmiaozju wants to merge 1 commit into
sunmiaozju wants to merge 1 commit into
Conversation
jianglan89
reviewed
Jun 5, 2026
1c4ec5e to
8bc3560
Compare
Collaborator
AI Code Review - PR #1069Status: BLOCKING Summary: P0/1 · P1/2 · P2/2 · P3/1 Blocking IssuesP0
P1
Non-blocking SuggestionsP2
P3
Checklist Violations (7 fail / 63 total)General Principles Checklist
RTP-LLM Checklist
Python Static-First Checklist
Strengths
|
Replaces the env-only `DASH_SC_GRPC_FORWARD_ADDR` (single string /
comma-list / JSON array of ip:port) with a typed `SERVICE_ROUTE` JSON
object that names the discovery mechanism explicitly:
{"type": "ip_port_list", "address": "10.0.0.1:8096;10.0.0.2:8096"}
{"type": "vipserver", "address": "com.example.svc"}
For compatibility, when `SERVICE_ROUTE` is unset the proxy still parses
legacy `DASH_SC_GRPC_FORWARD_ADDR` and converts it to an `ip_port_list`
route. `SERVICE_ROUTE` wins when both env vars are set.
Configured `ip:port` values are HTTP endpoints. Runtime discovery returns a
`BackendAddr` with `ip`, `http_port`, and `grpc_port`, where `grpc_port` is
`http_port + 8`. The proxy uses the resulting gRPC target for
`GrpcHostChannelPool` lookup; vipserver results follow the same conversion.
`vipserver` is resolved per request via `rtp_llm.vipserver.vip_client`
(lazy import so non-vipserver deployments don't pay for the global
HostReactor refresh thread). Resolver failures are logged and surfaced to
the proxy as an unavailable backend instead of being swallowed silently.
`SERVICE_ROUTE` only describes proxy backend routing. `DashScApp` enters
proxy mode when `DASH_SC_GRPC_PROXY_MODE=1`; for compatibility, a non-empty
legacy `DASH_SC_GRPC_FORWARD_ADDR` also still enables proxy mode.
Aone Req: https://aone.alibaba-inc.com/req/82761547
8bc3560 to
4c61436
Compare
Collaborator
AI Code Review - PR #1069Status: BLOCKING Summary: P0/0 · P1/2 · P2/2 · P3/0 Blocking IssuesP1
Non-blocking SuggestionsP2
Checklist Violations (10 fail / 73 total)General Principles Checklist
RTP-LLM Checklist
Python Static-First Checklist
Strengths
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SERVICE_ROUTEJSON object config withip_port_listandvipserver.DASH_SC_GRPC_FORWARD_ADDRintoip_port_listwhenSERVICE_ROUTEis unset.ip:portand vipserver ports as HTTP endpoints, resolve them intoBackendAddr(ip, http_port, grpc_port), and usehttp_port + 8as the gRPC target forGrpcHostChannelPool.DASH_SC_GRPC_PROXY_MODE=1, while preserving the legacyDASH_SC_GRPC_FORWARD_ADDRproxy-mode trigger.Testing
git diff --checkpython -B -m py_compile rtp_llm/dash_sc/proxy/__main__.py rtp_llm/dash_sc/proxy/service_route.py rtp_llm/dash_sc/proxy/service_route_config.py rtp_llm/dash_sc/test/proxy/servicer_test.pypython -B -m unittest rtp_llm.dash_sc.test.proxy.servicer_test.ServiceRouteConfigTestwas attempted but the local Python environment is missingtorch.