Launching Jupyter Notebook on Compute Node

Using login nodes for Jupyter Notebook without getting compute nodes allocated is strongly prohibited

From April 2020, we are offering a service that can run Jupyter Lab from TSUBAME portal.
The instruction below is a way of not using this service. If you have a reason to avoid this service, this document will help you.

To use Jupyter Notebook in TSUBAME compute node, SSH port-forwarding is required.
We provide a script that semi-automate port-forwarding and interactive job submission.

(Note: It is provided as an experimental service. It may be broken or discontinued without prior notice)


Install Jupyter Notebook

$ module load python/version
$ pip install --user jupyter

Set password for Jupyter Notebook (optional)

$ jupyter notebook password

Launch server

$ module load jupyterrun
Loading experimental modules
For more details, please refer
$ cd path/to/notebook # place to save notes
$ jupyterrun -l s_core=1 -l h_rt=00:10:00 -g groupname # or ijupyterrun (for interactive job queue)
To enable port forwarding, execute this command in another terminal:
ssh -l username -L 8888:r0i1n2:12345
Then, you can connect to http://localhost:8888/

jupyterrun requires the same arguments as qrsh (Interactive job) (in Docker container case)
If you want to use the interactive job queue (iqrsh), use ijupyterrun instead.

Port forwarding

Open a new terminal and paste the command displayed in the message.
Note: parameters vary every time.

$ ssh -l username -L 8888:r0i1n2:12345

Connect from browser

You can use Jupyter Notebook via accessing http://localhost:8888/ from your browser.

Job termination

To quit, select Quit in your browser, or type Ctrl-C twice in the terminal you executed jupyterrun.

(Appendix) What did the script do?

Except for the existence check of required commands or port-forwarding related messages, the script executes the following command.

jupyter notebook --no-browser --ip= --port=(random port number)