Page tree

INFO

It is highly recommended to use ARE to start a JupyterLab session at Gadi.

Start Gadi JupyterLab session in a PBS job

The Gadi_jupyterlab script " jupyter.ini.sh " could be used to start a Jupyterlab session. You must run jupyter.ini.sh command in either an interactive or a batch PBS job.

Batch PBS job

You can submit a job script as below to Gadi.

#!/bin/bash
#PBS -N test
#PBS -P <project code>
#PBS -q normal
#PBS -l walltime=5:00:00
#PBS -l ncpus=96
#PBS -l mem=384GB
#PBS -l jobfs=100GB
#PBS -l storage=gdata/dk92+scratch/<project code>+gdata/<project code>
module use /g/data/dk92/apps/Modules/modulefiles
module load NCI-data-analysis/2023.02
module load gadi_jupyterlab/23.02
jupyter.ini.sh [ options ]
sleep infinity

Interactive PBS job

Submit an interactive job with "qsub -I " command. Then you can manually run jupyter.ini.sh command within the interactive PBS job.

$ module use /g/data/dk92/apps/Modules/modulefiles
$ module load NCI-data-analysis/2023.02
$ module load gadi_jupyterlab/23.02
$ jupyter.ini.sh [ options ]

In both batch and interactive PBS jobs, jupyter.ini.sh command accepts several options as below

$ jupyter.ini.sh -h
General Options:
-h: Print this help page.
-J setup JupyterLab session.
-c [ config.py ]: secify a jupyter config file name. Valid with" -J ".
-T: Token access to the JupyterLab, Valid with " -J ".
-D: Set up a dask cluster with the current PBS resources.
-R: Set up a ray cluster with the current PBS resources.
-p [ num ]: Number of Dask/Ray process/worker per node, Valid with "-D or -R ".
-t [ num ]: Number of threads per Dask process/worker. Valid with "-D ".
-g: set up GPU cluster. Valid with "-D or -R".

Set up JupyterLab session with different login modes

Login JupyterLab session with password

If you want to login the JupyterLab session wth a password, please initialise JupyterLab with the following commands

$ jupyter server --generate-config
$ jupyter server password

Configuring your JupyterLab password on Gadi is necessary only during the initial usage of JupyterLab. This password serves as a stand-alone credential exclusively for accessing your JupyterLab session on Gadi. It is important to note that this password is distinct from your NCI account password and is solely intended for the Gadi JupyterLab session. At any point, you can reset the password using the provided command.

Run the following command in a Gadi PBS job 

$ jupyter.ini.sh -J

Then follow the Connect to the Gadi JupyterLab session step to access the JupyterLab session in your client computer.

Note: if you don't conduct the Jupyter initialisation step, the above command will create a token url in client_cmd file, which assembles the scenarios of "Login JupyterLab session with token".

Login JupyterLab session with token

In a PBS interactive job, run the following command will create a token url at the end of client_cmd file. You can use the token url to access the JupyterLab session without typing in the password.

$ jupyter.ini.sh -J -T

Then follow the Connect to the Gadi JupyterLab session step to access the JupyterLab session in your client computer.

Set up JupyterLab session with a customised configure

You can specify a configure for the JupyterLab session as below: 

$ jupyter.ini.sh -J -c config.py 

In the above command, a JupyterLab configure file call "config.py" are specified. You can use  ~/.jupyter/jupyter_server_config.py as the template to create your own configure file.

Then follow the Connect to the Gadi JupyterLab session step to access the JupyterLab session in your client computer.


  • No labels