Jupyter Notebooks

Running Jupyter

  1. Copy jupyter.slurm from shared directory to the designated directory jupyter.slurm
    > cp /cm/shared/sampleScripts/jupyter.slurm .
  2. Make modifications to the script
  3. Run jupyter.slurm file
    >sbatch jupyter.slurm
    When you run this command you will get an output saying: “Submitted batch job $jobid ”
    e.g., “Submitted batch job 74533”
  4. Once submitted, wait a moment for the jupyter-$jobid.out file to appear (eg. jupyter-74533.out)
    You can check if the job is running as expected by using squeue -u $username
  5. Follow the instructions in the jupyter-jobid.out file to create a tunnel from the local machine to the machine running the jupyter notebook server.
    Open a new terminal and run the ssh command written in the .out file
    Insert your password
  6. View the contents of the jupyter-jobid.err file and copy the URL starting with “http://127.0.0.1”
  7. Navigate to jupyter notebook in the local machine browser.
    Open your favorite internet browser on your local machine
    Paste the URL into the search bar of your browser

 

End Result

 

Notes

By default, jupyter-lab is a part of the Anaconda3 module. The file mentioned above, /cm/shared/sampleScripts/jupyter.slurm, loads this module for you.

If you want to create your own python environment(e.g., with conda or vEnv), you will need to take special care that the jupyter server can identify the python interpreter associated with your environment.