diff --git a/config/plugins/interactive_environments/hicbrowser/config/allowed_images.yml.sample b/config/plugins/interactive_environments/hicbrowser/config/allowed_images.yml.sample new file mode 100644 index 00000000000..e0737daf042 --- /dev/null +++ b/config/plugins/interactive_environments/hicbrowser/config/allowed_images.yml.sample @@ -0,0 +1,11 @@ +# This file lists acceptable images to allow runing. +# +# This allows you, the admin, to create multiple flavours +# for your users to run. E.g. maybe you need a specific branded flavour, +# you can create the image based on our default image and add the +# appropriate files. +--- +- + image: bgruening/docker-hicbrowser + description: | + A simple web browser to visualize Hi-C and other genomic tracks diff --git a/config/plugins/interactive_environments/hicbrowser/config/hicbrowser.ini.sample b/config/plugins/interactive_environments/hicbrowser/config/hicbrowser.ini.sample new file mode 100644 index 00000000000..9347211cc48 --- /dev/null +++ b/config/plugins/interactive_environments/hicbrowser/config/hicbrowser.ini.sample @@ -0,0 +1,46 @@ +[main] +# Following options are ignored if using the Galaxy dynamic proxy but +# are useful if mapping a range of ports for environment consumption. +#password_auth = False +#ssl = False + +[docker] +# Command to launch docker container. For example `sudo docker` or `docker-lxc`. +# If you need to use a command like `sg` you can do that here, just be sure to +# wrap all of the docker portion in single quotes. E.g. `sg 'docker' 'docker {docker_args}'` +# +# It is recommended that you use command_inject if you need to inject +# additional parameters. This command string is re-used for a `docker inspect` +# command and will likely cause errors if it is extensively modified, past the +# usual group/sudo changes. +#command = docker {docker_args} + +# The image argument was moved to "allowed_images.yml.sample" + +# Additional arguments that are passed to the `docker run` command. +command_inject = --sig-proxy=true -e DEBUG=false -e KILL_MODE=True -e DEFAULT_CONTAINER_RUNTIME=120 + +# URL to access the Galaxy API with from the spawn Docker containter, if empty +# this falls back to galaxy.ini'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 + +# Try to set the tempdirectory to world execute - this can fix the issue +# where 'sudo docker' is not able to mount the folder otherwise. +# "finalize namespace chdir to /import permission denied" +#wx_tempdir = False + +# Overwride the IE tempdirectory. This can be useful if you regular tempdir is +# located on an NFS share, which does not work well as Docker volume. In this case +# you can have a shared sshfs share which you can use as temporary directory to +# share data between the IE and Galaxy. +#docker_galaxy_temp_dir = None + +# If your Docker container exposes more then one port, Galaxy needs to know to +# which ports it needs to connect. With this option you can specify the port number +# inside your container to which Galaxy should connect. +docker_connect_port = 80 diff --git a/config/plugins/interactive_environments/hicbrowser/config/hicbrowser.xml b/config/plugins/interactive_environments/hicbrowser/config/hicbrowser.xml new file mode 100644 index 00000000000..db5c3670dd5 --- /dev/null +++ b/config/plugins/interactive_environments/hicbrowser/config/hicbrowser.xml @@ -0,0 +1,15 @@ + + + + + + HistoryDatasetAssociation + binary.CompressedArchive + dataset_id + + + + dataset_id + + hicbrowser.mako + diff --git a/config/plugins/interactive_environments/hicbrowser/static/js/hicbrowser.js b/config/plugins/interactive_environments/hicbrowser/static/js/hicbrowser.js new file mode 100644 index 00000000000..9d67802390d --- /dev/null +++ b/config/plugins/interactive_environments/hicbrowser/static/js/hicbrowser.js @@ -0,0 +1,12 @@ +// Load an interactive environment (IE) from a remote URL +// @param {String} hicexplorer_access_url: the URL embeded in the page and loaded +function load_hicexplorer(hicexplorer_access_url){ + // When the page has completely loaded... + $( document ).ready(function() { + // Test if we can access the GIE, and if so, execute the function + // to load the GIE for the user. + test_ie_availability(hicexplorer_access_url, function(){ + append_notebook(hicexplorer_access_url); + }); + }); +} diff --git a/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako b/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako new file mode 100644 index 00000000000..aeac7f8fb8a --- /dev/null +++ b/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako @@ -0,0 +1,49 @@ +<%namespace name="ie" file="ie.mako" /> +<% + # Sets ID and sets up a lot of other variables + ie_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. + + import os + mount_path = hda.file_name + data_vol = ie_request.volume(mount_path, '/data/data_pack.tar.gz', how='rw') + + # Add all environment variables collected from Galaxy's IE infrastructure + # Launch the IE. + + ie_request.launch( + image = trans.request.params.get('image_tag', None), + additional_ids = trans.request.params.get('additional_dataset_ids', None), + volumes = [data_vol] + ) + + # 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}') + +%> + + + ${ ie.load_default_js() } + + + +
+
+ +