Jupyter Lab

When you execute Jupyter Lab on a computing node, you can launch it in the following way. Please note that the execution of the process parallelism is not supported.

Please change the user name (b59999) and queue name (gr199999b) as appropriate.

  1. Load module of Miniforge.

    $ module load miniforge3
  2. If you are using JypyterLab for the first time, install it with the following command (You only need to do it once by running)

    $ conda install jupyterlab
  3. Launch JupyterLab on the computing node. (e.g., When using gr19999b queue in the system B)

  • For Batch Processing
    Create a job script.
    $ vi run.sh
    #!/bin/bash
    #============ Slurm Options ===========
    #SBATCH -p gr19999b
    #SBATCH --rsc c=8               # Specify the requested resources (Example of 8 cores)
    #SBATCH -t 3:00:00              
    #SBATCH -o %x.%j.out            #  Specify the standard output file for the job
    #============ Shell Script ============
    set -x
    srun jupyter lab --no-browser --ip=0.0.0.0

    Submits a job.

    $ sbatch run.sh
  • For Interactive Processing
    Submits a job.
    $ tssrun -p gr19999b --rsc c=8 jupyter lab --no-browser --ip=0.0.0.0
  1. When Jupyter Lab launch on a computing node, the following connection information will be displayed.
  • For Batch Processing

    [b59999@laurel31 ~]$ tail <Standard output files>
    [C 2024-05-24 15:34:18.069 ServerApp]
    
    To access the server, open this file in a browser:
        file:///home/b/b59999/.local/share/jupyter/runtime/jpserver-4144334-open.html
    Or copy and paste one of these URLs:
        http://xb0037:8888/lab?token=f1031ba47cc702ccaac0433646ed4a848827a88b14521841
        http://127.0.0.1:8888/lab?token=f1031ba47cc702ccaac0433646ed4a848827a88b14521841
  • For Interactive Processing

    [b59999@laurel31 ~]$ tssrun -p gr19999b jupyter lab --no-browser --ip=0.0.0.0
    (Omitted)
    [C 2024-05-22 17:08:38.648 ServerApp]
    
    To access the server, open this file in a browser:
        file:///home/b/b59999/.local/share/jupyter/runtime/jpserver-4144334-open.html
    Or copy and paste one of these URLs:
        http://xb0037:8888/lab?token=f1031ba47cc702ccaac0433646ed4a848827a88b14521841
        http://127.0.0.1:8888/lab?token=f1031ba47cc702ccaac0433646ed4a848827a88b14521841

  1. Launch a web browser on the login node.

    $ firefox
  2. In the connection information obtained in Step 3 of "how to launch on the computing node", change "xbXXXX" to "xbXXXX-ib0" in the line beginning with "http://xbXXXX:Port number/lab?token (omitted below)" listed on the second line from the bottom and enter it in the address field and then connect.
    (e.g.,)http://xb0037-ib0:8888/lab?token=f1031ba47cc702ccaac0433646ed4a848827a88b14521841

  1. Launch another terminal and connect to the system with port forwarding. (e.g., When connecting to system B with b59999)
    $ ssh -L Port number:xbXXXX-ib0:Port number b59999@laurel.kudpc.kyoto-u.ac.jp

    In the connection information obtained in Step 3 of "how to launch on the computing node", change "xbXXXX" to "xbXXXX-ib0" in the line beginning "http://xbXXXX:Port number/lab?token (omitted below)" listed on the second line from the bottom and enter 4-digit number followed by "xbXXXX" for the port number.
    (e.g.,)$ ssh -L 8888:xb0037-ib0:8888 b59999@laurel.kudpc.kyoto-u.ac.jp

  2. Go to View in Web Browser without closing the command prompt or terminal.

  1. Configure port forwarding settings by referring to Configure Port Forwarding setings. (e.g.,: Setting of step 4. when connecting to system B with b59999)
    • <Forwarded port>:Port number
    • <SSH server>:laurel.kudpc.kyoto-u.ac.jp
    • <SSH login>:b59999
    • <SSH port>:22
    • <Remote server>:xbXXXX-ib0
    • <Remote port>:Port number

In the connection information obtained in Step 3 of "how to launch on the computing node", change "xbXXXX" to "xbXXXX-ib0" in the line beginning "http://xbXXXX:Port number/lab?token (omitted below)" listed on the second line from the bottom and enter 4-digit number followed by "xbXXXX" for the port number.
(e.g.)<Forwarded port>:8888、<Remote server>:xb0037-ib0、<Remote port>:8888

After completing step 7, go to View in Web Browser.

  1. Launch a web browser on your computer.
  2. In the address field of the Web browser, copy and paste the URL (http://127.0.0.1:Portnumber/lab?token(abbreviated below)) listed on the bottom line of the output connection information in Step 3 of "How to launch on a computing node".
  3. If the following screen appears, the connection is successful. jupyter_1

Press Ctrl+C twice at the prompt launched JupyterLab and terminate JupyterLab.