Mercurial > repos > gga > genenotebook_genenotebook_build
comparison launch_gnb.sh @ 13:eae124b1e1f1 draft default tip
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 27cd61679954c8a70075dbc190e3f246b0b6c7f4
author | gga |
---|---|
date | Tue, 15 Jul 2025 13:09:49 +0000 |
parents | 4398a6fea625 |
children |
comparison
equal
deleted
inserted
replaced
12:23effb1dfe1a | 13:eae124b1e1f1 |
---|---|
10 | 10 |
11 echo "Waiting while mongod starts up" | 11 echo "Waiting while mongod starts up" |
12 | 12 |
13 tries=0 | 13 tries=0 |
14 | 14 |
15 # "Listening on" is for mongodb 5x | 15 # "Listening on" is for mongodb 150x |
16 while ! grep -q "Listening on" ./mongod.log; do | 16 while ! grep -q "Listening on" ./mongod.log; do |
17 | 17 |
18 tries=$((tries + 1)) | 18 tries=$((tries + 1)) |
19 | 19 |
20 if [ "$tries" -ge 50 ]; then | 20 if [ "$tries" -ge 150 ]; then |
21 echo "Failed to launch MongoDB:" 1>&2; | 21 echo "Failed to launch MongoDB:" 1>&2; |
22 cat ./mongod.log 1>&2; | 22 cat ./mongod.log 1>&2; |
23 exit 1; | 23 exit 1; |
24 fi | 24 fi |
25 | 25 |
47 while ! grep -q "GeneNoteBook server started, serving" ./gnb.log; do | 47 while ! grep -q "GeneNoteBook server started, serving" ./gnb.log; do |
48 | 48 |
49 tries_gnb=$((tries_gnb + 1)) | 49 tries_gnb=$((tries_gnb + 1)) |
50 | 50 |
51 # GNB can take a while to start depending on storage (accessing many many small js files) | 51 # GNB can take a while to start depending on storage (accessing many many small js files) |
52 if [ "$tries_gnb" -ge 150 ]; then | 52 if [ "$tries_gnb" -ge 250 ]; then |
53 echo "Failed to launch GeneNoteBook:" 1>&2; | 53 echo "Failed to launch GeneNoteBook:" 1>&2; |
54 cat ./gnb.log 1>&2; | 54 cat ./gnb.log 1>&2; |
55 kill $GNB_PID $(<"./mongo.pid"); | 55 kill $GNB_PID $(<"./mongo.pid"); |
56 exit 1; | 56 exit 1; |
57 fi | 57 fi |
64 | 64 |
65 tries_curl=0 | 65 tries_curl=0 |
66 | 66 |
67 while ! curl -s "http://127.0.0.1:${GNB_PORT}/healthcheck"; do | 67 while ! curl -s "http://127.0.0.1:${GNB_PORT}/healthcheck"; do |
68 tries_curl=$((tries_curl + 1)) | 68 tries_curl=$((tries_curl + 1)) |
69 if [ "$tries_curl" -ge 100 ]; then | 69 if [ "$tries_curl" -ge 200 ]; then |
70 echo "Healthcheck is not working, stopping:" 1>&2; | 70 echo "Healthcheck is not working, stopping:" 1>&2; |
71 cat ./gnb.log 1>&2; | 71 cat ./gnb.log 1>&2; |
72 kill $GNB_PID $(<"./mongo.pid"); | 72 kill $GNB_PID $(<"./mongo.pid"); |
73 exit 1; | 73 exit 1; |
74 fi | 74 fi |
76 sleep 3 | 76 sleep 3 |
77 done; | 77 done; |
78 | 78 |
79 grep -q "Healthcheck OK" ./gnb.log | 79 grep -q "Healthcheck OK" ./gnb.log |
80 | 80 |
81 sleep 30 | |
82 | |
81 echo "GNB is ready" | 83 echo "GNB is ready" |