ssh YOURUSERNAME@lengau.chpc.ac.za
You need an interactive compute node to run Jupyter.
- Request a single-core interactive node:
qsub -I -P PROJ0101 -q serial -l select=1:ncpus=1:mpiprocs=1
Note: Replace PROJ0101 with your project name (e.g., ERTH01234).
- Record the compute node ID (e.g., cnode1234), you will need it later.
- For multiple notebooks, request 4 cores:
qsub -I -P PROJ0101 -q serial -l select=1:ncpus=4:mpiprocs=4
- For large datasets, request a bigmem node (shared with others):
qsub -I -P PROJ0101 -q bigmem -l select=1:ncpus=4:mpiprocs=4
- Check for available Python modules:
module avail 2>&1 | grep python
- Load your preferred Python version (example below):
module add chpc/python/3.6.0_gcc-6.3.0
Since multiple users share the system, you must secure your notebook.
- Generate a Juypter config file:
jupyter-notebook --generate-config
- This creates the config file: /home/YOURUSERNAME/.jupyter/jupyter_notebook_config.py. To list the config file run
$ la -al
- Set a password:
python
from notebook.auth import passwd
passwd()
- Enter and Verify your password Try not to forget this password as you will need it later. This will result in a password hash being generated (e.g 'sha1:abcd1234...')
- Copy the generated sha file
- Edit the config file
cd ~/.jupyter/
vim jupyter_notebook_config.py
- Add this line to the config file
c.NotebookApp.password = 'sha1:abcd1234...' # Use your actual hash
- On the interactive node, start Jupyter:
jupyter-notebook --no-browser
- Note the port number and nodeID displayed (e.g.,
http://cnode1234:8888
).
- Open a terminal on your local machine and create a
.ssh/config
file:
touch ~/.ssh/config
- Add the following lines to the file:
Host cnode*
Hostname %h
User YOURUSERNAME
ProxyCommand ssh YOURUSERNAME@lengau.chpc.ac.za nc %h 22
LocalForward 8888 localhost:8888
Note: Replace YOURUSERNAME
with your Lengau username.
- Open a terminal and SSH into your compute node (replace cnode1234 with your node ID):
ssh cnode1234
- Enter your password twice (once for Lengau and once for the cnode).
- On your local machine, open your browser and go to:
http://localhost:8888
Enter the Jupyter password you set earlier.
Each interactive session will have a different node and port number. Update your .ssh/config file accordingly.
This process ensures a secure and efficient way to run Jupyter on Lengau. If you encounter any issues, send a ticket to the CHPC Helpdesk at https://users.chpc.ac.za/helpdesk/tickets/submit/ or send a email to msovara@csir.co.za for further assistance.