Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Fornax User Documentation

Compute Environments

The Fornax Science Console is a lightly customized JupyterLab environment running on AWS cloud servers (x86_64 Ubuntu Linux). Several software environments and JupyterLab extensions are pre-installed. Users can also customize their experience by installing additional software and/or JupyterLab extensions. This page describes the pre-installed tools and customization instructions.

Python Environments

Environment Types

There are two types of Python environments, pip-based and conda-based.

pip-based

The pip-based environments use uv to manage the packages. These environments contain pip-installable packages and are used in most cases. The default environments are installed under $ENV_DIR.

conda-based

These use micromamba to manage the packages (similar to conda/mamba): The conda-based environments are used with packages that are not pip-installable. These are also installed under $ENV_DIR. You can also use micromamba env list to list the conda based environments.

Currently-installed conda-based environments include: heasoft, ciao, sas and fermi for high energy astrophysics software.

Pre-installed Environments

A wide variety of software is pre-installed. A detailed accounting can be found in the environment lock files in the $LOCK_DIR directory or on the latest image release page. The software is organized into several environments.

python3
This is the default Python environment and is pip-based. It has general astronomy and plotting software.
py-{notebook-name}
These environments are pip-based. Each of the Fornax demo notebooks has its own environment with a name of the form py-{notebook-name} (e.g. py-light_curve_collector and py-multiband_photometry). Each environment has the packages required to run the notebook pre-installed.
heasoft, ciao, fermi, sas
Environments for high energy software are conda-based and include: heasoft, Chandra ciao, Fermi analysis software, and XMM-Newton SAS.

When opening the notebook, the corresponding kernel should automatically start. You can also select it from the drop down kernel menu at the top-right of an open notebook.

Activate an Environment

Notebook: To activate a specific environment from a notebook, click on the name of the notebook’s current environment at the top right and then select your desired environment from the kernel drop down menu. Notebooks can use either a pip-based or conda-based environment. If you open a Fornax demo notebook and get a popup window asking you to select a kernel, choose the kernel from the drop down menu with the same name as the notebook you are opening. If you open any other notebook and get a popup window asking you to select a kernel, python3 is usually the best choice, unless you already know which environment you need.

Terminal: To activate a specific pip-based environment (see Environment Types for details) from the terminal, run: source $ENV_DIR/{environment-name}/bin/activate. For example, to activate the py-light_curve_classifier environment, run:

source $ENV_DIR/py-light_curve_classifier/bin/activate

and the following to deactivate it:

deactivate

To activate a specific conda-based environment (see Environment Types for details) from the terminal, run: micromamba activate {env-name}. For example, to activate the heasoft environment, run:

micromamba activate heasoft

and the following to deactivate it:

micromamba deactivate

Install Additional Software

To install additional Python software, you can either update an existing environment or create a new one.

Update an Existing Environment

To add packages to a currently installed environment, you install them with pip (or the faster uv pip) after activating the relevant environment.

This should work for both pip and conda-based environments.

If you want to add a small number of packages to a built-in environment, however, you can follow these steps:

Create a New Environment

To create a new environment, we recommend using one of the provided scripts: setup-pip-env or setup-conda-env.

Run setup-pip-env -h or setup-conda-env -h from the terminal for detailed help. These scripts take either a requirements file (former) or a conda yaml file (latter), and create the environment, including the setup of the kernel so you can use the environment in a notebook.

requirements-myenv.txt
numpy == 2.2.0
astropy
conda-myenv.yml
name: myenv
channels:
  - conda-forge
dependencies:
  - python=3.11
  - numpy=2.2.0
  - pip
  - pip:
    - matplotlib

Deleting a User Environment

Deleting a user envivronment that was created either manually or with the scripts provided can be done with these two steps:

As a tip, running the following in the terminal, will list all the installed kernels. It can be used to find the location of installed kernels:

$JUPYTER_DIR/bin/jupyter kernelspec list

JupyterLab Extensions

Pre-installed extensions are described on the JupyterLab page.

Install a New Extension

Instructions on how to find and install extensions can be found at JupyterLab: Extensions. Extensions may include a front-end component, a server-side component, or both. You can install front-end extensions after JupyterLab starts, and they can show up if you refresh the page, as long they are installed in the environment running JupyterLab (/opt/jupyter/). Extensions that include a server-side component cannot be installed by individual users because they must be installed before JupyterLab starts. In that case, please open a helpdesk request on the Fornax Community Forum and Helpdesk.

Compilers and General Software

As part of the system optimization and to allow for users to manage their own software, the list of packages installed in the system (using ubuntu apt) is kept to a minimum. Many of the useful packages (vim, htop, git, awscli, etc) are installed from conda-forge into the base conda environment under $ENV_DIR/base. You can add packages to this environment by doing:

micromamba install package_name

You can also include compilers. For example, to install C, C++ and Fortran compilers, you can do:

micromamba install c-compiler cxx-compiler fortran-compiler

For non-Python tools (e.g. htop, vim etc), they can be run directly from the terminal without a need for activating the base environment as they are included in the PATH by default.

Terminal Initialization scripts

The system uses bash as a default shell. The Jupyterlab terminal uses a non-login shell, which means ~/.bashrc is not called by default when a new terminal session starts. ~/.profile on the other hand is called. You can therefore use it for any bash initialization code. A new ~/.profile is created at login time if it does not exist, and it also calls ~/.bashrc, so you can add you customization (e.g. update PATH, setup rust or julia, etc) to either one.