Tags

CLASSE JupyterHub

Login

Starting a server

After logging in, you should select a "Job profile" appropriate for your work.
  • Local Process On JupyterHub Server will launch a notebook on the jupyter02.classe.cornell.edu server itself. Please only use this for testing, development, and light-weight (low memory and CPU) jobs.
  • CLASSE Compute Farm will launch a notebook in the general-use queues of the CLASSE Compute Farm. Please know that these jobs will have a 48 hour time limit, and see GridEngine for more information.
  • CLASSE Compute Farm: 32 CPUs with 256GB memory will launch a notebook in the general-use queues of the CLASSE Compute Farm, limited to nodes that have 32 CPUs and 256GB of available memory. Please note that these resources may not always be available, in which case your notebook will not be scheduled or launched. Please also know that these jobs will have a 48 hour time limit, and see GridEngine for more information.
  • CHESS FAST Queues will launch a notebook on the dedicated CHESS FAST queues. Note that you must request permissions to be able to use these queues.
  • CHESS PIPOXS Queues will launch a notebook on the dedicated CHESS PIPOXS queues. Note that you must request permissions to be able to use these queues.
  • CHESS QM2 Queues will launch a notebook on the dedicated CHESS QM2 queues. Note that you must request permissions to be able to use these queues.

Stopping a server

  1. Click on "Home" or "File -> Hub Control Panel"
  2. Click on "Stop My Server"

Python Environments

When you launch a new notebook, you are presented with a dropdown to select your desired python kernel. The default Python 3 kernel is a CLASSE-IT maintained conda environment in /nfs/opt/anaconda3/envs/python3. CLASSE-IT also maintains the python environment that's used to run jupyterhub itself (/nfs/classe/jupyter02/jupyterhub).

Adding New Environments

In addition, you can install your own python environments and have them added as an option when creating new notebooks.
  1. Create your own python environment using your desired python installation. Please see LinuxSoftwareDevelopment for a list of centrally maintained python environments, and LinuxSoftwareDevelopment for tips on creating your own conda installation.
  2. Install anything you like in the environment, but you MUST at least install ipykernel. For example
    pip install ipykernel
  3. Activate the new environment. If using conda, this would look something like:
    source /path/to/conda/install/bin/activate
    conda activate my-python-env
  4. Add the virtual environment as a jupyter kernel using
    python -m ipykernel install --user --name=my-python-env --display-name "My Python Env"
    • This adds the kernel to ~/.local/share/jupyter/kernels/
  5. Select "My Python Env" when creating a new notebook.

Deleting Environments

To delete a python environment you added using the above procedure, delete the corresponding directory from your ~/.local/share/jupyter/kernels/ directory.

You can also use /nfs/opt/anaconda3/envs/python3/bin/jupyter kernelspec list to list all of your kernels, and then /nfs/opt/anaconda3/envs/python3/bin/jupyter kernelspec uninstall my-python-env to uninstall your desired environment.

Notebook Configuration

By creating and editing a ~/.jupyter/jupyter_notebook_config.py file, you can change default values.

Default Directory

By default, new servers start out in your home directory. You can change the default directory by adding the following to your own ~/.jupyter/jupyter_notebook_config.py file (for example):
import os
c.NotebookApp.notebook_dir = os.path.expanduser('~/Documents/jupyter/notebooks')

Default Permissions (Sharing Notebooks)

When creating a new notebook, a .ipynb_checkpoints folder is created in the same directory as your notebook. If you want other users to be able to run your notebook, they need to be able to write to this directory. You can make sure this directory and any new notebooks you create are group-writable by adding the following to your ~/.jupyter/jupyter_notebook_config.py file:
import os
os.umask(0o002)
Topic revision: r18 - 29 Sep 2024, DevinBougie
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding CLASSE Wiki? Send feedback