The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more. The following instructions will explain how to setup a jupyter notebook securely.
- ssh into the cluster
-
ssh -X -v <userID>@sporcsubmit.rc.rit.edu
-
-
Start an [sinterative][submitting_a_job_with_sinteractive] job with the configuration that you will need (e.g. memory, cores, time, gres)
- Load the packages you need.
- If you have an environment, you need can run
spack env activate <environment>. - If you don’t have an environment, do your normal
spack load <package>for the packages you need.
- If you have an environment, you need can run
- Load jupyter notebook
-
spack load py-notebook/hfaavup # or the version you require -
spack find py-notebook # to find other versions
-
- Start jupyter notebook
-
$ jupyter notebook --ip=0.0.0.0 --no-browser
-
- You will see output similar to this:
-
[demo@skl-a-47 ~]$ jupyter notebook --ip=0.0.0.0 --no-browser [I 10:47:16.816 NotebookApp] The port 8888 is already in use, trying another port. [I 10:47:16.820 NotebookApp] Serving notebooks from local directory: /home/slpits [I 10:47:16.820 NotebookApp] The Jupyter Notebook is running at: [I 10:47:16.820 NotebookApp] http://skl-a-47.rc.rit.edu:8889/?token=803f723f3d20e5e93d24af7073c822c3e77387ce7e15e5cd [I 10:47:16.820 NotebookApp] or http://127.0.0.1:8889/?token=803f723f3d20e5e93d24af7073c822c3e77387ce7e15e5cd [I 10:47:16.820 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 10:47:16.823 NotebookApp] -
To access the notebook, open this file in a browser: file:///home/slpits/.local/share/jupyter/runtime/nbserver-27411-open.html Or copy and paste one of these URLs: http://skl-a-47.rc.rit.edu:8889/?token=803f723f3d20e5e93d24af7073c822c3e77387ce7e15e5cd or http://127.0.0.1:8889/?token=803f723f3d20e5e93d24af7073c822c3e77387ce7e15e5cd [I 10:56:29.944 NotebookApp] 302 GET /?token=803f723f3d20e5e93d24af7073c822c3e77387ce7e15e5cd (129.21.171.201) 0.50ms
-
- There are a few things you need from that output:
- The port number that jupyter is using, which in this case is
8889 - The node that sinteractive is running on, which in this case is
skl-a-47.rc.rit.edu - The URL you need for localhost, which in this case is
http://127.0.0.1:8889/?token=803f723f3d20e5e93d24af7073c822c3e77387ce7e15e5cd
- The port number that jupyter is using, which in this case is
- From a new local terminal window, ssh into
sporcsubmitusing the-Lflag:ssh <userID>@sporcsubmit.rc.rit.edu -L <port_number>:<sinteractive_node>:<port_number>- Fill in
<port_number>and<sinteractive_node>from Step 7.
- To access the notebook, paste the URL for localhost (from Step 7) in a new web browser tab:
http://127.0.0.1:8889/?token=803f723f3d20e5e93d24af7073c822c3e77387ce7e15e5cd
Help: If there are any further questions, or there is an issue with the documentation, please submit a ticket or contact us on Slack for additional assistance.