-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstart_proxy_dev.sh
More file actions
executable file
·32 lines (28 loc) · 1.15 KB
/
Copy pathstart_proxy_dev.sh
File metadata and controls
executable file
·32 lines (28 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
# Reverse proxy — DEV.
# Listens on the public-facing port (8001) and routes:
# /rmac/solve/... → localhost:8011 (solve app)
# /rmac/filter/... → localhost:8012 (filter app)
set -euo pipefail
PYTHON=/sw/user/python/miniforge3-pytorch-2.11.0/bin/python3.12
ROOT="$(cd "$(dirname "$0")" && pwd)"
PORT="${RMA_PROXY_PORT:-8001}"
HOST="${RMA_HOST:-0.0.0.0}"
SOLVE_INTERNAL="${RMA_SOLVE_DEV_PORT:-8011}"
FILTER_INTERNAL="${RMA_FILTER_DEV_PORT:-8012}"
cd "$ROOT"
echo "[proxy-dev] Proxy on ${HOST}:${PORT} → solve:${SOLVE_INTERNAL} filter:${FILTER_INTERNAL}"
while true; do
echo "[proxy-dev $(date '+%Y-%m-%d %H:%M:%S')] launching…"
PYTHONPATH="${HOME}/.local/lib/python3.12/site-packages${PYTHONPATH:+:$PYTHONPATH}" \
RMAC_SOLVE_ORIGIN="http://127.0.0.1:${SOLVE_INTERNAL}" \
RMAC_FILTER_ORIGIN="http://127.0.0.1:${FILTER_INTERNAL}" \
"$PYTHON" -m uvicorn proxy_server:app \
--host "$HOST" \
--port "$PORT" \
--reload \
--reload-include "proxy_server.py" \
--reload-delay 0.5 || true
echo "[proxy-dev $(date '+%Y-%m-%d %H:%M:%S')] exited, restarting in 3s…"
sleep 3
done