Skip to main content

Apptainer containers for Observation Preparation Software - Knowledgebase / How to prepare your observations (Phase 2) - ESO Operations Helpdesk

Apptainer containers for Observation Preparation Software

Authors list

Apptainer containers for Observation Preparation Software

It becomes ever more difficult to maintain the our legacy Observation Preparation Software [OPS] packages:

In the meantime container technology, in particular Apptainer, has reached a maturity that provides a relatively high level User Experience as well as a suitable ease of maintenance.

We are therefore making Apptainer containers available for the three legacy OPS packages.

For now, these containers are based on our Intel Silicon Fedora 30 RPMs. Despite this, they still seem to run on non-Intel Silicon, e.g. a Fedora 41 virtual machine running on Apple Silicon in a macOS-15 host. Presumably they are running in some kind of virtualised environment, so they are slower than native ARM containers would be, but they run!

If you are not familiar with Apptainer jump to the Install Apptainer section below.

If you are already know how to use Apptainer you can simply download the Apptainer SIF Image files for each package from the links above, and then run the packages with the following commands:

FIMS for FORS:

apptainer exec eso-fors-fims.x86_64.sif fims.sh R  # for the R camera
apptainer exec eso-fors-fims.x86_64.sif fims.sh B  # for the B camera

FPOSS for FLAMES:

apptainer exec eso-flames-fposs.x86_64.sif fposs.sh

KARMA for KMOS:

apptainer exec eso-karma.x86_64.sif karma

Practicalities of running the containers

There are a few "tricks" that mey be necessary to get the tools running optimally:

  1. You'll probably want/need to install the 100 and 75 dpi x11 font packages (in the host computer) [Fedora packages xorg-x11-fonts-100dpi & xorg-x11-fonts-75dpi, Ubuntu packages xfonts-100dpi & xfonts-75dpi] and you'll need to logout and back in again for these fonts to be used.
  2. You may need to issue the command:
    ibus exit
    before launcing the tools via apptainer inn order to be able to enter text into text fields.
  3. You may need to issue the command:
    xhost +
    (or similar) to be enable apptainer to open X11 windows on your machine (e.g. on Fedora, probably there's a better way to do this, please let us know via a ticket).

Install Apptainer

If you do not already have Apptainer installed you will need to do so. You can refer to the official documentation for detailed installation instructions for any modern Linux distributions.

Once Apptainer is installed, you can simply download the pre-build images at the top of the page, or if need be, create your own images, see Building and Running Apptainer Containers below.

Here, we re-produce the specific commands that should be used to install Apptainer in Ubuntu:

sudo apt update
sudo apt install -y software-properties-common 
sudo add-apt-repository -y ppa:apptainer/ppa
sudo apt update
sudo apt install -y apptainer

Addressing user privileges restrictions

From version 24.04, Ubuntu restricts user namespaces by default, which can cause errors when creating mount namespaces during the execution of the apptainer build task. Before running apptainer you must execute the following command with sudo privileges:

echo "kernel.apparmor_restrict_unprivileged_userns = 0" | sudo tee /etc/sysctl.d/99-userns.conf
sudo sysctl --system

To build containers on versions prior to Ubuntu 24.04, you must execute the following command (to create entries in /etc/subuid and /etc/subgid to allow a non-root user to perform actions within a container that normally require root privileges) with sudo privileges.

sudo apptainer config fakeroot --add username

How do I know the Ubuntu version?

lsb_release -a

Building and Running Apptainer Containers

Package specific

Download one or more of the following .def files to create standalone Apptainer containers for each tool.

curl -O https://ftp.eso.org/pub/usg/apptainer/def/eso-fors-fims.def
curl -O https://ftp.eso.org/pub/usg/apptainer/def/eso-flames-fposs.def
curl -O https://ftp.eso.org/pub/usg/apptainer/def/eso-karma.def

Then create the Apptainer .sif image file(s) with one (or more) of the following commands:

apptainer build eso-fors-fims.sif eso-fors-fims.def
apptainer build eso-flames-fposs.sif eso-flames-fposs.def
apptainer build eso-karma.sif eso-karma.def

And then run the tool(s) with one (or more) of the following commands:

apptainer exec eso-fors-fims.sif fims.sh R
apptainer exec eso-fors-fims.sif fims.sh B
apptainer exec eso-flames-fposs.sif fposs.sh
apptainer exec eso-karma.sif karma

One container (to rule them all...)

If you want a single container based on Fedora-30 with more than one of the tools:

curl -O https://ftp.eso.org/pub/usg/apptainer/def/eso-ops.def

Then create the Apptainer .sif image file(s) with one (or more) of the following commands:

apptainer build --build-arg ops="fors-fims;flames-fposs;karma" eso-ops.sif eso-ops.def

And then run the tool(s) with one (or more) of the following commands:

apptainer exec eso-ops.sif fims.sh R
apptainer exec eso-ops.sif fims.sh B
apptainer exec eso-ops.sif fposs.sh
apptainer exec eso-ops.sif karma

Add a comment

Please log in or register to submit a comment.

Need a password reminder?