Changes between Version 1 and Version 2 of cypress/RunningRStudioWithSingularity


Ignore:
Timestamp:
02/05/26 14:50:37 (2 days ago)
Author:
Carl Baribault
Comment:

Added content, Work In Progress

Legend:

Unmodified
Added
Removed
Modified
  • cypress/RunningRStudioWithSingularity

    v1 v2  
    11[[PageOutline]]
    22= Running RStudio with Singularity on Cypress =
    3 Coming soon
     3
     4== Login using port forwarding ==
     5
     6See for example [[https://wiki.hpc.tulane.edu/trac/wiki/cypress/JupyterNode | Jupyter notebook]].
     7
     8Make note of your choice of ports in the above for your use in the following.
     9
     10Here we assume the choices '''8888''' and '''12345'''.
     11
     12== Start the interactive session - with port forwarding ==
     13
     14First, start an interactive session.
     15
     16'''For Workshop''' :
     17If your account is in the group '''workshop''', please use the following.
     18
     19{{{
     20[tulaneID@cypress1 ~]$idev --partition=workshop7 -c 2 --port=12345:8888 # request 2 cores in the partition workshop7
     21Requesting 1 node(s)  task(s) to normal queue of workshop7 partition
     221 task(s)/node, 2 cpu(s)/task, 0 MIC device(s)/node
     23Time: 0 (hr) 60 (min).
     240d 0h 60m
     25Submitted batch job 3287405
     26JOBID=3287405 begin on cypress01-060
     27--> Creating interactive terminal session (login) on node cypress01-060.
     28--> You have 0 (hr) 60 (min).
     29--> Assigned Host List : /tmp/idev_nodes_file_tulaneID
     30Last login: Tue Jan 13 11:58:39 2026 from cypress1.cm.cluster
     31[tulaneID@cypress01-060 ~]$
     32}}}
     33
     34'''Non-workshop'''
     35{{{
     36[tulaneID@cypress1 ~]idev --partition=centos7 --port=12345:8888 # start an interactive session in the partition centos7
     37Requesting 1 node(s)  task(s) to normal queue of centos7 partition
     381 task(s)/node, 20 cpu(s)/task, 0 MIC device(s)/node
     39Time: 0 (hr) 60 (min).
     400d 0h 60m
     41Submitted batch job 3288388
     42JOBID=3288388 begin on cypress01-066
     43--> Creating interactive terminal session (login) on node cypress01-066.
     44--> You have 0 (hr) 60 (min).
     45--> Assigned Host List : /tmp/idev_nodes_file_tulaneID
     46Last login: Tue Jan 13 14:09:07 2026 from cypress2.cm.cluster
     47[tulaneID@cypress01-066 ~]$
     48}}}
     49
     50
     51== Construct and check the image file for RStudio ==
     52Then proceed as follows to construct the container image file '''rstudio_latest.sif''' and check the R version.
     53
     54{{{
     55[tulaneID@cypress01-060 ~]$module load singularity/3.9.0 # load the singularity module
     56[tulaneID@cypress01-060 ~]$singularity pull docker://rocker/rstudio:latest # takes a few minutes to construct file r-base_latest.sif
     57...
     58[tulaneID@cypress01-060 ~]$singularity exec rstudio_latest.sif R --version # check the version of R
     59R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
     60Copyright (C) 2025 The R Foundation for Statistical Computing
     61Platform: x86_64-pc-linux-gnu
     62
     63R is free software and comes with ABSOLUTELY NO WARRANTY.
     64You are welcome to redistribute it under the terms of the
     65GNU General Public License versions 2 or 3.
     66For more information about these matters see
     67https://www.gnu.org/licenses/.
     68
     69[tulaneID@cypress01-066 ~]$
     70}}}
     71
     72== Start the RStudio server ==
     73
     74
     75 * Setup local authentication
     76
     77In order to run the RStudio server, you'll first need to construct a local database for authentication - one time only - as in the following.
     78
     79{{{
     80echo "auto-create=1" > database.conf
     81}}}
     82
     83 * Start the RStudio server
     84
     85Start the RStudio server, '''rserver''', via the following.
     86
     87Note the use of the option '''--www-port''' to match your choice of local port number in the above.
     88
     89
     90{{{
     91[tulaneID@cypress01-066 ~]$singularity exec -B /lustre:/lustre --scratch /run,/var/lib/rstudio-server --workdir $(mktemp -d) tidyverse_latest.sif  rserver --www-address=0.0.0.0 --www-port=8888 --server-user=$(whoami) --database-config-file $PWD/database.conf
     92}}}
     93
     94== Use RStudio on your browser ==
     95
     96 * Go to your browser
     97
     98With the RStudio server running in your Cypress interactive session, you can now use the RStudio interface on your browser
     99
     100Open a browser window or tab on your local machine and type the following.
     101
     102Be sure to match your choice of local port number from above, substituting for '''8888''' as needed.
     103
     104{{{
     105localhost:8888/
     106}}}
     107
     108 * Use RStudio in your browser
     109
     110Here is RStudio starting in your browser.
     111
     112Note that this and all future responses may be slow due to your network latency.
     113
     114[[Image(RStudioInBrowserStartup.png)]]