forked from EBIBioSamples/biosamples-v4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-debug.sh
executable file
·59 lines (49 loc) · 2.57 KB
/
docker-debug.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
58
#!/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
mvn -T 2C -P embl-ebi clean package -Dembedmongo.wait
else
docker-compose down --rmi local --remove-orphans
mvn -T 2C -P embl-ebi package -Dembedmongo.wait
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
echo "checking solr is up"
./http-status-check -u http://localhost:8983 -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
#configure solr
curl http://localhost:8983/solr/samples/config -H 'Content-type:application/json' -d'{"set-property" : {"updateHandler.autoCommit.maxTime":5000, "updateHandler.autoCommit.openSearcher":"true", "query.documentCache.size":1024, "query.filterCache.size":1024, "query.filterCache.autowarmCount":128, "query.queryResultCache.size":1024, "query.queryResultCache.autowarmCount":128}}'
#create an api key for submitting test sampletab documents
docker-compose run --rm mongo mongo --eval 'db.mongoSampleTabApiKey.insert({"_id" : "fooqwerty", "_class" : "uk.ac.ebi.biosamples.mongo.model.MongoSampleTabApiKey", "userName" : "BioSamples", "publicEmail" : "", "publicUrl" : "", "contactName" : "", "contactEmail" : "", "aapDomain" : "123456789abcdef" });' mongo:27017/biosamples
#profile any queries that take longer than 100 ms
docker-compose run --rm mongo mongo --eval 'db.setProfilingLevel(1)' mongo:27017/biosamples
docker-compose -f docker-compose.yml -f docker-compose.debug.override.yml -f docker-compose.override.yml up -d biosamples-webapps-core biosamples-webapps-sampletab biosamples-webapps-legacyxml biosamples-webapps-legacyjson
sleep 40
echo "checking webapps-core is up"
./http-status-check -u http://localhost:8081/biosamples/health -t 6000
echo "checking webapps-sampletab is up"
./http-status-check -u http://localhost:8082/biosamples/sampletab/health -t 600
echo "checking webapps-legacyxml is up"
./http-status-check -u http://localhost:8083/biosamples/xml/health -t 600
echo "checking webapps-legacyjson is up"
./http-status-check -u http://localhost:8084/biosamples/api/health -t 600