Deploy commited on
Commit
a69d616
·
1 Parent(s): 6215056

fix: health check curl→python urllib

Browse files
Files changed (1) hide show
  1. scripts/entrypoint.sh +14 -3
scripts/entrypoint.sh CHANGED
@@ -52,14 +52,25 @@ echo "[entrypoint] args: ${VLLM_ARGS[*]}"
52
  python3.10 -m vllm.entrypoints.openai.api_server "${VLLM_ARGS[@]}" &
53
  VLLM_PID=$!
54
 
55
- # --- vLLM health check ---
56
  echo "[entrypoint] vLLM 서버 준비 대기 중..."
57
- MAX_WAIT=900 # 최대 15분 (모델 다운로드 + CUDA graph 캡처 포함)
58
  WAITED=0
59
  INTERVAL=5
60
 
 
 
 
 
 
 
 
 
 
 
 
61
  while [ $WAITED -lt $MAX_WAIT ]; do
62
- if curl -sf "http://localhost:${VLLM_PORT}/health" > /dev/null 2>&1; then
63
  echo "[entrypoint] vLLM 서버 준비 완료 (${WAITED}s)"
64
  break
65
  fi
 
52
  python3.10 -m vllm.entrypoints.openai.api_server "${VLLM_ARGS[@]}" &
53
  VLLM_PID=$!
54
 
55
+ # --- vLLM health check (curl 미설치 → python urllib 사용) ---
56
  echo "[entrypoint] vLLM 서버 준비 대기 중..."
57
+ MAX_WAIT=900
58
  WAITED=0
59
  INTERVAL=5
60
 
61
+ _health_check() {
62
+ python3.10 -c "
63
+ import urllib.request, sys
64
+ try:
65
+ r = urllib.request.urlopen('http://localhost:${VLLM_PORT}/health', timeout=3)
66
+ sys.exit(0 if r.status == 200 else 1)
67
+ except:
68
+ sys.exit(1)
69
+ " 2>/dev/null
70
+ }
71
+
72
  while [ $WAITED -lt $MAX_WAIT ]; do
73
+ if _health_check; then
74
  echo "[entrypoint] vLLM 서버 준비 완료 (${WAITED}s)"
75
  break
76
  fi