Jupyter

Please follow the instructions below in order to set up one or more Jupyter environments for your students.

For courses that require the use of Jupyter it is mandatory that you set up an environment for all students that participate in the course.

Simple Setup

Log in to a login node and simply run the following script:

/cluster/jupyter/setup-for-course.sh {course tag}

This will create a minimal Jupyter environment in /cluster/courses/{course tag}/jupyter.

This script installs Jupyter version 4 and includes the jupyterlab-server-timer extension which displays the remaining time of the server job in the status bar. This extension only works with Jupyter version 4, if you require an older version then you may need to uninstall it before downgrading.

Multiple Environments

You can add additional environments by running the above script with a directory name as second argument:

/cluster/jupyter/setup-for-course.sh {course tag} {directory name}

This will create the environment under /cluster/courses/{course tag}/{directory name}

Enabling and Adding Environments to the Hub

Edit the YAML file

/cluster/courses/{course tag}/environments.yaml

which by default only has the the first environment that you create added. You can add further environments and change the name accordingly to give the students a hint what the environment does. You can set default to true for one environment which then will be automatically selected if the user selects your course in the hub spawner page.

Add Packages

To add packages simply activate the environment by running:

. /cluster/courses/{course tag}/jupyter/bin/activate

Then use pip to install additional packages.

If you require a particular version of Cuda for the installation then activate it as described here. If your environment depends on this version of Cuda at run time then add the same module to the modules: field in your environments.yaml.

Restart from Scratch

If something goes wrong you can simply delete the environment and re-create it.

Page URL: https://isg.inf.ethz.ch/bin/view/Main/ServicesClusterComputingStudentClusterTAsJupyter
2024-04-27
© 2024 Eidgenössische Technische Hochschule Zürich