The thumbnail image is created by chatGPT-4o
This content explains how to use Jupyter notebook at a compute node on HPC environment.
1. Enabling ssh between Polaris Compute Nodes
(https://docs.alcf.anl.gov/polaris/known-issues/)
cd /home/[username]/.ssh
ssh-keygen -t rsa
- create authorized_keys file and copy id_rsa.pub into authorized_keys
- Try setting up your .ssh/config file like this (swapping out the username placeholder with your ALCF username)
polaris-login-03:~> cat .ssh/config
Host *
User <YOUR_USERNAME>
Compression yes
Protocol 2
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
ForwardAgent yes
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
2. Your /home/ directory permissions should be set to 700
chmod 700 /home/<username>
3. Confirm the following files exist in your .ssh directory and the permissions are set to the following:
- -rw——- (600) authorized_keys 2. -rw-r–r– (644) config 3. -rw——- (600) id_rsa 4. -rw-r–r– (644) id_rsa.pub
chmod 600 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/config
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
4. Allocate debug node
5. Setting port forwarding using SSH to construct connection between local node and remote node.
From the login node, excute the below command:
ssh -L 8888:localhost:8888 [your_username]@[compute node]
6. Execute jupyter notebook at the compute node
jupyter notebook --no-browser --port=8888
7. Open in local browser
8. Or if you want to use jupyter notebook on Visual code,
- Select Kernel
- Select Another Kernel
- Exisiting Jupyter Server
- Copy the URL