You can use our service desk portal for getting RIS support. RIS also offers 15 min. virtual office hours session Mon-Thru..
Rstudio
Compute Resources
Have questions or need help with compute, including activation or issues? Follow this link.
Docker Usage
The information on this page assumes that you have a knowledge base of using Docker to create images and push them to a repository for use. If you need to review that information, please see the links below.
Docker Basics: Building, Tagging, & Pushing A Custom Docker Image
storageN
The use of
storageNwithin these documents indicates that any storage platform can be used.Currently available storage platforms:
storage1
storage2
storage3
Image Details
Docker image hosted at http://ghcr.io/washu-it-ris/rstudio
noVNC (https://novnc.com/info.html )
RStudio (https://rstudio.com/ )
Optional: Seurat (https://satijalab.org/seurat/ )
Initial Setup for Package Installation
You $HOME directory is limited to a 10GB of space. This can cause a space issue if the RStudio package directory is not configured. This is a highly recommended step.
You can do so by first creating a file in your home directory called .Rprofile, if it doesn't already exist. This file will be loaded automatically when RStudio starts.
Step 1.
Log in to Compute1 via the terminal, then back up .Rprofile file (if already exists)
mv ~/.Rprofile ~/.Rprofile.bakStep 2.
Create a new.Rprofilefile.
> touch ~/.RprofileStep 3.
Next, create a folder in your storage allocation for R packages.
mkdir /storageN/fs1/${STORAGE_ALLOCATION}/Active/R_libraries/Storage Allocation Name: make sure to use the correct path in the examples above.
Replace storageN with the storage platform: storage1, storage2, or storage3.
Replace ${STORAGE_ALLOCATION} with the name of your storage allocation.
Step 4.
Use any command line based text edit such as vim or nano to edit the .Rprofile file and add the contents below. You can also use the Files Browser in the On-Demand portal to edit this file.
vals <- paste('/storageN/fs1/${STORAGE_ALLOCATION}/Active/R_libraries/',paste(R.version$major,R.version$minor,sep="."),sep="")
for (devlib in vals) {
if (!file.exists(devlib))
dir.create(devlib)
x <- .libPaths()
x <- .libPaths(c(devlib,x))
}
rm(x,vals)
Example of .Rprofile in $HOME directory:
Occasionally, issues and conflicts with the .Rprofile occurs when deploying RStudio instances via different means simultaneously, such as the Open OnDemand app and the THPC module app. See the troubleshooting section for steps on how to recover.
After the .Rprofile file is created, you can install additional R packages using install.packages(). Please see https://www.rdocumentation.org/packages/utils/versions/3.6.2/topics/install.packages for more information.
Please note that R installs a default set of packages during installation. The list of installed packages can be viewed in the lower-right pane of RStudio, with currently active packages indicated by a checkmark.
Interactive GUI Session
Interactions GUI sessions are done via the
Custom noVNC Imageapplication in Open On Demand (OOD).You can find out more about OOD here: Compute1 QuickstartArchived.
There are two fields beyond the basics that will need information specific to this image.
Environment Variables
Docker Image
Environment Variables
This information should be space-separated in the field.
PASSWORD=passwordOptional variables
GUI display size. This can be changed with the following variables.
Width default: 1024
Height default: 768
DISPLAY_WIDTH=<width> DISPLAY_HEIGHT=<height>
Docker Image
ghcr.io/washu-it-ris/rstudio:<tag>RStudio Docker Tag:
The <tag> will refer to the RStudio version in the Docker container. Please click here to see a current list of available RStudio versions and their corresponding Docker images.
Fill out the remaining fields with the appropriate information (as explained in the quick start).
Launch the job through the methods described in the quick start.
Once in an interactive RStudio session using the following command:
rstudioYou should now see the RStudio GUI
You can safely ignore XDG_RUNTIME_DIR and the "Session version X does not match server version X" warning that may appear when starting RStudio.
Interactive Command-Line Session
If you wish to use R in an interactive command-line session, you can do so with the following commands.
export LSF_DOCKER_VOLUMES="/storage1/fs1/${STORAGE_ALLOCATION}/Active:/storage1/fs1/${STORAGE_ALLOCATION}/Active"
bsub -Is -q general-interactive -a 'docker(ghcr.io/washu-it-ris/rstudio:<tag>)' /bin/bashAvailability Through Open On Demand (OOD)
Interactive Application: RStudio
Start an instance of RStudio (interactive application: RStudio) in OOD.
RStudio will start at launch.
Interactive Application: Custom noVNC Image
Start an instance of Custom noVNC Image in OOD, denoting the preferred RStudio image and tag.
Launch the session and enter RStudio in the terminal.
Accessing Data from Storage in the OOD RStudio App
Make sure you have provided your storage allocation path in the MOUNTS field of the open-ondemand portal (in the correct format), one example would be:
/storageN/fs1/${STORAGE_ALLOCATION}/Active:/storageN/fs1/${STORAGE_ALLOCATION}/ActiveOnce an RStudio session starts, change the current working directory, run the command below in the left-hand side command pane: setcwd('/storageN/fs1/${STORAGE_ALLOCATION}/Active')
Then, on the right-hand side, under the files tab → Click Gear icon 'More' → Click 'Go To Working Directory.'
Do not forget to replace the actual path in above command/places
RStudio using THPC
Start an instance of THPC (interactive application: Compute RIS Desktop) in OOD.
Load and launch RStudio Server through the terminal.
module load RStudio-Server
rstudio-server startAfter launching RStudio, you need to open a new shell.
Right-click in the noVNC window.
Select “Application” > “Shell” > “Bash”
Finally, you need to load and launch Firefox, then connect to RStudio in the new shell.
module load Firefox
firefox http://localhost:8787
Extending the RStudio Docker Image
The steps in the initial setup will work for some but not all R packages. For example, devtools requires the following dependencies to be installed in the Docker image: build-essential, libcurl4-gnutls-dev, libxml2-dev, and libssl-dev.
This will require extending the existing Docker image to include these dependencies. Below is a sample Dockerfile that includes these dependencies. Please see this section for more information on setting the Docker tag in the Dockerfile.
Dockerfile Best Practices:
It is recommended to set the Docker tag to a specific R version. This will prevent the use of an updated version of the RIS RStudio image, which may have compatibility issues with previously installed R packages. As an example, in the Dockerfile below, the tag is set to 3.6.3.
FROM gcr.io/ris-registry-shared/rstudio:3.6.3
# install packages using apt-get
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update --fix-missing && \
apt-get install -y build-essential \
libcurl4-gnutls-dev libxml2-dev \
libssl-dev && \
apt-get clean
# extend image to include tidyverse and devtools R packages
RUN R -e "install.packages(c('devtools','tidyverse'), dependencies=TRUE)"Please see our Docker Tutorial for more information on building and pushing a Docker image. You can also open a ticket at our Service Desk for further help.
Troubleshooting
RStudio crashes as soon as a command is executed.
This is due to a conflict with the Rprofile or the local share caused by a prior crash, or, on rare occasions, by using RStudio from different platforms, from the Open OnDemand apps, or as a THPC module.
Don't start a new session. Instead, close the RStudio app or instance.
Go to the terminal.
If the Rprofile exists in the home directory,
Move the Rprofile to another location or rename it.
mv $HOME/.Rprofile $HOME/.Rprofile-backupThen launch a new instance of RStudio.
If the issue persists, delete or rename the
$HOME/.local/share/rstudio.mv $HOME/.local/share/rstudio $HOME/.local/share/rstudio-backupLaunch a new instance of RStudio.
Available RStudio Versions
Current Version:
Stand-alone Docker Image Version
ghcr.io/washu-it-ris/rstudio
4.4.0
THPC Version
4.2.1