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:
Login Hoffman2 with your account, and connect to an interactive job using
qrsh
command.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.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
Open another terminal, and use
ssh -L
to forward the port from the node to your local machine:Here, the first1
ssh -L 8888:n1985:8888 [email protected]
8888
is the port on your local machine, the second8888
is the port on the node through which jupyter notebook is running, andn1985
is the node you are using, so please replace it with the actual node name.Open your browser and access the link appearing in the previous terminal (usually
http://localhost:8888/lab?token=...
).Enjoy!