JupyterHub is a fully-online IDE that is very similar to Google's Colab interface. JupyterHub's uses vary from simple text file editing to large IPython notebooks. This document will mainly focus on the advanced features of JupyterHub since the more simple features are easily discoverable through the interface and are fairly self-explanatory.
TJ's JupyterHub instance is available at https://jupyterhub.tjhsst.edu. You will be redirected to Ion to authenticate. Then, you will be presented with options for your Jupyterlab instance:
Default (4 CPUs, 8GB RAM)
Compute (8 CPUs, 16GB RAM)
1 GPU (8 CPUs, 16 GB RAM, 1 GPU)
2 GPUs (8 CPUs, 16 GB RAM, 2 GPUs)
4 GPUs (8 CPUs, 16 GB RAM, 4 GPUs)
Please only choose what you need. Depending on usage, it may take longer to spawn instances for higher resource allocations, and others may be prevented from using resources allocated to you if you are not using them.
You will then be placed in a queue to wait for your own server to spawn. Our instance is configured such that your server may be spawned on one of 53 different machines. Even though your server is spawned on random machines, all your files are stored in a common location:
After logging in you may be greeted with a "Launcher" tab. This tab will have multiple options, including:
The Python Notebook and Python Console are two separate interfaces, and you may experiment with either of them.
Both of these Python interfaces are based in the "default" Python environment, meaning they have the default packages. In most cases the default packages will suffice, but if you need to install custom packages read the instructions below:
Both the Python Notebook and Console are backed by Conda environments. Familiarize yourself with Conda environments before reading on.
To create a personal custom Conda environment run the following:
infocube or any cluster node run the following in your home dir (
conda create --name my_personal_environment ipykernel
--name parameter can be anything you wish (in this case
ipykernel is REQUIRED at the end.
After creating the Conda environment, activate it:
conda activate my_personal_environment
my_personal_environment with the environment name you previously chose.
Finally add the environment to JupyterHub:
python -m ipykernel install --user --name "my_env" --display-name "My Env"
--display-name parameters can be anything you wish.
After running the previous commands your launcher should now look like this:
Now you have created a personal environment you have total control of. You may use
conda to install any custom packages you wish. Be sure to click on your new Python Notebook/Console option (not the default option) if you wish to access your custom environment.
Removing the Conda environment is simple:
conda env remove -n my_personal_environment
Removing the entry is a little more involved:
rm -r /cluster/<username>/.local/share/jupyter/kernels/<name>
<name> parameter must match the
--name parameter passed to the
python -m ipykernel ... step, NOT --display-name! You may also
ls around in this directory to find your matching environment and then
rm -r the directory
After removing the directory, reload JupyterHub and the entry will now be removed.