Skip to content

Instantly share code, notes, and snippets.

@meg-codes
Last active March 15, 2018 20:40
Show Gist options
  • Save meg-codes/dfdd71a9ae63b97c51743ad7246c9e50 to your computer and use it in GitHub Desktop.
Save meg-codes/dfdd71a9ae63b97c51743ad7246c9e50 to your computer and use it in GitHub Desktop.

On the Adroit headnode

This requests an allocation on a compute node of Adroit for 15 minutes. Once granted you can see I'm moved to the compute node adroit-14. I also ask for two tasks (you can adjust based on whether you actually use the cores or not.)

[bhicks@adroit4 ~]$ salloc -N 1 --ntasks-per-node=2 -t 15:00
salloc: Granted job allocation 497989
[bhicks@adroit-14 ~]$ export XDG_RUNTIME_DIR=""
[bhicks@adroit-14 ~]$ jupyter notebook --no-browser --port=8889 --ip=0.0.0.0

On my local laptop, after those commands

This works for Mac or Linux. For Windows, I'd have to investigate how to do an SSH tunnel

mfalcon:~ bhicks$ ssh -N -f -L 8889:adroit-14:8889 bhicks@adroit.princeton.edu

This does the following:

  • -N - don't execute a remote command
  • -f - fork to background (to kill it, run ps aux | grep ssh and then kill the appropriate process.
  • -L - set up a local port forward of local 8889 to adroit-14 (the compute node) 8889.
  • Then connects as bhicks to adroit.princeton.edu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment