Reality123b commited on
Commit
ec786d4
·
verified ·
1 Parent(s): c6a4ea2

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +19 -33
entrypoint.sh CHANGED
@@ -1,36 +1,22 @@
1
- #!/bin/bash
2
-
3
- # Start MongoDB in the background
4
- echo "Starting MongoDB..."
5
- mongod --dbpath /data/db &
6
-
7
- # Function to check if a port is open
8
- check_port() {
9
- timeout 3 bash -c "</dev/tcp/127.0.0.1/$1" 2>/dev/null
10
- }
11
-
12
- # Wait for MongoDB to start
13
- until check_port 27017; do
14
- echo "Waiting for MongoDB to start on port 27017..."
15
- sleep 5
16
- done
17
-
18
- # Start text-generation-inference server in the background
19
- echo "Starting text-generation-inference server..."
20
- text-generation-launcher --model-id ${MODEL_NAME} --num-shard 1 --port 8080 --disable-custom-kernels --max-batch-prefill-tokens 4096 &
21
-
22
- # Wait for text-generation-inference to start
23
- until check_port 8080; do
24
- echo "Waiting for text-generation-inference to start on port 8080..."
25
- sleep 5
26
- done
27
-
28
- # Start the chat-ui process
29
- echo "Starting Chat UI..."
30
- dotenv -e /app/.env -c -- node /app/build/index.js -- --host 0.0.0.0 --port ${PORT}
31
-
32
- # Wait for any process to exit
33
  wait -n
34
 
35
- # Exit with status of process that exited first
36
  exit $?
 
1
+ mkdir -p /data/db
2
+
3
+
4
+ find /data/db -name "*.lock" -type f -exec rm -f {} ;
5
+
6
+
7
+ mongod &
8
+
9
+
10
+ text-generation-launcher --model-id ${MODEL_NAME} --num-shard 1 --port 8080 --trust-remote-code &
11
+
12
+
13
+ curl --retry 60 --retry-delay 10 --retry-connrefused http://127.0.0.1:8080/health
14
+
15
+
16
+ dotenv -e /app/.env -c -- node /app/build/index.js -- --host 0.0.0.0 --port 3000
17
+
18
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  wait -n
20
 
21
+
22
  exit $?