Skip to content

Use Jupyter notebooks over SSH on Hera, Jet

Guoqing Ge edited this page Aug 9, 2024 · 3 revisions

1. Login into Hera/Jet to get your Local port

*If you already know your Local port, you can skip this step
When you successfully log into Hera/Jet, you will see the following text:

Local port 12345 forwarded to remote host.
Remote port 67890 forwarded to local host.

Mark down your Local port number which will be needed in the following steps.

2. Login into Hera/Jet again through port forwarding

ssh -Y -L12345:localhost:12345 [email protected]

replace 12345 with your actual local port and First.Last with your actual user name.

3. Start a Jupyter Notebook server on Hera/Jet

3.1 load the Python environment

The RDASApp EVA Python environment provides all the needed modules for pyDAmonitor.
If you don't have a RDASApp copy, you can use the following one:
Hera

module use /scratch1/BMC/wrfruc/gge/RDASApp/modulefiles
module load EVA/hera

Jet

module use /lfs5/BMC/wrfruc/gge/RDASApp/modulefiles
module load EVA/jet

3.2 Start the server

jupyter notebook --no-browser --port=8800

NOTE:
a) 8800 is the Jupyter Notebook server port and it is different from the Local port in steps 1 and 2.
b) Pick up a port number between 8800-8900. c) When this command completes successfully, it will output a URL address similar as follows which will be needed in step 5.

    Or copy and paste one of these URLs:
        http://localhost:8806/?token=95fa2d9543d9acd01e8c3c9c82ff6b2cd8df3cd341c53ad6
     or http://127.0.0.1:8806/?token=95fa2d9543d9acd01e8c3c9c82ff6b2cd8df3cd341c53ad6

4. Connect to the Jupyter Notebook server from your local computer

Open another terminal, and run the following command:

ssh -N -f -p 12345 -L 8800:localhost:8800 First.Last@localhost

NOTE: a. replace 12345 with your actual local port, 8800 with your actual Jupyter Notebook server port, and First.Last with your actual user name.
b. When asked for a password, use your RDHPCS RSA token password.
b. When the command succeeds, it shows no output and gets back to the command line prompt.

5. Open a browser and enter the URL address from step 3.2.

It should show something like as follows and you can now run Jupiter Notebooks:

image