Based on integrate the container with conda.
-
We want to use rstudio interactively on RCC just like on our local computers. e.g. easy access to files on server, draw and check plots easily, upload and download files within rstudio, user-friendly UI.
-
One way provided is through ThinLinc. But ThinLinc sometimes is slow; hard to copy-paste; not good UI, etc.
Therefore, we need another way to be able to launch rstudio on RCC.
-
This repo implements rstudio server on RCC through a singularity container.
-
Be able to run rstudio on computation node by sumbiting a SLURM job.
-
Intergrate rstudio with conda for easy package management.
... to your RCC folder. I store it in my scratch
space.
module load singularity
To make it work for your own use, several parameters needed to modify. All modifications will be made in file singularity/run_singularity.sh
.
- Specify the path to a conda env to parameter
$CONDA_PREFIX
.
This conda env store all packages you will need. You can use an existing conda env, or create a one as in file conda_env_config.sh
.
- Speficy the path to the rstudio singularity container to parameter
$CONTAINER
.
-
Download the container by
singularity pull docker://rocker/rstudio:latest
to get the latest version. See here for the container's info. -
Move the downloaded file
rstudio_latest.sif
to the path you assigned to$CONTAINER
. I would recommendsingularity/rstudio_latest.sif
.
- Set your login password to parameter
$USER_psw
.
There are two ways to run rstudio server. One is on login node, the other is on on computation node by submitting a SLURM job. I give below how to run in two ways. I would recommend running jobs on computation node as in way 1.
- Run studio on computation node.
-
sbatch /path/to/your_repo/singularity/run_singularity.sh
This is to submit a slurm job. Configure the slurm resource parameters in the header of
singularity/run_singularity.sh
. -
Check the slurm output file
rstudio-server.job
. The content is basically the same as the following figure.Use the info highlighted in blue rectangle.
ssh -N -L ...
in your local terminal.- Open the link in your browser.
- Run this container on login node.
-
bash /path/to/your_repo/singularity/run_singularity.sh
-
You will see something like highlighted by orange rectangle in the above figure,
-
Open the link in your browser.
User name and password are in the figure.
To understand more about how this works, see ref below:
-
Also thanks to Pheonix Mu and Chao Dai for sharing their settings.