Spaces:
Sleeping
Sleeping
File size: 1,637 Bytes
720552c |
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
|