Skip to content

Commit

Permalink
Merge pull request #91 from galaxy-genome-annotation/gnb_sleep
Browse files Browse the repository at this point in the history
genenotebook: give a few more seconds to startup
  • Loading branch information
abretaud authored Feb 1, 2024
2 parents 5ad4d3b + aa1fd65 commit 91ccbf9
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 16 deletions.
46 changes: 31 additions & 15 deletions tools/genenotebook/launch_gnb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,26 @@

set -e

mongod --dbpath ./mongo_db/ --unixSocketPrefix `pwd` --bind_ip fake_socket --logpath ./mongod.log --pidfilepath ./mongo.pid &
echo "Running mongod: "
mongod --dbpath ./mongo_db/ --unixSocketPrefix "$(pwd)" --bind_ip fake_socket --logpath ./mongod.log --pidfilepath ./mongo.pid &

sleep 8
echo "Waiting while mongod starts up"

tries=0

# "Listening on" is for mongodb 5x
if ! grep -q "Listening on" ./mongod.log; then
echo "Failed to launch MongoDB:" 1>&2;
cat ./mongod.log 1>&2;
kill $GNB_PID;
exit 1;
fi;
while ! grep -q "Listening on" ./mongod.log; do

tries=$((tries + 1))

if [ "$tries" -ge 30 ]; then
echo "Failed to launch MongoDB:" 1>&2;
cat ./mongod.log 1>&2;
exit 1;
fi

sleep 3
done;

TMP_STORAGE=$(pwd)/tmp_storage
mkdir "$TMP_STORAGE"
Expand All @@ -23,11 +32,18 @@ genoboo run --storage-path "$TMP_STORAGE" --port ${GNB_PORT} --mongo-url mongodb

export GNB_PID=$!

sleep 15
tries_gnb=0

while ! grep -q "GeneNoteBook server started, serving" ./gnb.log; do

tries_gnb=$((tries_gnb + 1))

if [ "$tries_gnb" -ge 30 ]; then
echo "Failed to launch GeneNoteBook:" 1>&2;
cat ./gnb.log 1>&2;
kill $GNB_PID $(<"./mongo.pid");
exit 1;
fi

if ! grep -q "GeneNoteBook server started, serving" ./gnb.log; then
echo "Failed to launch GeneNoteBook:" 1>&2;
cat ./gnb.log 1>&2;
kill $GNB_PID $(<"./mongo.pid");
exit 1;
fi;
sleep 3
done;
2 changes: 1 addition & 1 deletion tools/genenotebook/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</requirements>
</xml>

<token name="@TOOL_VERSION@">0.4.9</token>
<token name="@TOOL_VERSION@">0.4.12</token>
<token name="@WRAPPER_VERSION@">@TOOL_VERSION@+galaxy0</token>

<xml name="citation">
Expand Down
Binary file modified tools/genenotebook/test-data/output/genome.tar.bz2
Binary file not shown.
Binary file modified tools/genenotebook/test-data/output/genome_annot.tar.bz2
Binary file not shown.
Binary file modified tools/genenotebook/test-data/output/genome_annot_ips.tar.bz2
Binary file not shown.
Binary file modified tools/genenotebook/test-data/output/genome_annot_ips_en.tar.bz2
Binary file not shown.
Binary file not shown.
Binary file modified tools/genenotebook/test-data/output/genome_reload.tar.bz2
Binary file not shown.

0 comments on commit 91ccbf9

Please sign in to comment.