This repository contains the necessary files to build containerized environments for running different versions of CASA.
- Base Image: Ubuntu 22.04
- CASA Versions:
- 6.5.4 (Refer to
casa_6.5.4_apptainer.def) - 6.4.1 (Refer to
casa_6.4.1_apptainer.def) - 6.2.1 (Refer to
casa_6.2.1_apptainer.def)
- 6.5.4 (Refer to
The Makefile contains several targets for building and running the CASA containers:
make all: Build all CASA Apptainer images (6.5.4, 6.4.1, and 6.2.1).
make casa_6.5.4_pipeline.sif: Build Apptainer image for CASA 6.5.4.
make casa_6.4.1_pipeline.sif: Build Apptainer image for CASA 6.4.1.
make casa_6.2.1.sif: Build Apptainer image for CASA 6.2.1.
make casa-6.4.1-12-pipeline-2022.2.0.64-py3.6.tar.xz: Download CASA 6.4.1.make casa-6.2.1-7-pipeline-2021.2.0.128.tar.xz: Download CASA 6.2.1.
Building Apptainer containers requires either:
- sudo access (default): The Makefile uses
sudoby default for building containers - Unprivileged build setup: If you don't have sudo access, you need:
- The
uidmappackage installed (providesnewuidmaputility) - Proper user namespace configuration
- Build without sudo:
make APPTAINER_SUDO= all
- The
- Clone the repository.
- Run
make allto build all Apptainer images (requires sudo by default). - Use the
.siffiles as needed for your CASA tasks.
If you have the uidmap package installed and proper user namespace setup, you can build without sudo:
make APPTAINER_SUDO= allIf you encounter the error newuidmap was not found in PATH, install the uidmap package:
sudo apt install uidmapApptainer automatically mounts the current working directory (PWD) inside the container at the same path, allowing you to easily access and work with your local data. By default, Apptainer changes to the $HOME directory when a container starts. To make it stay in the PWD, use the --pwd flag:
apptainer exec --pwd $(pwd) casa_6.4.1.sif your_commandIf your current working directory (PWD) is different from $HOME, you can use the --bind and --pwd flags together to both mount the PWD and set it as the initial working directory:
apptainer exec --bind $PWD:$PWD --pwd $(pwd) casa.sif your_commandTo run an external script using CASA, you can use the -c flag like so:
apptainer exec casa_6.4.1.sif casa -c 'execfile("your_script.py")'You can run any command inside the container by prefixing it with apptainer exec:
apptainer exec casa_6.4.1.sif your_command