Presenter notes contain extra information which might be useful if you intend to use these slides for teaching.
Press P
again to switch presenter notes off
Press C
to create a new window where the same presentation will be displayed.
This window is linked to the main window. Changing slides on one will cause the
slide to change on the other.
Useful when presenting.
Presenter notes contain extra information which might be useful if you intend to use these slides for teaching.
Press P
again to switch presenter notes off
Press C
to create a new window where the same presentation will be displayed.
This window is linked to the main window. Changing slides on one will cause the
slide to change on the other.
Useful when presenting.
GIE for visualization? Check that it is the right choice for your project
Admin Docs: https://docs.galaxyproject.org/en/master/admin/interactive_environments.html
galaxy.yml
interactive_environment_plugins_directory = config/plugins/interactive_environments
$ cd $GALAXY/lib/galaxy/web/proxy/js/$ npm install .
Advanced configurations: https://docs.galaxyproject.org/en/master/admin/interactive_environments.html
import
folder (datasets loaded into GIE by user)$ tree $GALAXY_ROOT/config/plugins/interactive_environments/helloworld/config/plugins/interactive_environments/helloworld/├── config│ ├── helloworld.ini│ ├── helloworld.ini.sample│ └── helloworld.xml├── static│ └── js│ └── helloworld.js└── templates └── helloworld.mako
Create GIE plugin XML file config/helloworld.xml
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE interactive_environment SYSTEM "../../interactive_environments.dtd"><!-- This is the name which will show up in the User's Browser --><interactive_environment name="HelloWorld"> <data_sources> <data_source> <model_class>HistoryDatasetAssociation</model_class> <!-- filter which types of datasets are appropriate for this GIE --> <test type="isinstance" test_attr="datatype" result_type="datatype">tabular.Tabular</test> <test type="isinstance" test_attr="datatype" result_type="datatype">data.Text</test> <to_param param_attr="id">dataset_id</to_param> </data_source> </data_sources> <params> <param type="dataset" var_name_in_template="hda" required="true">dataset_id</param> </params> <!-- Be sure that your entrypoint name is correct! --> <entry_point entry_point_type="mako">helloworld.mako</entry_point></interactive_environment>
Set up .ini
file, which controls docker interaction config/helloworld.ini.sample
[main]# Unused[docker]# Command to execute docker. For example `sudo docker` or `docker-lxc`.#command = docker {docker_args}# The docker image name that should be started.image = hello-ie# Additional arguments that are passed to the `docker run` command.#command_inject = --sig-proxy=true -e DEBUG=false# URL to access the Galaxy API with from the spawn Docker container, if empty# this falls back to galaxy.yml's galaxy_infrastructure_url and finally to the# Docker host of the spawned container if that is also not set.#galaxy_url =# The Docker hostname. It can be useful to run the Docker daemon on a different# host than Galaxy.#docker_hostname = localhost[..]
templates/helloworld.mako
ini
fileCUSTOM
to be passed to containerhda
)<%namespace name="ie" file="ie.mako" /><%# Sets ID and sets up a lot of other variablesie_request.load_deploy_config()# Define a volume that will be mounted into the container.# This is a useful way to provide access to large files in the container,# if the user knows ahead of time that they will need it.user_file = ie_request.volume( hda.file_name, '/import/file.dat', how='ro')# Launch the IE. This builds and runs the docker command in the background.ie_request.launch( volumes=[user_file], env_override={ 'custom': '42' })[..]
(continued)
[..]# Only once the container is launched can we template our URLs. The ie_request# doesn't have all of the information needed until the container is running.url = ie_request.url_template('${PROXY_URL}/helloworld/')%><html><head>${ ie.load_default_js() }</head><body><script type="text/javascript">${ ie.default_javascript_variables() }var url = '${ url }';${ ie.plugin_require_config() }requirejs(['interactive_environments', 'plugin/helloworld'], function(){ load_notebook(url);});</script><div id="main" width="100%" height="100%"></div></body></html>
/import
folder of container)FROM ubuntu:14.04# These environment variables are passed from Galaxy to the container# and help you enable connectivity to Galaxy from within the container.# This means your user can import/export data from/to Galaxy.ENV DEBIAN_FRONTEND=noninteractive \ API_KEY=none \ DEBUG=false \ PROXY_PREFIX=none \ GALAXY_URL=none \ GALAXY_WEB_PORT=10000 \ HISTORY_ID=none \ REMOTE_HOST=noneRUN apt-get -qq update && \ apt-get install --no-install-recommends -y \ wget procps nginx python python-pip net-tools nginx# Our very important scripts. Make sure you've run `chmod +x startup.sh# monitor_traffic.sh` outside of the container!ADD ./startup.sh /startup.shADD ./monitor_traffic.sh /monitor_traffic.sh# /import will be the universal mount-point for IPython# The Galaxy instance can copy in data that needs to be present to the# containerRUN mkdir /import[..]
server { listen 80; server_name localhost; # Note the trailing slash used everywhere! location PROXY_PREFIX/helloworld/ { proxy_buffering off; proxy_pass http://127.0.0.1:8000/; proxy_redirect http://127.0.0.1:8000/ PROXY_PREFIX/helloworld/; }}
startup.sh
file which starts our directory listing service#!/bin/bash# First, replace the PROXY_PREFIX value in /proxy.conf with the value from# the environment variable.sed -i "s|PROXY_PREFIX|${PROXY_PREFIX}|" /proxy.conf;# Then copy into the default location for ubuntu+nginxcp /proxy.conf /etc/nginx/sites-enabled/default;# Here you would normally start whatever service you want to start. In our# example we start a simple directory listing service on port 8000cd /import/ && python -mSimpleHTTPServer &# Launch traffic monitor which will automatically kill the container if# traffic stops/monitor_traffic.sh &# And finally launch nginx in foreground mode. This will make debugging# easier as logs will be available from `docker logs ...`nginx -g 'daemon off;'
$ cd hello-ie$ docker build -t hello-ie .
Try it yourself: https://github.com/hexylena/hello-world-interactive-environment
This material is the result of a collaborative work. Thanks to the Galaxy Training Network and all the contributors!
Author(s) | Saskia Hiltemann Björn Grüning Helena Rasche |
Reviewers |
Tutorial Content is licensed under Creative Commons Attribution 4.0 International License.
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |