Deploying ExploreModelMatrix on a Shiny Server (original) (raw)

Why deploying ExploreModelMatrix on a Shiny server?

While the installation of ExploreModelMatrix locally is a relatively straightforward operation, sometimes you might require an instance of it running on a server, e.g. for teaching purposes, or to provide a working version of it because you or your collaborators are lacking admin rights.

One possible solution would be to access the instance running at http://shiny.imbei.uni-mainz.de:3838/ExploreModelMatrix, which we provide also for demonstration purposes. Alternatively, you might need to deploy ExploreModelMatrix for internal use, or with a different set of examples/functionality. This vignette details the steps to do so - it might still require the intervention of your local IT service, and some degree of tech savvyness.

How to deploy ExploreModelMatrix

Step 2: setup ExploreModelMatrix

You need to:

Installing ExploreModelMatrix

You need first to install Bioconductor

sudo su - -c "R -e \"install.packages('BiocManager')\""

Once that is done, you can install ExploreModelMatrix with

sudo su - -c "R -e \"BiocManager::install('ExploreModelMatrix')\""

You can also install the development version of ExploreModelMatrix from GitHub with

# install remotes first
sudo su - -c "R -e \"BiocManager::install('remotes')\""
# and then ExploreModelMatrix
sudo su - -c "R -e \"BiocManager::install('csoneson/ExploreModelMatrix')\""

Keep in mind that if you are running the server as root, you could simply open R in the terminal and install the required packages with

## To be done once
install.packages("BiocManager")
BiocManager::install("ExploreModelMatrix")
## For the devel version on GitHub
BiocManager::install("csoneson/ExploreModelMatrix")

Setup ExploreModelMatrix on the server

You essentially need to do two things:

library("ExploreModelMatrix")
ExploreModelMatrix()
server {
  listen 3838;

  #...

  ### FROM HERE
  location /ExploreModelMatrix {
    # Run this location in 'app_dir' mode, which will host a single Shiny
    # Application available at '/srv/shiny-server/myApp'
    app_dir /srv/shiny-server/ExploreModelMatrix;

    # Log all Shiny output to files in this directory
    log_dir /var/log/shiny-server/ExploreModelMatrix;

    # When a user visits the base URL rather than a particular application,
    # an index of the applications available in this directory will be shown.
    directory_index off;

    # recommended, to wait for the application to start
    app_init_timeout 250;
  }
  ### TO HERE

  # ...
}

You might need to restart the Shiny Server (systemctl restart shiny-server on Ubuntu). Then you should be good to go!

Visit http://your.server.address:3838/ExploreModelMatrix for your personal running instance.

ExploreModelMatrix at the IMBEI

http://shiny.imbei.uni-mainz.de:3838/ExploreModelMatrix is the address for the public instance of ExploreModelMatrix on the Shiny Server I manage at the Institute of Medical Biostatistics, Epidemiology and Informatics.

The relevant setup of that machine is the following (in case you are asking what specs you need):

lsb_release -a

  No LSB modules are available.
  Distributor ID: Ubuntu
  Description: Ubuntu 16.04.2 LTS
  Release: 16.04
  Codename: xenial