Skip to content

Conversation

@keivenchang
Copy link
Contributor

@keivenchang keivenchang commented Nov 22, 2025

Overview:

Adds environment variable support for dynamic port configuration in preparation for parallel testing. Removes hardcoded --http-port=8000 flags from launch scripts, allowing frontend and workers to use configurable ports via environment variables while maintaining backward compatibility with CLI flags and default values.

Details:

  • Frontend now accepts either --http-port CLI flag or DYN_HTTP_PORT env var (defaults to 8000)
  • Worker ports use fallback syntax: DYN_SYSTEM_PORT=${DYN_SYSTEM_PORT:-8081}
  • Multi-worker scenarios support distinct env vars (DYN_SYSTEM_PORT_PREFILL, DYN_SYSTEM_PORT_DECODE, DYN_SYSTEM_PORT_WORKER1, etc.)
  • Updated 40 launch scripts across vllm, sglang, and trtllm backends
  • Backward compatible: explicit CLI flags and default values still work

Where should the reviewer start?

  • Review comments in launch scripts: examples/backends/vllm/launch/agg.sh (typical single-worker pattern)
  • Multi-worker port handling: examples/backends/sglang/launch/agg_router.sh (2 workers)

Related Issues:

Relates to DIS-1022

/coderabbit profile chill

@keivenchang keivenchang self-assigned this Nov 22, 2025
@github-actions github-actions bot added the feat label Nov 22, 2025
@keivenchang keivenchang changed the title feat: add environment variable support for dynamic port configuration… feat: add environment variable support for dynamic port (part 1), in preparation for parallel testing Nov 22, 2025
@keivenchang keivenchang changed the title feat: add environment variable support for dynamic port (part 1), in preparation for parallel testing feat: allow dynamic port in scripts in preparation for parallel testing (part 1) Nov 22, 2025
… (part 1)

Remove hardcoded --http-port=8000 flags from launch scripts. Frontend now
accepts either --http-port flag or DYN_HTTP_PORT env var (defaults to 8000).
Add DYN_SYSTEM_PORT fallback syntax ${DYN_SYSTEM_PORT:-8081} for worker ports.

Multi-worker scenarios use distinct env vars (DYN_SYSTEM_PORT_PREFILL,
DYN_SYSTEM_PORT_DECODE, DYN_SYSTEM_PORT_WORKER1, etc).

This enables flexible port configuration in preparation for parallel testing
while maintaining backward compatibility.

Related: DIS-1022
Signed-off-by: Keiven Chang <[email protected]>
@keivenchang keivenchang force-pushed the keivenchang/DIS-1022__frontend-worker-dynamic-ports branch from b0a27eb to d3195ac Compare November 24, 2025 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants