bbglab / bbgwiki

Website with info of all the tools and data used in the bbglab
2 stars 2 forks source link

Tools | Rstudio singularity containers #75

Open ivillasante opened 6 months ago

ivillasante commented 6 months ago

Rstudio Server in Singularity

A wiki entrance explaining how to download and setup a Singularity container for R dev. (Rstudio server / Shiny server / other R stuff) in the cluster.

It seems that some of the members of the group have had issues with reproducibility working with R and the main idea is to propose a standard protocol to abstract and potentially remove all the complexity of handling system dependencies and package versions with containers. A collateral effect is being able to very easily run rstudio server directly in the cluster. The entrance could have the following main points:

  1. Where to find pre-built development containers with different flavours (tidyverse, vep, bioconductor, shiny, single-cell, cuda, pyenv and more) rocker project
  2. How to download the images
  3. How to modify already existing images to build your own customized versions.
  4. Where to store those images (maybe a cloud-based solution (aws / google cloud / dockerhub/ github registry) or an inhouse registry that could be installed and kept on a server or unused workstation ) check Singularity Registry Server
  5. How to download the images with singularity in the cluster (may vary according whatever is chosen on step 4) It would be nice to find a common space in the cluster where to store the cahce maybe something like /workspace/temp/.cache/containers
  6. How to start the server in the cluster
  7. How to connect to the server remotely from your local machine. (There are many options for 6 & 7, but interactive + ssh port forward has been tested successfully by myself)
ivillasante commented 5 months ago

Rstudio Server in Singularity

A wiki entrance explaining how to download and setup a Singularity container for R dev. (Rstudio server / Shiny server / other R stuff) in the cluster.

It seems that some of the members of the group have had issues with reproducibility working with R and the main idea is to propose a standard protocol to abstract and potentially remove all the complexity of handling system dependencies and package versions with containers. A collateral effect is being able to very easily run rstudio server directly in the cluster. The entrance could have the following main points:

  1. Where to find pre-built development containers with different flavours (tidyverse, vep, bioconductor, shiny, single-cell, cuda, pyenv and more) rocker project
  2. How to download the images
  3. How to modify already existing images to build your own customized versions.
  4. Where to store those images (maybe a cloud-based solution (aws / google cloud / dockerhub/ github registry) or an inhouse registry that could be installed and kept on a server or unused workstation ) check Singularity Registry Server
  5. How to download the images with singularity in the cluster (may vary according whatever is chosen on step 4) It would be nice to find a common space in the cluster where to store the cahce maybe something like /workspace/temp/.cache/containers
  6. How to start the server in the cluster
  7. How to connect to the server remotely from your local machine. (There are many options for 6 & 7, but interactive + ssh port forward has been tested successfully by myself)
  1. The part of setting up a service in the cluster is the same as jupyter nb. ssh -> screen -> interactive -> start service
  2. The part of starting Rstudio involves some steps:
    • Downloading the singularity image
    • Generating temp and database files,
    • Configuring the path to the r packages library (Optional)
    • configuring ports and binds in the container
    • Setting up the password
    • starting rstudio server with singularity exec command

Here is the script I made which can be executed straight away:

The part of connecting to the active service is just a port forward ssh -N -L local_port:bbgnXX_node:remote_port -p 22022 user@bbgcluster