Spaces:
Running
Running
MVPilgrim
commited on
Commit
·
13fe584
1
Parent(s):
8bb2017
install
Browse files- startup.sh +13 -14
startup.sh
CHANGED
@@ -7,37 +7,37 @@
|
|
7 |
#####################################
|
8 |
exec &> /app/startup.log
|
9 |
|
10 |
-
echo "#### startup.sh entered."
|
11 |
-
echo "### ps -ef 1"; ps -ef
|
12 |
|
13 |
# Is startup.sh already running?
|
14 |
-
echo " "
|
15 |
-
echo "### before ps and grep startup.sh"
|
16 |
-
ps -ef | grep -i startup.sh
|
17 |
cnt=$(ps -ef | grep -i startup.sh | wc -l)
|
18 |
-
echo "### cnt: $cnt"
|
19 |
if [ $cnt -gt 3 ];then
|
20 |
-
echo "#### startup.sh already running. Exiting."
|
21 |
exit 0
|
22 |
fi
|
23 |
|
24 |
# Make sure Weaviate DB directory exists.
|
25 |
-
echo "### Before mkdir -p ~/data/var/lib/weaviate"
|
26 |
weaviateDir=~/data/var/lib/weaviate
|
27 |
mkdir -p $weaviateDir
|
28 |
chmod -R 777 $weaviateDir
|
29 |
|
30 |
|
31 |
# Start tex2vec-transformers
|
32 |
-
echo "#### Before /app/text2vec-transformers"
|
33 |
cd /app/text2vec-transformers
|
34 |
/app/text2vec-transformers/bin/uvicorn app:app --host 0.0.0.0 --port 8081 --log-level warning --timeout-keep-alive 1440 &
|
35 |
-
echo "### After text2vec start. RC=$?"
|
36 |
cd /app
|
37 |
|
38 |
|
39 |
# Start the weaviate vector database server.
|
40 |
-
echo "#### Before /app/weaviate"
|
41 |
|
42 |
export AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true \
|
43 |
PERSISTENCE_DATA_PATH=$weaviateDir \
|
@@ -47,13 +47,12 @@ export AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true \
|
|
47 |
LOG_LEVEL=warning \
|
48 |
MODULES_CLIENT_TIMEOUT=600s
|
49 |
/app/weaviate/weaviate --host 127.0.0.1 --port 8080 --scheme http --write-timeout 600s &
|
50 |
-
echo "### After Weaviate DB start. RC=$?"
|
51 |
|
52 |
#echo "### Before sleep 120"
|
53 |
#sleep 120
|
54 |
|
55 |
-
echo "###
|
56 |
-
echo "### ps -ef 2: "; ps -ef
|
57 |
wait
|
58 |
|
59 |
|
|
|
7 |
#####################################
|
8 |
exec &> /app/startup.log
|
9 |
|
10 |
+
stdbuf -o0 echo "#### startup.sh entered."
|
11 |
+
stdbuf -o0 echo "### ps -ef 1"; ps -ef
|
12 |
|
13 |
# Is startup.sh already running?
|
14 |
+
stdbuf -o0 echo " "
|
15 |
+
stdbuf -o0 echo "### before ps and grep startup.sh"
|
16 |
+
stdbuf -o0 ps -ef | grep -i startup.sh
|
17 |
cnt=$(ps -ef | grep -i startup.sh | wc -l)
|
18 |
+
stdbuf -o0 echo "### cnt: $cnt"
|
19 |
if [ $cnt -gt 3 ];then
|
20 |
+
stdbuf -o0 echo "#### startup.sh already running. Exiting."
|
21 |
exit 0
|
22 |
fi
|
23 |
|
24 |
# Make sure Weaviate DB directory exists.
|
25 |
+
stdbuf -o0 echo "### Before mkdir -p ~/data/var/lib/weaviate"
|
26 |
weaviateDir=~/data/var/lib/weaviate
|
27 |
mkdir -p $weaviateDir
|
28 |
chmod -R 777 $weaviateDir
|
29 |
|
30 |
|
31 |
# Start tex2vec-transformers
|
32 |
+
stdbuf -o0 echo "#### Before /app/text2vec-transformers"
|
33 |
cd /app/text2vec-transformers
|
34 |
/app/text2vec-transformers/bin/uvicorn app:app --host 0.0.0.0 --port 8081 --log-level warning --timeout-keep-alive 1440 &
|
35 |
+
stdbuf -o0 echo "### After text2vec start. RC=$?"
|
36 |
cd /app
|
37 |
|
38 |
|
39 |
# Start the weaviate vector database server.
|
40 |
+
stdbuf -o0 echo "#### Before /app/weaviate"
|
41 |
|
42 |
export AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true \
|
43 |
PERSISTENCE_DATA_PATH=$weaviateDir \
|
|
|
47 |
LOG_LEVEL=warning \
|
48 |
MODULES_CLIENT_TIMEOUT=600s
|
49 |
/app/weaviate/weaviate --host 127.0.0.1 --port 8080 --scheme http --write-timeout 600s &
|
50 |
+
stdbuf -o0 echo "### After Weaviate DB start. RC=$?"
|
51 |
|
52 |
#echo "### Before sleep 120"
|
53 |
#sleep 120
|
54 |
|
55 |
+
stdbuf -o0 echo "### ps -ef 2: "; ps -ef
|
|
|
56 |
wait
|
57 |
|
58 |
|