-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdocker-webapp.sh
More file actions
executable file
·81 lines (65 loc) · 2.9 KB
/
docker-webapp.sh
File metadata and controls
executable file
·81 lines (65 loc) · 2.9 KB
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
74
75
76
77
78
79
80
#!/bin/bash
set -e
clean=0
while [ "$1" != "" ]; do
case $1 in
-c | --clean ) clean=1
;;
esac
shift
done
#cleanup any previous data
if [ $clean == 1 ]
then
echo "Cleaning existing volumes"
#remove any images, in case of out-of-date or corrupt images
#docker-compose down --volumes --remove-orphans
docker-compose down --volumes --rmi local --remove-orphans
./mvnw -T 2C -P embl-ebi clean package -Dembedmongo.wait -s ci_settings.xml
else
docker-compose down --rmi local --remove-orphans
./mvnw -T 2C -P embl-ebi clean package -Dembedmongo.wait -s ci_settings.xml
fi
set -e
#make sure we have up-to-date jar files in the docker image
docker-compose build
#start up the webapps (and dependencies)
#docker-compose up -d --remove-orphans solr rabbitmq mongo neo4j json-schema-validator schema-store
docker-compose up -d --remove-orphans elastic rabbitmq mongo neo4j json-schema-validator
#echo "checking solr is up"
#./http-status-check -u http://localhost:9200 -t 30
echo "checking rabbitmq is up"
./http-status-check -u http://localhost:15672 -t 30
echo "checking mongo is up"
./http-status-check -u http://localhost:27017 -t 30
echo "checking json-schema-validator is up"
./http-status-check -u http://localhost:3020/validate -t 30
echo "checking neo4j is up"
./http-status-check -u http://localhost:7474 -t 30
#echo "checking schema-store is up"
#./http-status-check -u http://localhost:8080 -t 30
#configure solr
#curl http://localhost:8983/solr/samples/config -H 'Content-type:application/json' -d'{"set-property" : {"updateHandler.autoCommit.maxTime":1000, "updateHandler.autoCommit.openSearcher":"true", "updateHandler.autoSoftCommit.maxDocs":1, "query.documentCache.size":1024, "query.filterCache.size":1024, "query.filterCache.autowarmCount":128, "query.queryResultCache.size":1024, "query.queryResultCache.autowarmCount":128}}'
#configure schema-store
#profile any queries that take longer than 100 ms
#don't use run, spins up a new container, use eval to use existing container
docker-compose exec mongo mongo biosamples --eval 'db.setProfilingLevel(1)'
until curl -s http://localhost:9200 | grep -q "missing authentication credentials"; do sleep 30; done;
# create ES index
curl -X DELETE "http://localhost:9200/samples" -u "elastic:elastic"
curl -X PUT "http://localhost:9200/samples" \
-H "Content-Type: application/json" \
-u "elastic:elastic" \
--data-binary @es_index.json
docker-compose up -d biosamples-search
sleep 20
echo "checking biosamples-search is up"
./http-status-check -u http://localhost:8083/actuator/health -t 600
docker-compose up -d biosamples-webapps-core
sleep 40
echo "checking webapps-core is up"
./http-status-check -u http://localhost:8081/biosamples/actuator/health -t 600
docker-compose up -d biosamples-webapps-core-v2
sleep 40
echo "checking webapps-core-v2 is up"
./http-status-check -u http://localhost:8082/biosamples/v2/actuator/health -t 600