WebHub360 commited on
Commit
991c6dd
·
verified ·
1 Parent(s): ffde6b9

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +0 -61
entrypoint.sh CHANGED
@@ -3,67 +3,6 @@ set -e
3
 
4
  echo "Starting entrypoint script with MODEL_NAME: ${MODEL_NAME}"
5
 
6
- # Display system information
7
- echo "=== System Information ==="
8
- uname -a
9
- nvidia-smi || echo "Warning: nvidia-smi failed, GPU may not be available"
10
-
11
- # Start the text-generation-inference server
12
- echo "Starting text-generation-inference with model: ${MODEL_NAME}"
13
- text-generation-launcher --model-id ${MODEL_NAME} --num-shard 1 --port 8080 --trust-remote-code &
14
- TGI_PID=$!
15
- echo "Text-generation-inference started with PID: $TGI_PID"
16
-
17
- # Check if TGI process is running
18
- sleep 5
19
- if ! kill -0 $TGI_PID 2>/dev/null; then
20
- echo "ERROR: text-generation-inference process died!"
21
- exit 1
22
- fi
23
-
24
- # Wait for TGI to be available
25
- echo "Waiting for text-generation-inference to be available..."
26
- MAX_RETRIES=60
27
- RETRY_COUNT=0
28
- while ! curl -s http://127.0.0.1:8080/health > /dev/null; do
29
- RETRY_COUNT=$((RETRY_COUNT+1))
30
- if [ $RETRY_COUNT -ge $MAX_RETRIES ]; then
31
- echo "ERROR: Maximum retries reached waiting for text-generation-inference!"
32
- exit 1
33
- fi
34
- echo "Waiting for text-generation-inference... Retry $RETRY_COUNT of $MAX_RETRIES"
35
- sleep 10
36
- done
37
-
38
- echo "Text-generation-inference is now available at http://127.0.0.1:8080"
39
-
40
- # Start the chat-ui process
41
- echo "Starting chat-ui..."
42
- cd /app
43
- dotenv -e /app/.env -c -- node /app/build/index.js -- --host 0.0.0.0 --port 3000 &
44
- CHAT_UI_PID=$!
45
-
46
- # Check if Chat UI process is running
47
- sleep 5
48
- if ! kill -0 $CHAT_UI_PID 2>/dev/null; then
49
- echo "ERROR: chat-ui process died!"
50
- exit 1
51
- fi
52
-
53
- echo "Chat UI is now available at http://0.0.0.0:3000"
54
- echo "All services are running"
55
-
56
- # Monitor processes and keep container running
57
- while true; do
58
- if ! kill -0 $TGI_PID 2>/dev/null; then
59
- echo "ERROR: text-generation-inference process died!"
60
- exit 1
61
- fi
62
-
63
- if ! kill -0 $CHAT_UI_PID 2>/dev/null; then
64
- echo "ERROR: chat-ui process died!"
65
- exit 1
66
- fi
67
 
68
  sleep 60
69
  done
 
3
 
4
  echo "Starting entrypoint script with MODEL_NAME: ${MODEL_NAME}"
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  sleep 60
8
  done