Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion container/Dockerfile.sglang
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ USER root
RUN chmod 755 /opt/dynamo/.launch_screen && \
echo 'source /opt/dynamo/venv/bin/activate' >> /etc/bash.bashrc && \
echo 'cat /opt/dynamo/.launch_screen' >> /etc/bash.bashrc

ENV DYN_REQUEST_PLANE=tcp
USER dynamo

# Copy tests, benchmarks, deploy and components for CI with correct ownership
Expand Down
2 changes: 1 addition & 1 deletion container/Dockerfile.trtllm
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ USER root
RUN chmod 755 /opt/dynamo/.launch_screen && \
echo 'source /opt/dynamo/venv/bin/activate' >> /etc/bash.bashrc && \
echo 'cat /opt/dynamo/.launch_screen' >> /etc/bash.bashrc

ENV DYN_REQUEST_PLANE=tcp
USER dynamo

ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"]
Expand Down
2 changes: 1 addition & 1 deletion container/Dockerfile.vllm
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ USER root
RUN chmod 755 /opt/dynamo/.launch_screen && \
echo 'source /opt/dynamo/venv/bin/activate' >> /etc/bash.bashrc && \
echo 'cat /opt/dynamo/.launch_screen' >> /etc/bash.bashrc

ENV DYN_REQUEST_PLANE=tcp
USER dynamo

ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"]
Expand Down
1 change: 1 addition & 0 deletions examples/backends/vllm/launch/agg_request_planes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ echo "Using request plane mode: $REQUEST_PLANE"
python -m dynamo.frontend --http-port=8000 &

DYN_SYSTEM_PORT=8081 \
DYN_HEALTH_CHECK_ENABLED=true \
python -m dynamo.vllm --model Qwen/Qwen3-0.6B --enforce-eager --connector none
49 changes: 11 additions & 38 deletions lib/runtime/src/component/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,7 @@ impl EndpointConfigBuilder {
// Register health check target in SystemHealth if provided
if let Some(health_check_payload) = &health_check_payload {
// Build transport based on request plane mode
let transport = build_transport_type(
request_plane_mode,
&endpoint_name,
&subject,
TransportContext::HealthCheck,
);
let transport = build_transport_type(request_plane_mode, &endpoint_name, &subject);

let instance = Instance {
component: component_name.clone(),
Expand Down Expand Up @@ -244,12 +239,7 @@ impl EndpointConfigBuilder {
let discovery = endpoint.drt().discovery();

// Build transport for discovery service based on request plane mode
let transport = build_transport_type(
request_plane_mode,
&endpoint_name,
&subject,
TransportContext::Discovery,
);
let transport = build_transport_type(request_plane_mode, &endpoint_name, &subject);

let discovery_spec = crate::discovery::DiscoverySpec::Endpoint {
namespace: namespace_name.clone(),
Expand Down Expand Up @@ -277,31 +267,21 @@ impl EndpointConfigBuilder {
}
}

/// Context for building transport type - determines port and formatting differences
enum TransportContext {
/// For health check targets
HealthCheck,
/// For discovery service registration
Discovery,
}

/// Build transport type based on request plane mode and context
/// Build transport type based on request plane mode
///
/// This unified function handles both health check and discovery transport building,
/// with context-specific differences:
/// - HTTP: Both use the same port (default 8888, configurable via DYN_HTTP_RPC_PORT)
/// - TCP: Health check omits endpoint suffix, discovery includes it for routing
/// - NATS: Identical for both contexts
/// This function handles both health check and discovery transport building.
/// All transport modes use consistent addressing:
/// - HTTP: Uses full URL path including endpoint name (e.g., http://host:port/v1/rpc/endpoint_name)
/// - TCP: Includes endpoint name for routing (e.g., host:port/endpoint_name)
/// - NATS: Uses subject-based addressing (unique per endpoint)
fn build_transport_type(
mode: RequestPlaneMode,
endpoint_name: &str,
subject: &str,
context: TransportContext,
) -> TransportType {
match mode {
RequestPlaneMode::Http => {
let http_host = crate::utils::get_http_rpc_host_from_env();
// Both health check and discovery use the same port (8888) where the HTTP server binds
let http_port = std::env::var("DYN_HTTP_RPC_PORT")
.ok()
.and_then(|p| p.parse::<u16>().ok())
Expand All @@ -323,16 +303,9 @@ fn build_transport_type(
.and_then(|p| p.parse::<u16>().ok())
.unwrap_or(9999);

let tcp_endpoint = match context {
TransportContext::HealthCheck => {
// Health check uses simple host:port format
format!("{}:{}", tcp_host, tcp_port)
}
TransportContext::Discovery => {
// Discovery includes endpoint name for routing
format!("{}:{}/{}", tcp_host, tcp_port, endpoint_name)
}
};
// Include endpoint name for proper TCP routing
// TCP client parses this format and adds x-endpoint-path header for server-side routing
let tcp_endpoint = format!("{}:{}/{}", tcp_host, tcp_port, endpoint_name);

TransportType::Tcp(tcp_endpoint)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def metric_pattern(name):
name=f"{prefix}_*",
pattern=lambda name: rf"^{prefix}_\w+",
validator=lambda value: len(set(value))
>= 23, # 80% of typical ~29 metrics (excluding _bucket) as of 2025-10-22 (but will grow)
>= 17, # 80% of typical ~29 metrics (excluding _bucket) as of 2025-10-22 (but will grow)
error_msg=lambda name, value: f"Expected at least 23 unique {prefix}_* metrics, but found only {len(set(value))}",
success_msg=lambda name, value: f"SUCCESS: Found {len(set(value))} unique {prefix}_* metrics (minimum required: 23)",
multiline=True,
Expand Down
Loading