JupyterHub
While Jupyter notebooks can be run on any login node by installing the needed packages via conda or pip, running on compute nodes can be tricky. We have installed JupyterHub servers on gplogin2 and gplogin3 that can spawn JupyterLab sessions as slurm jobs.
Starting
Point your local computer's Web browser to either https://gplogin2.ps.uci.edu:8000 or https://gplogin3.ps.uci.edu:8000 and enter your Greenplanet username and password. Then, for the "simple" configuration:
- Select which partition to run in
- Select number of CPUs
- Select which Jupyter environment to use (more info below)
- If JupyterLab is desired, click box
- Select runtime limit
- Click Start
For "Advanced", you have much more control of each option. See https://github.com/silx-kit/jupyterhub_moss for detailed descriptions.
Jupyter environments
Default
The default Python environment (/sopt/JupyterHub/) is what is used to run the JupyterHub software. It is not user-customizable, but has a lot of general-use conda and pip packages and may just work. We can update and add more packages if needed at any time, so don't count on it having specific package versions.
Miniforge3
One of the pre-configured environments assumes you have miniforge3 set up in your home directory at ~/miniforge3 (this can also be a link to somewhere else, like /X2/SCRATCH/group/user/miniforge3). See https://knowledge.ps.uci.edu/books/greenplanet-software/page/miniforge for details on preparing that.
The miniforge/3 environment will use the base miniforge that is activated by loading the module with "module load miniforge/3". You will need to run "conda install jupyterhub jupyterlab batchspawner" to make sure the JupyterLab prerequisites are installed.
User JupyterHub
If you want to keep your conda base environment clean, you can create a custom environment at ~/jupyterhub through either conda or pip. For example, starting with miniforge3's conda, do this to install a custom environment that is stored in your directory on /X2:
mkdir /X2/SCRATCH/$(id -gn)/$USER/jupyterhub
ln -s /X2/SCRATCH/$(id -gn)/$USER/jupyterhub ~/jupyterhub
ml miniforge/3
conda create -y -p ~/jupyterhub batchspawner jupyterhub jupyterlab
conda activate ~/jupyterhub
conda install [list of needed packages for your notebook]
pip install [list of any needed packages not in conda]
Other Locations
If you need to run in another arbitrary python environment, you can enter the name, location, and any environment modules you want to load manually in the "Advanced" tab.