Skip Navigation

Jupyter Notebooks

Skip Side Navigation

JupyterLab and Jupyter Notebooks

JupyterLab is a web-based interactive development environment for notebooks, code, and data. Its flexible interface allows users to configure and arrange workflows in data science, scientific computing, and machine learning.

The Jupyter Notebook is a web application for creating and sharing computational documents. It offers a simple, streamlined, document-centric experience.

Do Not Run Jupyter on the Login Nodes!!

Running Jupyter via your web browser (Open OnDemand)

Log in to On Demand using your regular OSCER username and password: .https://ondemand.oscer.ou.edu

JupyterLab and Jupyter Notebooks are available under 'Interactive Apps'.

To activate your own conda environment in OnDemand, you must be sure ipykernel is installed in the environment.  Install ipykernel outside of OnDemand (from a regular Schooner login):

conda activate conda install -c anaconda ipykernel python -m ipykernel install --user --name --display-name ""

Running on a Compute Node via sbatch

Below is a batch script template called "jupyter.sbatch":

#!/bin/bash

#SBATCH --partition=normal
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=4G
#SBATCH --time=00:30:00
#SBATCH --job-name=jupyter-notebook
#SBATCH --output=jobname_%J_stdout.txt
#SBATCH --error=jobname_%J_stderr.txt
#SBATCH --chdir=/path/to/working/directory

# get tunneling info
XDG_RUNTIME_DIR=""
node=$(hostname -s)
user=$(whoami)
cluster="schooner"
port=8889

echo -e "======================="
echo -e "Jupyter tunneling instructions"
echo -e "======================="
echo -e "1. Run this on your local machine to create ssh tunnel"
echo -e "ssh -N -f -L ${port}:${node}:${port}" ${user}@schooner.oscer.ou..edu"
echo -e ""
echo -e "2. Then open in browser:"
echo -e "Copy and paste URL in error log in your browser to start JupyterLab session"
echo -e "======================="

# load Modules an environments 
module load jupyterlab/1.2.5-foss-2019a-Python-3.8.0

# Run Jupyter
jupyter-notebook --no-browser --port=${port} --ip=0.0.0.0

 

Then submit your batch script with the following command and follow the instructions in your output file to create the ssh tunnel:

sbatch jupyter.sbatch