-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·57 lines (45 loc) · 1.69 KB
/
install.sh
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
# Setting vars
export INSTANCE_NAME="dev"
export LD_LIBRARY_PATH=/usr/local/lib
export LD_RUN_PATH=/usr/local/lib
########################################
# Installing Requirements
pip install --use-deprecated=legacy-resolver -r requirements.txt
if ! [[ -z $(pip freeze | grep "torch==1.6.0+cu101") ]]; then
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
fi
########################################
# Install ElasticSearch
echo "Check if ElasticSearch is installed..."
if ! [[ -d "elasticsearch-7.10.2" ]]; then
rm elasticsearch-7.10.2-linux-x86_64.tar.gz*
echo "Installing ElasticSearch..."
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.2-linux-x86_64.tar.gz
tar -xvzf elasticsearch-7.10.2-linux-x86_64.tar.gz
rm elasticsearch-7.10.2-linux-x86_64.tar.gz
fi
########################################
# Setting Elasticsearch
echo "Checking if ElasticSearch is ON..."
if [[ -z $(fuser 9200/tcp) ]]; then
echo "Initializing ElasticSearch..."
cd ./elasticsearch-7.10.2
# remove configuracoes de segurança
echo xpack.ml.enabled: false >> config/elasticsearch.yml
echo xpack.security.enabled: false >> config/elasticsearch.yml
echo xpack.security.transport.ssl.enabled: false >> config/elasticsearch.yml
ES_JAVA_OPTS=-Xmx2g ./bin/elasticsearch -d
echo "Waiting ElasticSearch..."
sleep 60s
cd ..
fi
########################################
# Indexing Documents
echo ""
echo "Indexing documents..."
cd ./indexer
if [[ -z $(curl -X GET "localhost:9200/_cat/indices/*") ]]; then
./indexing_script.sh
fi
########################################
docker-compose build