Jupyter Notebooks
caution
These instructions cover jupyter-notebook 7.1.2, though should be easily adaptable for both newer versions and jupyter-lab.
#
Pre-requisitesThis tutorial assumes you have already completed the set up of Miniconda covered here. Throughout this exercise, it might be helpful to refer to those instructions if you get stuck.
note
The examples below use my UWNetID
(finchkn) and a compute node that was available during the development of this documentation (n3097); you will have to replace finchkn with your UWNetID
and probably n3097
with a different compute node name when required.
#
Set Upimportant
Before beginnning this exercise, please select a random number between 4096 and 16384 for your Jupyter-Notebook server to start on. It is important that this number is unique and does not conflict with either another user or an existing service on your machine. From this point out, we will use 9195 as an example.
Start an interactive job on a compute node with salloc
.
#
Install and Configure Jupyter NotebookCreate a conda environment and install required packages.
Set up a password for your Jupyter Notebook Session. This will remain your password every time you log in - Remember it.
#
Start Jupyter Notebook SessionsRemember, we chose 9195 as our random number for this exercise. You can choose any number between 4096 and 16384 for your connection, and replace 9195 with that number in the following examples.
Start jupyter notebook.
Keep this window open. Messages about your session will be printed there.
Now open a new Terminal/Windows Powershell/PuTTy window and start an ssh
tunnel from your local computer to the jupyter notebook session that you initiated on the klone compute node.
Next direct your browser to http://localhost:9195. You will be prompted for the password you set with jupyter-notebook a few steps ago.
The browser will open the Jupyter Notebook Session and you will see contents of the directory on klone.
Your token for this session will also appear in the terminal window connected to the compute node.
While the connection is open. Another option is to direct your browser to http://localhost:9195/?token=99999somee92ftoken1bfhere9999999
#
Ending your SessionEnd your session from the browser with the File Menu and "Shut Down" or "Log Out."
Then go to your terminal window to the compute node and use Control + C to end the session there.
End the interactive job.