software:juypter:caviness

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
software:juypter:caviness [2026-03-26 16:51] – Progress on section on running with an interactive job mbottosoftware:juypter:caviness [2026-03-27 15:33] (current) – Add output from ls command on workgroup VALET directory mbotto
Line 4: Line 4:
 </note> </note>
  
-The following steps will walk you through setting up a Conda virtual environment with Python 3 and Jupyter Notebook. It will also cover the steps of requesting a compute node to run a Jupyter Notebook session on Caviness. Lastly, it will explain how to set up SSH connections to be able to connect to the Jupyter Notebook session running on a compute node.+The following steps will walk you through setting up a Conda virtual environment with Python 3 and Jupyter Notebook. It will also cover the steps of requesting a compute node to run a Jupyter Notebook session on Caviness. Lastly, it will explain how to set up SSH connections to be able to connect to the Jupyter Notebook session from the browser on your local machine.
  
-Before starting, make sure you set your workgroup. This example will demonstrate how to create a shared directory in your workgroup storage where you can create Conda environments that are accessible to everyone in your workgroup.+Before starting, make sure you [[abstract:caviness:app_dev:compute_env#setting-workgroup|set your workgroup]] on Caviness. This example will demonstrate how to create a shared directory in your workgroup storage where you can create Conda environments that are accessible to everyone in your workgroup.
  
 <note warning> <note warning>
Line 73: Line 73:
 # To activate this environment, use # To activate this environment, use
 # #
-#     $ conda activate /work/it_css/sw/miniforge-testing/jupyter-notebook/20260326+#     $ conda activate /work/my_workgroup/sw/conda-envs/jupyter-notebook/20260326
 # #
 # To deactivate an active environment, use # To deactivate an active environment, use
Line 86: Line 86:
 <code bash> <code bash>
 [(my_workgroup:user)@login00.caviness ~]$ ls -d ${WORKDIR_SW}/valet [(my_workgroup:user)@login00.caviness ~]$ ls -d ${WORKDIR_SW}/valet
 +/work/my_workgroup/sw/valet
 [(my_workgroup:user)@login00.caviness ~]$ echo ${WORKDIR_SW}/conda-envs/jupyter-notebook [(my_workgroup:user)@login00.caviness ~]$ echo ${WORKDIR_SW}/conda-envs/jupyter-notebook
 /work/my_workgroup/sw/conda-envs/jupyter-notebook /work/my_workgroup/sw/conda-envs/jupyter-notebook
Line 158: Line 159:
  
 <code bash> <code bash>
-[(my_workgroup:user)@r06n21 ~]$ vpkg_require jupyter-notebook/20260326+[(my_workgroup:user)@r05n17 ~]$ vpkg_require jupyter-notebook/20260326
 Adding dependency `miniforge/25.11.0-1` to your environment Adding dependency `miniforge/25.11.0-1` to your environment
 Adding package `jupyter-notebook/20260326` to your environment Adding package `jupyter-notebook/20260326` to your environment
-(/work/my_workgroup/sw/conda-envs/jupyter-notebook/20260326) [(my_workgroup:user)@r06n21 ~]$+(/work/my_workgroup/sw/conda-envs/jupyter-notebook/20260326) [(my_workgroup:user)@r05n17 ~]$
 </code> </code>
 +
 +====Starting a Jupyter Notebook session====
 +
 +When starting the Jupyter Notebook session, specific options are passed which are used to set up the tunnel connection. You should see output similar to the following output:
 +
 +<code bash>
 +(/work/my_workgroup/sw/conda-envs/jupyter-notebook/20260326) [(my_workgroup:user)@r05n17 ~]$ jupyter notebook --no-browser --ip=$(hostname -s)
 +[I 2026-03-27 14:42:42.749 ServerApp] jupyter_lsp | extension was successfully linked.
 +[I 2026-03-27 14:42:42.756 ServerApp] jupyter_server_terminals | extension was successfully linked.
 +[I 2026-03-27 14:42:42.763 ServerApp] jupyterlab | extension was successfully linked.
 +[I 2026-03-27 14:42:42.769 ServerApp] notebook | extension was successfully linked.
 +[I 2026-03-27 14:42:43.761 ServerApp] notebook_shim | extension was successfully linked.
 +[I 2026-03-27 14:42:43.820 ServerApp] notebook_shim | extension was successfully loaded.
 +[I 2026-03-27 14:42:43.824 ServerApp] jupyter_lsp | extension was successfully loaded.
 +[I 2026-03-27 14:42:43.826 ServerApp] jupyter_server_terminals | extension was successfully loaded.
 +[I 2026-03-27 14:42:43.843 LabApp] JupyterLab extension loaded from /work/my_workgroup/sw/conda-envs/jupyter-notebook/20260326/lib/python3.14/site-packages/jupyterlab
 +[I 2026-03-27 14:42:43.843 LabApp] JupyterLab application directory is /work/my_workgroup/sw/conda-envs/jupyter-notebook/20260326/share/jupyter/lab
 +[I 2026-03-27 14:42:43.844 LabApp] Extension Manager is 'pypi'.
 +[I 2026-03-27 14:42:44.007 ServerApp] jupyterlab | extension was successfully loaded.
 +[I 2026-03-27 14:42:44.013 ServerApp] notebook | extension was successfully loaded.
 +[I 2026-03-27 14:42:44.016 ServerApp] Serving notebooks from local directory: /home/4296
 +[I 2026-03-27 14:42:44.017 ServerApp] Jupyter Server 2.17.0 is running at:
 +[I 2026-03-27 14:42:44.017 ServerApp] http://r05n17:8888/tree?token=0f2f120dc34903954fb4b62dcb92e2b0c5950b670c0559ef
 +[I 2026-03-27 14:42:44.017 ServerApp]     http://127.0.0.1:8888/tree?token=0f2f120dc34903954fb4b62dcb92e2b0c5950b670c0559ef
 +[I 2026-03-27 14:42:44.017 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
 +[C 2026-03-27 14:42:44.021 ServerApp]
 +
 +    To access the server, open this file in a browser:
 +        file:/home/4296/.local/share/jupyter/runtime/jpserver-361926-open.html
 +    Or copy and paste one of these URLs:
 +        http://r05n17:8888/tree?token=0f2f120dc34903954fb4b62dcb92e2b0c5950b670c0559ef
 +        http://127.0.0.1:8888/tree?token=0f2f120dc34903954fb4b62dcb92e2b0c5950b670c0559ef
 +[I 2026-03-27 14:42:44.079 ServerApp] Skipped non-installed server(s): basedpyright, bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyrefly, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
 +</code>
 +
 +<note warning>
 +At this point you will not be prompted for any further input, but the Jupyter Notebook server is running. Note the following URL in the output above:
 +<code bash>
 +http://r05n17:8888/tree?token=0f2f120dc34903954fb4b62dcb92e2b0c5950b670c0559ef
 +</code>
 +Before continuing, **make a note of the corresponding URL from your output**, since you will need it for a later step (the token and most likely the compute node name will be different for you).
 +</note>
 +
 +====Setting up SSH tunnel to connect to Jupyter Notebook server====
 +
 +With the Jupyter Notebook server running on a compute node on Caviness, an SSH tunnel is needed to be able to make a connection and access the Jupyter Notebook server from a web browser on your local machine. This is done by opening a **second** SSH connection to Caviness. Follow the appropriate section below for a Linux/Mac or Windows laptop.
 +
 +<note warning>
 +Your compute node name will likely be different than ''r05n17'', so please make sure to change that accordingly. This SSH tunnel connection will have to remain open while you are using Jupyter Notebook. If it is closed or internet connectivity is lost, then your connection to Jupyter Notebook will also be lost.
 +</note>
 +
 +==Linux/Mac==
 +Open a new terminal session on your local machine. Set up an SSH tunnel using the below ''ssh'' command. 
 +<code>
 +$ ssh -L 8888:r05n17:8888 user@caviness.hpc.udel.edu
 +</code>
 +
 +==Windows (Command Prompt or PowerShell)==
 +Open a new Command Prompt or PowerShell session on your local machine. Set up an SSH tunnel using the below ''ssh'' command. 
 +<code>
 +> ssh -L 8888:r05n17:8888 user@caviness.hpc.udel.edu
 +</code>
 +
 +==Windows (WSL)==
 +Open a Linux terminal via WSL on your local machine. Set up an SSH tunnel using the below ''ssh'' command. 
 +<code>
 +$ ssh -L 8888:r05n17:8888 user@caviness.hpc.udel.edu
 +</code>
 +
 +====Using your local browser to access Jupyter Notebook server====
 +
 +If everything so far has been set up correctly, the final step is as easy as opening a web browser of choice on your local machine and entering the correct URL. You should now use the URL that you previously made a note of from the output of the ''jupyter notebook'' command that you ran on the compute node. Change the compute node name in the URL to ''localhost'' and copy the URL into your browser. For instance, if your URL was:
 +
 +<code>
 +http://r05n17:8888/tree?token=0f2f120dc34903954fb4b62dcb92e2b0c5950b670c0559ef
 +</code>
 +
 +then in your browser, you would copy:
 +
 +<code>
 +http://localhost:8888/tree?token=0f2f120dc34903954fb4b62dcb92e2b0c5950b670c0559ef
 +</code>
 +
 +You should now see Jupyter running on your browser.
 +
 +Note that since this example ran the ''jupyter notebook'' command on the compute node from the home directory ''~'', when you open Jupyter on your browser you will see files in your home directory on Caviness. If you want to start from a different directory -- for example, a directory where you already have a Jupyter Notebook ''.ipynb'' file that you want to open -- make sure to navigate to that directory on Caviness before starting up the Jupyter Notebook server.
 +
 +<note important>
 +If you are not able to connect to the Jupyter Notebook session at this point, then you will need to review the prior steps and make sure that you have added and configured the SSH tunnel properly based on your compute node. Remember, the SSH tunnel connection will have to remain open the entire time while you are using Jupyter Notebook.
 +</note>
  • software/juypter/caviness.1774558263.txt.gz
  • Last modified: 2026-03-26 16:51
  • by mbotto