Fix Triton failing to start: move its HTTP port off Ray Serve's 8000 - #218
Merged
Conversation
Deploying hit:
failed to start HTTP service: Unavailable -
Socket '0.0.0.0:8000' already in use
The Ray and Triton containers share the pod's network namespace, and Ray
Serve's HTTP proxy binds 8000 on every node. Serve's proxy is the one that
has to keep it: KubeRay gives RayService worker pods a readiness probe that
wgets the proxy's health path on the container port named `serve` (default
8000, ray-operator/controllers/ray/common/pod.go). So Triton moves to 8100
via --http-port; its gRPC stays on 8001, which is what the forwarder dials.
Both are chart values now (triton.httpPort, triton.grpcPort) rather than
numbers baked into the pod template, and the chart refuses to render if
either collides with a port Ray binds (8000, 9000, 8080), if they disagree
with the --http-port / --grpc-port in triton.args, or if the args leave
Triton on its default 8000. The Ray containers are handed TRITON_GRPC
explicitly instead of relying on the forwarder's fallback.
Tests: the worker pod declares no port twice, Serve keeps 8000, the args
name the same ports as the values, and the forwarder is told where to dial.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
What
Triton cannot start in the pods #212 deploys:
This commit was written while #212 was in review but landed on the branch after it was merged, so it missed
main. Everything else from that PR is already in.Why it happens
The Ray and Triton containers share the pod's network namespace, and Ray Serve's HTTP proxy binds 8000 on every node, workers included. Triton's default HTTP port is the same 8000, so it loses the race and exits.
Serve's proxy is the one that has to keep 8000. KubeRay gives RayService worker pods a readiness probe that wgets the proxy's health path on the container port named
serve, defaulting to 8000 (ray-operator/controllers/ray/common/pod.go). Move Serve and the pods never go ready. So Triton moves instead.The fix
--http-port=8100. Triton's gRPC stays on 8001, which is what the forwarder dials, and its metrics stay on 8002.So it cannot drift again, both Triton ports are chart values (
triton.httpPort,triton.grpcPort) instead of numbers written into the pod template, and the chart refuses to render if either collides with a port Ray binds, if they disagree with the--http-port/--grpc-portintriton.args, or if the args leave Triton on 8000. The Ray containers are handedTRITON_GRPCexplicitly rather than relying on the forwarder's fallback default.The probes needed no change: they address the port by name.
Tests
tests/manifests/test_ray.pygains the bug class itself — no two containers in the worker pod may declare the same port — plus: Serve keeps 8000, Triton's HTTP is not 8000, the args name the same ports as the values, and the forwarder is told where to dial. Three new refusal cases cover the chart's new failures.Also checked, no change needed
SLOW_STARTUP_WARNING_S); nothing kills it. The forwarder waiting up to fifteen minutes for Triton to load models from a cold CVMFS cache is safe.Verified
pytest tests970 passing,validate-manifests.shgreen, chart renders, ruff (0.16.6, matching the pinned hook) and prettier clean. Not deployed from here.One thing for whoever debugs inside a pod after this:
curl localhost:8000now reaches Ray's proxy, and Triton's HTTP is at 8100.🤖 Generated with Claude Code