Skip to content

JupyterLab ​

JupyterLab is a browser-based environment for code, data inspection, analysis records, and project files. Allocate compute resources before starting it; see Interactive allocation.

Allocate a node ​

bash
salloc -N 1 --cpus-per-task=8 --mem=16G -t 02:00:00 -p qcpu_18i

Wait for allocation and connect to the actual assigned node (the example uses bnode1):

bash
ssh bnode1

Start JupyterLab ​

Activate an environment containing JupyterLab; use its actual name:

bash
conda activate jupyterlab

Start the service on the compute node:

bash
jupyter lab --no-browser --ip=0.0.0.0 --port=8888
OptionMeaning
--portListening port, commonly 8888
--no-browserDo not open a browser on the remote server
--ip=0.0.0.0Listen on node network interfaces
--notebook-dirWorking directory

To set the working directory, replace 用户名 with your username:

bash
jupyter lab --no-browser --ip=0.0.0.0 --port=8888 --notebook-dir=/hpcfs/fhome/用户名

Browser access ​

Use the token-bearing URL printed by the current server, for example:

text
http://bnode1.tibhpc.net:8888/lab?token=xxxxxxxx

Interface illustration

If it is unreachable, check access to the compute node and network/local port restrictions. Keep the token private.

Background operation ​

To run in the background and save logs:

bash
nohup jupyter lab --no-browser --ip=0.0.0.0 --port=8888 > jupyter_lab.log 2>&1 &
bash
tail -f jupyter_lab.log

Finish ​

Shut down running kernels, stop the JupyterLab server (Ctrl+C for a foreground process), leave the compute node, and end the salloc session or cancel its job with scancel. A background server also needs to be stopped; do not leave the allocation running after use.

Copyright 2021 Biodesign Center. All rights reserved.