File size: 1,637 Bytes
3882e3f
 
2430b06
 
 
 
 
543acbd
 
3882e3f
b3ee4e7
66f9d68
4a3c8c8
6b3af34
 
 
510c993
6b3af34
 
4a3c8c8
 
 
a463554
2430b06
f65c073
18a3a1b
dd2c5c9
 
 
3882e3f
 
 
197ae45
4a3c8c8
419c06b
197ae45
3882e3f
 
 
 
 
 
dd2c5c9
3882e3f
 
 
d833c00
3882e3f
4a3c8c8
419c06b
3882e3f
a641b1d
 
1eb1fc6
697a734
b3ee4e7
a641b1d
802ca26
3882e3f
 
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /bin/bash 

#####################################
# Start text2vec-transformers and   #
# Weaviate DB to run asynchronously #
# and wait.                         #
#####################################
exec &> /app/startup.log

echo "#### startup.sh entered."
echo "### ps -ef 1"; ps -ef

# Is startup.sh already running?
echo " "
echo "### before ps and grep startup.sh"
ps -ef | grep -i startup.sh
cnt=$(ps -ef | grep -i startup.sh | wc -l)
echo "### cnt: $cnt"
if [ $cnt -gt 3 ];then
  echo "#### startup.sh already running. Exiting."
  exit 0
fi

# Make sure Weaviate DB directory exists.
echo "### Before mkdir -p ~/data/var/lib/weaviate"
weaviateDir=~/data/var/lib/weaviate
mkdir -p $weaviateDir
chmod -R 777 $weaviateDir


# Start tex2vec-transformers
echo "#### Before /app/text2vec-transformers"
cd /app/text2vec-transformers
/app/text2vec-transformers/bin/uvicorn app:app --host 0.0.0.0 --port 8081 --log-level warning --timeout-keep-alive 1440 & 
echo "### After text2vec start. RC=$?"
cd /app


# Start the weaviate vector database server.
echo "#### Before /app/weaviate"

export AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true \
       PERSISTENCE_DATA_PATH=$weaviateDir \
       DEFAULT_VECTORIZER_MODULE=text2vec-transformers \
	   ENABLE_MODULES=text2vec-transformers \
	   TRANSFORMERS_INFERENCE_API=http://127.0.0.1:8081 \
	   LOG_LEVEL=warning \
       MODULES_CLIENT_TIMEOUT=600s
/app/weaviate/weaviate --host 127.0.0.1 --port 8080 --scheme http --write-timeout 600s & 
echo "### After Weaviate DB start. RC=$?"

#echo "### Before sleep 120"
#sleep 120

echo "### Before wait."
echo "### ps -ef 2: "; ps -ef
wait