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. Navigate to jupyter notebook in the local machine browser.
    Open your internet browser
    Copy the URL starting with “http://127.0.0.1” and paste it on the search bar of your browser. This is likely the last line in the .err file.

 

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.