Repository navigation
Conversation
Kubernetes renders one engine command per pool, bound to 0.0.0.0, so an engine cannot name its own address in the output store's local_hostname, and startup rejected --sglang-output-store-backend there. HostAndPort gains an optional peer_host, the host the run's other workers reach a worker on, beside external_host; host_for_peers falls back to the placed host. The Kubernetes launch context sets $(MILES_POD_IP) for every non-master port, and the chart fills MILES_POD_IP from status.podIP on every pool pod and reserves the name. The inference spec passes the peer host to compute_engine_launch_cmd, and the engine uses it as local_hostname; Ray leaves it unset, so the engine's host is used as before. The launcher also rewrites args.mooncake_store_init_kwargs to the in-cluster master before compute_specs, as it already did for the pods' argv, so the rendered engine and session-server commands reach the same master. Startup no longer rejects --cluster-backend kubernetes; the chart schemas and snapshot are regenerated.
guapisolo
requested review from
Shi-Dong,
Zhichenzzz,
fzyzcjy,
jybsuper,
maocheng23,
yueming-yuan and
yushengsu-thu
as code owners
October 16, 2026 21:27
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
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
Run SGLang's Mooncake output store under the Kubernetes backend.
Motivation
Under
--cluster-backend kubernetesstartup rejects--sglang-output-store-backend: Kubernetes renders one command per pool and binds every engine to0.0.0.0, so no engine can name the address its Mooncake peers reach it at, and the rendered engine and session-server commands still carry the master address from before the launcher's in-cluster rewrite. Kubernetes runs therefore keep returning replay outputs inline.Usage
Design Notes
0.0.0.0andpeer_host$(MILES_POD_IP);inference.pyhandshost_for_peerstocompute_engine_launch_cmd, which writes it into the engine's extra config aslocal_hostname; kubelet expands the variable from the env the chart fills fromstatus.podIP. Ray leavespeer_hostunset, so its engines keep their own host.peer_hostsits besideexternal_hostonHostAndPort, sosglang_engine.pystays backend-agnostic, astest_platform_contract.pyrequires._compute_train_argvrewritesargs.mooncake_store_init_kwargsto the in-cluster master beforecompute_specs, as it already did for the pods' argv.MILES_POD_IPis platform-owned, so a run's own env cannot override it.Verification
tests/fastat this head on a Mac under CPU CI's requirements plus [Feat] RL: Add radix transfer plugins sgl-project/sglang#42647 (backends/sglang_utils,utils/external_utils,utils/test_arguments.py,ray/specs,utils/workers/real_ray,charts/miles_run/test_colocate.py,tools/kubernetes,test_platform_contract.py, session and router): 3476 passed; onlytest_session_server_benchmark.pyfails, locally, for want of Linuxprctl.test_pool_entry.py: a rendered engine command binds0.0.0.0and names$(MILES_POD_IP)as its peer host;test_compute_server_args.py: a bind-all engine takes its peer host aslocal_hostname.Review Focus
pool_entry._launch_context: every non-master port gets the pod IP as its peer host.local_hostnameover RDMA in the pod network.