Skip to content

[skyrl-train] IPv6-safe HTTP URLs and bind hosts for inference servers - #2158

Draft
anuragprat1k wants to merge 2 commits into
NovaSky-AI:mainfrom
anuragprat1k:ipv6-inference-servers-main
Draft

[skyrl-train] IPv6-safe HTTP URLs and bind hosts for inference servers#2158
anuragprat1k wants to merge 2 commits into
NovaSky-AI:mainfrom
anuragprat1k:ipv6-inference-servers-main

Conversation

@anuragprat1k

@anuragprat1k anuragprat1k commented Sep 4, 2026

Copy link
Copy Markdown

Summary

On IPv6-only clusters (e.g. EKS with IPv6 pod networking) ray.util.get_node_ip_address() returns a bare IPv6 literal. The inference-server stack builds HTTP URLs as f"http://{ip}:{port}", which for 2602:fb33::5 and port 8100 yields http://2602:fb33::5:8100; httpx rejects it:

httpx.InvalidURL: Invalid port: 'fb33:0:11:fc4e::5:8100'

raised from VLLMServerActor.start()'s health poll, so every run on such a cluster dies at inference-engine startup. The same pattern exists in ServerInfo.url, the vllm-router URL and the metrics scraper; the servers/router also bind on 0.0.0.0, which is not reachable over IPv6.

This adds two helpers to inference_servers/common.py and uses them at every site:

  • format_http_url(host, port, path="") brackets IPv6 hosts per RFC 3986 (http://[2602:fb33::5]:8100/health); IPv4 and hostnames are unchanged.
  • default_bind_host(node_ip) returns "::" when the node IP is IPv6, "0.0.0.0" otherwise, used for the vLLM server --host default and the router bind host.

Behaviour on IPv4 clusters is unchanged (same strings as before). Companion to #612, which fixed the tcp:// rendezvous URLs.

Test plan

  • python -m py_compile on the five touched files against main; ruff / black clean at the repo's pinned versions.
  • Unit check of the helpers: format_http_url("10.0.0.5", 8100) == http://10.0.0.5:8100; format_http_url("2602:fb33::5", 8100, "/health") == http://[2602:fb33::5]:8100/health; default_bind_host("2602:fb33::5") == ::.
  • End-to-end GRPO smoke (Qwen3.5-0.8B, Megatron TP2/CP2, colocated, 1 node) on an IPv6-only EKS cluster (AWS p5, EFA) with this patch applied on top of skyrl-v0.3.0: vLLM server start, health poll and router come up on the 2602:fb33:... pod addresses and the first training step completes. The unpatched tag fails at the same point with the httpx.InvalidURL above.
  • Unit tests added in tests/backends/skyrl_train/inference_servers/test_common.py (TestIPv6SafeAddressing, 12 cases); pytest tests/backends/skyrl_train/inference_servers/ -m "not vllm" passes (147 tests).
  • Same smoke on an IPv4 GKE cluster passes with the unpatched tag (confirming the failure is IPv6-specific).

anuragprat1k and others added 2 commits September 4, 2026 21:14
On IPv6-only clusters ray.util.get_node_ip_address() returns a bare IPv6
literal; f"http://{ip}:{port}" then yields e.g. http://2602:fb33::5:8100,
which httpx rejects (InvalidURL: Invalid port) in VLLMServerActor's health
poll, ServerInfo.url, the router URL and the metrics scraper. Add
format_http_url() (brackets IPv6 per RFC 3986) and default_bind_host() ('::'
on IPv6 nodes, '0.0.0.0' otherwise) in inference_servers/common.py and use
them at every site. Companion to NovaSky-AI#612, which fixed the tcp:// rendezvous URLs
in the older code path.
…nit tests

`uvx ruff@0.11.9 check` (the pinned version used by the SkyRL-CPU lint job
and the pre-commit hook) flagged I001 in the five files touched by the IPv6
change: the new imports were not isort-ordered. Apply `ruff --fix` output
only; no behaviour change.

Add unit tests for is_ipv6_address(), format_http_url(), default_bind_host()
and ServerInfo.url alongside the existing inference_servers/common tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@SumanthRH SumanthRH self-assigned this Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants