Use jupyter notebook on Hoffman2

Recently I found a perfect way to use jupyter notebook on clusters like Hoffman2. Unlike the official tutorial, this method does not require any additional scripts or configurations.

Just follow the following steps:

  1. Login Hoffman2 with your account, and connect to an interactive job using qrsh command.

  2. Take a note of the node you are using. If you have difficulty to find the node, you can use hostname command to find the node you are using.

  3. Load the anaconda module (or your other environments contains jupyter notebook), and launch jupyter notebook without browser activation:

    1
    jupyter lab --no-browser --ip=0.0.0.0 --port=8888

  4. Open another terminal, and use ssh -L to forward the port from the node to your local machine:

    1
    ssh -L 8888:n1985:8888 [email protected]
    Here, the first 8888 is the port on your local machine, the second 8888 is the port on the node through which jupyter notebook is running, and n1985 is the node you are using, so please replace it with the actual node name.

  5. Open your browser and access the link appearing in the previous terminal (usually http://localhost:8888/lab?token=...).

  6. Enjoy!