Last active
August 29, 2015 14:11
-
-
Save mlovci/4bc35649bde8e6795a72 to your computer and use it in GitHub Desktop.
Minimal for Galaxy(docker) + IPython(docker)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
RewriteEngine On | |
SetEnvIf Request_URI "/ipython/([0-9]+)/api/kernels/" DOCKER_PORT=$1 | |
RewriteRule ^/ipython/([0-9]+)/api/kernels/(.*)$ ws://127.0.0.1:$1/ipython/$1/api/kernels/$2 [P,L] | |
RewriteRule ^/ipython/([0-9]+)/(.*)$ http://localhost:$1/ipython/$1/$2 [P,L] | |
<Location /ipython/> | |
# spoof headers to make notepad accept the request as coming from the same origin | |
Header set Origin "http://127.0.0.1:%{DOCKER_PORT}e" | |
RequestHeader set Origin "http://127.0.0.1:%{DOCKER_PORT}e" | |
</Location> | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#this is to address this issue: https://github.com/jpetazzo/dind/issues/19 | |
ensure_loop(){ | |
num="$1" | |
dev="/dev/loop$num" | |
if test -b "$dev"; then | |
echo "$dev is a usable loop device." | |
return 0 | |
fi | |
echo "Attempting to create $dev for docker ..." | |
if ! mknod -m660 $dev b 7 $num; then | |
echo "Failed to create $dev!" 1>&2 | |
return 3 | |
fi | |
return 0 | |
} | |
LOOP_A=$(losetup -f) | |
LOOP_A=${LOOP_A#/dev/loop} | |
LOOP_B=$(expr $LOOP_A + 1) | |
ensure_loop $LOOP_A | |
ensure_loop $LOOP_B | |
sudo service docker stop | |
dmsetup mknodes | |
sudo service docker start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM bgruening/galaxy-stable:dev | |
RUN git clone https://github.com/bgruening/galaxy-ipython.git config/plugins/visualizations/ipython | |
ADD ./startup /usr/bin/startup | |
ADD ./clean.sh /usr/bin/clean.sh | |
RUN chmod 755 /usr/bin/startup && chmod 755 /usr/bin/clean.sh | |
RUN sudo apt-get install -y apache2 | |
ADD ./apache_conf /apache_conf | |
RUN cat /apache_conf >> /etc/apache2/apache2.conf | |
RUN a2enmod rewrite && a2enmod proxy && a2enmod proxy_http && a2enmod proxy_wstunnel && a2enmod setenvif && a2enmod headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#for UCSC files | |
sudo ifconfig eth0 mtu 1500 | |
cd /galaxy-central/ | |
# If /export/ is mounted, export_user_files file moving all data to /export/ | |
# symlinks will point from the original location to the new path under /export/ | |
# If /export/ is not given, nothing will happen in that step | |
umount /var/lib/docker | |
python ./export_user_files.py $PG_DATA_DIR_DEFAULT | |
/usr/bin/clean.sh | |
# Configure SLURM with runtime hostname. | |
/home/galaxy/venv/bin/python /usr/sbin/configure_slurm.py | |
# Try to guess if we are running under --privileged mode | |
if mount | grep "/proc/kcore"; then | |
echo "Disable Galaxy Interactive Environments. Start with --privileged to enable IE's." | |
export GALAXY_CONFIG_INTERACTIVE_ENVIRONMENT_PLUGINS_DIRECTORY="" | |
/usr/bin/supervisord | |
sleep 5 | |
else | |
echo "Enable Galaxy Interactive Environments." | |
export GALAXY_CONFIG_INTERACTIVE_ENVIRONMENT_PLUGINS_DIRECTORY="config/plugins/interactive_environments" | |
# if [ x$DOCKER_PARENT == "x" ]; then | |
#build the docker in docker environment | |
bash /root/cgroupfs_mount.sh | |
/usr/bin/supervisord | |
sleep 5 | |
sudo service docker stop | |
supervisorctl start docker | |
# else | |
# #inheriting /var/run/docker.sock from parent, assume that you need to | |
# #run docker with sudo to validate | |
# echo "galaxy ALL = NOPASSWD : ALL" >> /etc/sudoers | |
# /usr/bin/supervisord | |
# sleep 5 | |
# fi | |
fi | |
#if [ `echo ${GALAXY_LOGGING:-'no'} | tr [:upper:] [:lower:]` = "full" ] | |
# then | |
# tail -f /var/log/supervisor/* /var/log/nginx/* /home/galaxy/*.log | |
# else | |
# tail -f /home/galaxy/*.log | |
#fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hi there | |
you guy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment