-
Notifications
You must be signed in to change notification settings - Fork 0
feat: parameterize all ports and pod name for parallel prod/dev deployments #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3084c68
143d8ef
9e86358
38d03b4
bce02a6
24a7012
2fe9545
fff4592
02182ff
f4befbb
5f4c87e
1afa7c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Dev environment overlay — sourced AFTER .env to override prod values | ||
| # Secrets are inherited from .env; only env-specific config is set here. | ||
|
|
||
| # Pod identity | ||
| POD_NAME="dev-router-pod" | ||
|
|
||
| # Public URLs | ||
| BASEURL="dev.vendeuvre.lan" | ||
| BASE_URL="dev.vendeuvre.lan" | ||
| PUBLIC_BASE_URL="https://dev.vendeuvre.lan/llm-routing" | ||
|
|
||
| # Dev port assignments (+10 offset from production) | ||
| ROUTER_PORT="5010" | ||
| LITELLM_PORT="4010" | ||
| LANGFUSE_WEB_PORT="3011" | ||
| LANGFUSE_WORKER_PORT="3040" | ||
| POSTGRES_PORT="5442" | ||
| VALKEY_CACHE_PORT="6389" | ||
| VALKEY_LF_PORT="6390" | ||
| CLICKHOUSE_HTTP_PORT="8133" | ||
| CLICKHOUSE_TCP_PORT="9010" | ||
| CLICKHOUSE_INTERSERVER_PORT="9019" | ||
| MINIO_S3_PORT="9012" | ||
| MINIO_CONSOLE_PORT="9011" | ||
|
|
||
| # Dev uses locally-built router image (for testing code changes) | ||
| ROUTER_IMAGE="localhost/llm-routing-dev:latest" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,7 +17,7 @@ | |||||||||||||||
| if line and not line.startswith("#") and "=" in line: | ||||||||||||||||
| key, _, val = line.partition("=") | ||||||||||||||||
| val = val.strip().strip('"').strip("'") | ||||||||||||||||
| os.environ[key] = val | ||||||||||||||||
| os.environ.setdefault(key, val) | ||||||||||||||||
|
Comment on lines
18
to
+20
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without stripping quotes from the environment variable values parsed from the We should restore the quote-stripping logic before calling
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
| # Load Gemini OAuth token from credentials JSON | ||||||||||||||||
| creds_path = "/config/gemini_auth/oauth_creds.json" | ||||||||||||||||
|
|
@@ -46,9 +46,10 @@ def check_tcp_port(ip: str, port: int) -> bool: | |||||||||||||||
| return False | ||||||||||||||||
|
|
||||||||||||||||
| max_wait = 60 | ||||||||||||||||
| print(f"🔌 Waiting for PostgreSQL on :5432 (max {max_wait}s)...") | ||||||||||||||||
| postgres_port = int(os.environ.get("POSTGRES_PORT", "5432")) | ||||||||||||||||
| print(f"🔌 Waiting for PostgreSQL on :{postgres_port} (max {max_wait}s)...") | ||||||||||||||||
| for i in range(max_wait): | ||||||||||||||||
| if check_tcp_port("127.0.0.1", 5432): | ||||||||||||||||
| if check_tcp_port("127.0.0.1", postgres_port): | ||||||||||||||||
| print(f"✅ PostgreSQL ready after {i+1}s") | ||||||||||||||||
| break | ||||||||||||||||
| time.sleep(1) | ||||||||||||||||
|
|
@@ -127,5 +128,6 @@ def _serialize_dt(dt): | |||||||||||||||
| # Start LiteLLM Proxy | ||||||||||||||||
| import litellm | ||||||||||||||||
| from litellm.proxy.proxy_cli import run_server | ||||||||||||||||
| sys.argv = ["litellm", "--config", "/app/config.yaml", "--port", "4000"] | ||||||||||||||||
| litellm_port = os.environ.get("LITELLM_PORT", os.environ.get("PORT", "4000")) | ||||||||||||||||
| sys.argv = ["litellm", "--config", "/app/config.yaml", "--port", litellm_port] | ||||||||||||||||
| run_server() | ||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Preserving quotes/whitespace in .env values can break numeric parsing (e.g. POSTGRES_PORT).
With the updated logic, a line like
POSTGRES_PORT="5432"now setsos.environ['POSTGRES_PORT']to the literal string"5432", soint(os.environ.get("POSTGRES_PORT", "5432"))will raiseValueError. Leading/trailing spaces cause the same issue. Please restore at leastval.strip()(and optionally quote stripping) while keeping the newsetdefaultbehavior.