Jupyterlab installation page

1. Prepare the Slurm script for Jupyter

On the cluster, create a submission file, for example
jupyter.slurm:

	
#!/bin/bash #SBATCH -J jupyter
#SBATCH -p PARTITION_ID
#SBATCH -A PROJECT_ID
#SBATCH -t 04:00:00
#SBATCH -o jupyter-%j.out

module load python jupyter lab --no-browser --ip=0.0.0.0


  • -J: job name
  • -p: partition
  • -A: project account
  • -t: maximum runtime
  • -o: output file (contains the URL and token)

2. Submit the Jupyter job

From a login node, submit the job using Slurm:

	sbatch jupyter.slurm

Slurm returns a
JobID.
The job will start as soon as resources are available.


3. Retrieve the Jupyter URL

Once the job is running, check the output file:

	jupyter-JOBID.out

You will find a line similar to:

	http://127.0.0.1:8888/lab?token=25d1ef1c36f4b16b90b0a27db9f6b43b05cb041f6e787f68

Note:
This URL is only accessible from the compute node. You must therefore create an SSH tunnel.


4. Create an SSH tunnel from your local machine

On your computer (Linux / macOS / Windows with OpenSSH), open a terminal and run:

	ssh -N -L 8888:skylake061.cluster:8888 USER@login.mesocentre.univ-amu.fr
  • 8888 (left): local port on your machine
  • skylake061.cluster: compute node running the job
  • 8888 (right): port used by Jupyter on the node

⚠️ Keep this terminal open while using Jupyter.


5. Access Jupyter Lab in your browser

On your local machine, open a web browser and paste the URL obtained earlier:

	http://127.0.0.1:8888/lab?token=25d1ef1c36f4b16b90b0a27db9f6b43b05cb041f6e787f68

You are now connected to
Jupyter Lab running on the cluster, using the compute node’s resources.


6. End your session

  • Close the Jupyter browser tab
  • Stop the SSH tunnel (
    Ctrl+C)
  • Cancel the Slurm job if necessary:
	scancel JOBID

Summary

  1. Create a Slurm script launching
    jupyter lab
  2. Submit the job with
    sbatch
  3. Retrieve the URL and token from
    jupyter-JOBID.out
  4. Create an SSH tunnel to the compute node
  5. Open Jupyter in your local browser
Scroll to Top