Running Jupyter on CREATE¶
In order to run Jupyter from the HPC nodes it is necessary to request a batch job and then create a tunnel to the running process.
One way to do this is to use a virtual environment. This example uses virtualenv although it is also just as easy with conda.
Make Jupyter available in a virtualenv¶
1 2 3 4 5 6 7 8 9 |
|
Create a script to be submitted using sbatch¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
Submit the script¶
1 |
|
Use the connection string (and token) from the output file¶
Once the job has started an output file will be generated that will have the details required for you to be able to connect.
R Kernel for Jupyter¶
The following conda environment setup can be used to run Jupyter with an R kernel:
1 |
|
For further instrucitons on how to set this up using a non-default cache location, saving space in your home directory, then please refer to our documentation here for conda.
Once the required environment installations have completed, and you have activated your new conda environment, you can then install a new kernel for R with the following commands:
1 2 3 |
|
The name and displayname set above are only examples, and can be renamed to whatever you prefer, however, please note these do help with identifying and selecting your kernel from those listed in your Jupyter. With regards to changes required in the batch script for launching jupyter, you will just need to ensure that you also load the required anaconda3 module:
1 |
|
As well as, replace the virtual environment sourced with your new R kernel evironment:
1 |
|
Once you have submitted your updated script via sbatch and opened your Jupyter in the browser, you should then be able to select and switch to your new kernel and use R in Jupyter.