Mercurial > repos > gga > genenotebook_genenotebook_build
annotate launch_gnb.sh @ 0:22f22c3e81bf draft
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
author | gga |
---|---|
date | Wed, 11 Jan 2023 11:49:13 +0000 |
parents | |
children | f415e44e71de |
rev | line source |
---|---|
0
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
1 #!/bin/bash |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
2 |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
3 set -e |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
4 |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
5 mongod --dbpath ./mongo_db/ --unixSocketPrefix `pwd` --bind_ip fake_socket --logpath ./mongod.log --pidfilepath ./mongo.pid & |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
6 |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
7 sleep 5 |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
8 |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
9 # "waiting for connections on port" is for mongodb 4x |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
10 #if ! grep -q "waiting for connections on port" ./mongod.log; then |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
11 # "Listening on" is for mongodb 5x |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
12 if ! grep -q "Listening on" ./mongod.log; then |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
13 echo "Failed to launch MongoDB:" 1>&2; |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
14 cat ./mongod.log 1>&2; |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
15 kill $GNB_PID; |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
16 exit 1; |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
17 fi; |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
18 |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
19 TMP_STORAGE=$(pwd)/tmp_storage |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
20 mkdir "$TMP_STORAGE" |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
21 |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
22 genenotebook run --storage-path "$TMP_STORAGE" --port ${GNB_PORT} --mongo-url mongodb://$MONGO_URI%2Fmongodb-27017.sock/genenotebook > ./gnb.log 2>&1 & |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
23 |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
24 export GNB_PID=$! |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
25 |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
26 sleep 15 |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
27 |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
28 if ! grep -q "GeneNoteBook server started, serving" ./gnb.log; then |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
29 echo "Failed to launch GeneNoteBook:" 1>&2; |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
30 cat ./gnb.log 1>&2; |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
31 kill $GNB_PID $(<"./mongo.pid"); |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
32 exit 1; |
22f22c3e81bf
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 12282c16658b37858f49944796fd95515ef0fc0b
gga
parents:
diff
changeset
|
33 fi; |