Skip to content

Commit

Permalink
check port at the last moment
Browse files Browse the repository at this point in the history
  • Loading branch information
abretaud committed Feb 2, 2024
1 parent 6f1ddc5 commit 76ae329
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tools/genenotebook/launch_gnb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ while ! grep -q "Listening on" ./mongod.log; do
sleep 3
done;

echo "Mongod is ready, starting gnb now on port ${GNB_PORT} and with mongodb://${MONGO_URI}%2Fmongodb-27017.sock/genenotebook"

TMP_STORAGE=$(pwd)/tmp_storage
mkdir "$TMP_STORAGE"

Expand All @@ -36,6 +34,10 @@ 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=$!
Expand Down
1 change: 0 additions & 1 deletion tools/genenotebook/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
For some unknwon reason, unixSocketPrefix needs an absolute path
-->
<token name="@START_GNB@"><![CDATA[
export GNB_PORT="\$(bash '$__tool_directory__/find_free_port.sh')";
export MONGO_URI="\$(pwd | sed 's|/|%2F|g')";
#if $existing
tar -xf '${existing}' mongo_db;
Expand Down

0 comments on commit 76ae329

Please sign in to comment.