File size: 2,327 Bytes
3882e3f
 
2430b06
 
 
 
 
543acbd
 
329ad1a
 
0d43e84
fb8e545
13fe584
a2dfb8f
66f9d68
4a3c8c8
a2dfb8f
 
 
 
 
 
 
 
 
a463554
2430b06
13fe584
18a3a1b
dd2c5c9
 
 
e641991
79beb9f
 
 
3882e3f
 
13fe584
9ee8ce2
197ae45
329ad1a
4a3c8c8
13fe584
197ae45
3882e3f
 
 
13fe584
3882e3f
 
dd2c5c9
3882e3f
 
 
d833c00
3882e3f
0d43e84
 
 
4a3c8c8
13fe584
3882e3f
a641b1d
 
1eb1fc6
13fe584
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
62
63
64
65
66
67
68
69
70
71
72
73
#! /bin/bash 

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

echo "#### before nvidia-smi: "; nvidia-smi

#echo "#### pip3 list"; pip3 list

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

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

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

# TEMP TEST
#ls -l /usr/bin | grep -i python; ls -l /usr/local/bin | grep -i python || test '1 .gt 0'
#ln -s /usr/local/bin/python /usr/bin/python3.11
#ls -l /usr/local/bin | grep -i python|| test '1 .gt 0'

# Start tex2vec-transformers
stdbuf -o0 echo "#### Before /app/text2vec-transformers"
ls -l /usr/local/bin/python3.11 || ls -l /usr/local/bin || test '1 .gt 0'
cd /app/text2vec-transformers
#stdbuf -o0 echo "####### ls of /app/text2vec-transformers/bin"; ls -l /app/text2vec-transformers/bin; ls -l /app/text2vec-transformers
/app/text2vec-transformers/bin/uvicorn app:app --host 0.0.0.0 --port 8081 --log-level warning --timeout-keep-alive 1440 & 
stdbuf -o0 echo "### After text2vec start. RC=$?"
cd /app


# Start the weaviate vector database server.
stdbuf -o0 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

#echo "### Before sleep 10 before starting Weaviate."
sleep 10
/app/weaviate/weaviate --host 127.0.0.1 --port 8080 --scheme http --write-timeout 600s & 
stdbuf -o0 echo "### After Weaviate DB start. RC=$?"

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

stdbuf -o0 echo "### ps -ef 2: "; ps -ef
wait