Skip to content

Instructions: Using Jupyter on the HPC

Taylor Salo edited this page Sep 30, 2020 · 1 revision

How to run Jupyter notebooks on the HPC for the training

You will need two terminals and your web browser. They will both stay open and running the whole time you're running the notebook.

Terminal 1: Run the notebook on the HPC

  1. SSH onto v003 of the HPC: ssh [username]@v003
  2. Activate the training environment: training_env
  3. Change directory (cd) into the folder with the notebooks (e.g., cd /home/tsalo006/training-week-2019)
    • If you haven't cloned the repository that contains the notebooks, do that now. This will download the folder to your current directory and you can cd into it then.
  4. Start the Jupyter session: jupyter notebook --no-browser --port=[portnumber]
  5. You will see something like the following lines. The line that is bolded below is the one to look out for in your own terminal (it won't be bolded).

[I 07:46:33.647 NotebookApp] Serving notebooks from local directory: /home/tsalo006/training-week-2019
[I 07:46:33.647 NotebookApp] The Jupyter Notebook is running at:
[I 07:46:33.647 NotebookApp] http://localhost:8888/?token=d8351054921b7dc243cba446684cd6e33497c54a1326f9ba
[I 07:46:33.647 NotebookApp] or http://127.0.0.1:8888/?token=d8351054921b7dc243cba446684cd6e33497c54a1326f9ba
[I 07:46:33.648 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 07:46:33.664 NotebookApp]

To access the notebook, open this file in a browser:
file:///home/tsalo006/.local/share/jupyter/runtime/nbserver-14182-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=d8351054921b7dc243cba446684cd6e33497c54a1326f9ba
or http://127.0.0.1:8888/?token=d8351054921b7dc243cba446684cd6e33497c54a1326f9ba

Terminal 2: Create SSH tunnel from the HPC to your laptop

  1. ssh -N -L localhost:[portnumber]:localhost:[portnumber] [username]@v003.fiu.edu
  2. Once you've put in your password (if you didn't set up the SSH key for your laptop), then this window will look like it's hanging. It isn't. It's actually just running.

Web browser

  1. Copy the URL from the Jupyter notebook terminal into your web browser. This will navigate to the Jupyter notebook session that's actually running on the HPC. You can now open and run notebooks in that folder.