Launch R on Jupyter
Getting started
On Cypress, download the script.
git clone https://gitlab.tulane.edu/fuji/launch-r-jupyter.git
Copy LaunchR-Jupyter.sh to the directory where you want to run the Jupyter Notebook, and edit it to customize the resource request to your needs. The default settings are shown below:
#SBATCH --qos=normal # Quality of Service #SBATCH --partition=centos7 # partition #SBATCH --job-name=jupyter # Job Name #SBATCH --time=8:00:00 # WallTime #SBATCH --nodes=1 # Number of Nodes #SBATCH --ntasks-per-node=1 # Number of tasks (MPI processes) #SBATCH --cpus-per-task=20 # Number of threads per task (OMP threads) #SBATCH --mem=128000 # Request 128GB RAM
Submit a job
sbatch LaunchR-Jupyter.sh
You can log out after submitting the job. You will receive an email once the job becomes active.
Jupyter Notebook Access Information
Once the job becomes active, you will receive an email like below:
Jupyter is running at cypress01-058 token: 38e3c6cdf28b9d691677882cfcf62fbd217d35e1de7cc909 Open a terminal and run the following command to create an SSH tunnel: ssh -L 8888:127.0.0.1:8888 -J [email protected] userid@cypress01-058 Copy and paste below to your web browser to access Jupyter Notebook: http://127.0.0.1:8888/?token=38e3c6cdf28b9d691677882cfcf62fbd217d35e1de7cc909
Create an SSH Tunnel
Open a terminal and run the command in the email, for example,
ssh -L 8888:127.0.0.1:8888 -J [email protected] userid@cypress01-058
This will create an SSH tunnel from your local computer to the Cypress computing node. You may need to type a password to login Cypress.
Access Jupyter Notebook
After logging in, keep the terminal open. Copy and paste the URL from the email into your web browser, or click the link to access the Jupyter Notebook.
Start R session
Select “New → R” from the drop-down menu in the upper-right corner of the Jupyter Notebook interface.
When SSH connection lost
When your SSH tunnel session is disconnected, you can still access your Jupyter Notebook session as long as the job is still running. If this happens, recreate the SSH tunnel and reload your web browser or reconnect using the original URL.
Quit Jupyter Notebook Session
Select “File → Shut Down” from the drop-down menu in the upper-left corner of the Jupyter Notebook interface.
