Skip to content

Latest commit

 

History

History
264 lines (168 loc) · 8.51 KB

GIE_Shiny.md

File metadata and controls

264 lines (168 loc) · 8.51 KB

Install a Shiny Galaxy Interactive Environment

Requirements :

  • node 0.10.X - 0.11.X (v0.10.48 tested)
  • nvm (v0.33.8)
  • Docker

Note : Be careful of the node version. Node has recently upgraded, and the galaxy proxy is pinned to an old version of sqlite3. As such you’ll currently need to have an older version of Node available (0.10.X - 0.11.X vintage). Please note that if you have NodeJS installed under Ubuntu, it often installs to /usr/bin/nodejs, whereas npm expects it to be /usr/bin/node. You will need to create that symlink yourself. cf "Install the requirements".

Install the requirements

1. Install Docker (v1.13.1)

sudo apt-get install docker.io

2. Install node (if node v0.10.X-0.11.X already installed, go to the next section)

sudo apt-get install npm

3. Install nvm to change node version

To install or update nvm, you can use the install script using cURL:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

or Wget:

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

The script clones the nvm repository to ~/.nvm and adds the source line to your profile (~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc).

So, you need to source your profile : source ~/.bashrc

You can check if nvm is correctly installed and if you have the good nvm version (v0.33.8) with : nvm --version

Then, install node v0.10.48 (version tested):

nvm install v0.10.48

Please note that npm expects node to be in /usr/bin/node, so you should create a symlink from node v0.10.48 to /usr/bin/node.

ln -s $HOME_PATH/.nvm/v0.10.48/bin/node /usr/bin/node

Finally you should have node v0.10.48 with the command node --version

Install the Shiny Galaxy Interactive Environment (GIE) (From the "How to install a Shiny environment" of CARPEM)

1. Clone this repository.

git clone https://github.com/RomainDallet/gie-shiny-installation.git

2. Copy the folder shiny in $GALAXY_PATH/config/plugins/interactive_environments/.

cp -r shiny $GALAXY_PATH/config/plugins/interactive_environments/

3. In the shiny/config/allowed_images.yml, you can define your docker image.

4. In the shiny/config/shiny.xml, you can define for which input your Shiny environment will be available.

5. In the templates folder, you can define how the data are mounted inside your Shiny app in the shiny.mako.

Configure Node.js proxy (From the "Exercise - Running the Jupyter Galaxy Interactive Environment (GIE)" of dagobah-training)

1. Configure proxy

First, check your node version by running the command : node --version

If you have not the node command or your version is not between the 0.10.X - 0.11.X, follow the "Install the requirements" part.

Then you need to install the proxy in your Galaxy instance.:

cd $GALAXY_PATH/lib/galaxy/web/proxy/js
npm install

Next, edit $GALAXY_PATH/config/galaxy.ini and change the following options:

interactive_environment_plugins_directory = $GALAXY_PATH/config/plugins/interactive_environments
dynamic_proxy_external_proxy = True
dynamic_proxy_manage = True
dynamic_proxy_bind_port = 8800
dynamic_proxy_debug = True
dynamic_proxy_session_map = $GALAXY_PATH/config/gie_proxy_session_map.sqlite
dynamic_proxy_prefix = gie_proxy
dynamic_proxy_bind_ip = 127.0.0.1

2. Configure nginx

We'll now proxy the Node.js proxy with nginx. This is done by adding to /etc/nginx/sites-available/galaxy. Inside the server {...} block, add:

    # Global GIE configuration
    location /gie_proxy {
        proxy_pass http://127.0.0.1:8800/gie_proxy;
        proxy_redirect off;
    }

    # Shiny
    location /gie_proxy/shiny/ {
        proxy_pass http://127.0.0.1:8800/;
        proxy_redirect off;
    }

Once saved, restart nginx to reread the config:

  • /etc/init.d/nginx restart or sudo systemctl restart nginx
  • sh run.sh

If it's work, you may can load a Shiny Interactive Environment from a txt file.

Note : You must have an account and be logged in to access interactive environments. Just create one!