Skip to content

Conversation

@kvinwang
Copy link
Collaborator

@kvinwang kvinwang commented Feb 2, 2026

Summary

  • Replace GATEWAY_SERVING_ADDR with GATEWAY_SERVING_PORT + GATEWAY_SERVING_NUM_PORTS in deploy script
  • Generate port range mappings automatically in passt mode
  • Update entrypoint.sh to generate listen_port = "443-462" style config when SERVING_NUM_PORTS > 1
  • Default SERVING_NUM_PORTS=1 preserves full backwards compatibility

Context

Follow-up to #489 (multi-port TCP listening). The gateway binary now supports port ranges, but the deploy scripts still mapped a single serving port. This PR makes the deploy tooling aware of multi-port configuration.

Configuration

In .env:

# Single port (default, backwards compatible)
GATEWAY_SERVING_PORT=9204
GATEWAY_SERVING_NUM_PORTS=1

# 20 ports for high-concurrency deployments
GATEWAY_SERVING_PORT=9204
GATEWAY_SERVING_NUM_PORTS=20

Test Results

  • Verified SERVING_NUM_PORTS=3 generates listen_port = "443-445" in container config
  • Verified default (unset) generates listen_port = 443 (backwards compatible)
  • Tested with cr.kvin.wang/dstack-gateway:multi-port image

Update deploy-to-vmm.sh, docker-compose.yaml, and entrypoint.sh to
support configurable number of serving ports via GATEWAY_SERVING_NUM_PORTS.

- Replace GATEWAY_SERVING_ADDR with GATEWAY_SERVING_PORT + GATEWAY_SERVING_NUM_PORTS
- Generate port range mappings in passt mode (host ports → container ports)
- Pass SERVING_NUM_PORTS to container for entrypoint config generation
- entrypoint.sh generates listen_port range when SERVING_NUM_PORTS > 1
- Default SERVING_NUM_PORTS=1 preserves backwards compatibility
@kvinwang kvinwang merged commit 48f2bb7 into master Feb 2, 2026
11 checks passed
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