Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generalization of install_tools_wrapper.sh #499

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions galaxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ ADD ./tool_sheds_conf.xml $GALAXY_HOME/tool_sheds_conf.xml

# Script that enables easier downstream installation of tools (e.g. for different Galaxy Docker flavours)
ADD install_tools_wrapper.sh /usr/bin/install-tools
ADD with-galaxy.sh /usr/bin/with-galaxy

# script to install BioJS visualizations
ADD install_biojs_vis.sh /usr/bin/install-biojs
RUN chmod +x /usr/bin/install-tools /usr/bin/install-biojs && \
Expand Down
52 changes: 52 additions & 0 deletions galaxy/with-galaxy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

# Enable Test Tool Shed
export GALAXY_CONFIG_TOOL_SHEDS_CONFIG_FILE=$GALAXY_HOME/tool_sheds_conf.xml

if pgrep "supervisord" > /dev/null
then
echo "System is up and running. Starting with the installation."
export PORT=80
else
# start Galaxy
export PORT=8080
service postgresql start
install_log='galaxy_install.log'

# wait for database to finish starting up
STATUS=$(psql 2>&1)
while [[ ${STATUS} =~ "starting up" ]]
do
echo "waiting for database: $STATUS"
STATUS=$(psql 2>&1)
sleep 1
done

echo "starting Galaxy"
sudo -E -u galaxy unset $SUDO_UID; ./run.sh -d $install_log --pidfile galaxy_install.pid --http-timeout 3000

galaxy_install_pid=`cat galaxy_install.pid`
galaxy-wait -g http://localhost:$PORT -v --timeout 120
fi

exec "$@"

exit_code=$?

if [ $exit_code != 0 ] ; then
if [ "$2" == "-v" ] ; then
echo "Command failed, Galaxy server log:"
cat $install_log
fi
# exit $exit_code Galaxy should be shut down properly
fi

if ! pgrep "supervisord" > /dev/null
then
# stop everything
sudo -E -u galaxy ./run.sh --stop --pidfile galaxy_install.pid
rm $install_log
service postgresql stop
fi

exit $exit_code