# HG changeset patch
# User gga
# Date 1708423505 0
# Node ID 29eeddd8ea6252fa718bdf7484b09c96ed0bab8d
# Parent dfb2bc3aedbd0a8610b67a77dcdcce4f2f197d91
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 1429f00733ee24bf2edf56b9fd7ff4ad2dec3f15
diff -r dfb2bc3aedbd -r 29eeddd8ea62 launch_gnb.sh
--- a/launch_gnb.sh Thu Feb 01 12:45:00 2024 +0000
+++ b/launch_gnb.sh Tue Feb 20 10:05:05 2024 +0000
@@ -2,7 +2,10 @@
set -e
-echo "Running mongod: "
+# Make sure the file always exists even on first grep
+touch mongod.log
+
+echo "Starting mongod, listening on unix socket in $(pwd)"
mongod --dbpath ./mongo_db/ --unixSocketPrefix "$(pwd)" --bind_ip fake_socket --logpath ./mongod.log --pidfilepath ./mongo.pid &
echo "Waiting while mongod starts up"
@@ -26,8 +29,15 @@
TMP_STORAGE=$(pwd)/tmp_storage
mkdir "$TMP_STORAGE"
+# Make sure the file always exists
+touch gnb.log
+
export NODE_OPTIONS="--max-old-space-size=$((${GALAXY_MEMORY_MB:-8192} * 75 / 100))"
+# Find free port at the last moment
+export GNB_PORT=$(bash "$(dirname "${BASH_SOURCE[0]}")/find_free_port.sh")
+echo "Mongod is ready, starting gnb now on port ${GNB_PORT} and with mongodb://${MONGO_URI}%2Fmongodb-27017.sock/genenotebook"
+
genoboo run --storage-path "$TMP_STORAGE" --port ${GNB_PORT} --mongo-url mongodb://$MONGO_URI%2Fmongodb-27017.sock/genenotebook > ./gnb.log 2>&1 &
export GNB_PID=$!
@@ -38,7 +48,8 @@
tries_gnb=$((tries_gnb + 1))
- if [ "$tries_gnb" -ge 30 ]; then
+ # GNB can take a while to start depending on storage (accessing many many small js files)
+ if [ "$tries_gnb" -ge 150 ]; then
echo "Failed to launch GeneNoteBook:" 1>&2;
cat ./gnb.log 1>&2;
kill $GNB_PID $(<"./mongo.pid");
@@ -47,3 +58,9 @@
sleep 3
done;
+
+# Make sure that gnb is working, and that it's serving on the expected port
+curl "http://127.0.0.1:${GNB_PORT}/healthcheck" > /dev/null
+grep -q "Healthcheck OK" ./gnb.log
+
+echo "GNB is ready"
diff -r dfb2bc3aedbd -r 29eeddd8ea62 macros.xml
--- a/macros.xml Thu Feb 01 12:45:00 2024 +0000
+++ b/macros.xml Tue Feb 20 10:05:05 2024 +0000
@@ -7,7 +7,7 @@
- 0.4.12
+ 0.4.13
@TOOL_VERSION@+galaxy0
@@ -37,7 +37,6 @@
For some unknwon reason, unixSocketPrefix needs an absolute path
-->