Compare with ETH's script
I just wanted to point to this very similar project at ETH Zürich: https://gitlab.ethz.ch/sfux/Jupyter-on-Euler-or-Leonhard-Open The ETH uses LSF instead of SLURM for job management. However, the script for running Jupyter in a job on the cluster and then connecting to it via an SSH-tunnel is very similar to our approach. The ETH-script comes with some convenience features like automatically opening the browser:
echo -e "Starting browser and connecting it to jupyter notebook"
echo -e "Connecting to url $JNB_URL"
# start local browser if possible
if [[ "$OSTYPE" == "linux-gnu" ]]; then
xdg-open $JNB_URL
elif [[ "$OSTYPE" == "darwin"* ]]; then
open $JNB_URL
elif [[ "$OSTYPE" == "msys" ]]; then # Git Bash on Windows 10
start $JNB_URL
else
echo -e "Your operating system does not allow to start the browser automatically."
echo -e "Please open $JNB_URL in your browser."
fi
Maybe at some point, we might want to incorporate some of their features into our project.