casa/casa-modular:v6.5.5
Version sha256.e8abed3bde64cb039b27e9cbd29bba7855705e84201b962010194e3c8135a249
Image size: 3.9 GB
For more on pulling from the registry, see the ilifu documentation.
First, once: add the registry and make it your default
singularity remote add --no-login idia-registry https://sregistry.idia.ac.za
singularity remote use idia-registry
If you added it before, as the ilifu docs describe, remote add says it already exists: just run remote use.
Log in, for a private collection
singularity remote login idia-registry
Paste a token from your token page when asked. Public collections need no login.
Pull the container
singularity pull library://casa/casa-modular:v6.5.5
Shell into the container
singularity shell library://casa/casa-modular:v6.5.5
Run the container
singularity run library://casa/casa-modular:v6.5.5
First, once: add the registry and make it your default
apptainer remote add --no-login idia-registry https://sregistry.idia.ac.za
apptainer remote use idia-registry
If you added it before, as the ilifu docs describe, remote add says it already exists: just run remote use.
Log in, for a private collection
apptainer remote login idia-registry
Paste a token from your token page when asked. Public collections need no login.
Pull the container
apptainer pull library://casa/casa-modular:v6.5.5
Shell into the container
apptainer shell library://casa/casa-modular:v6.5.5
Run the container
apptainer run library://casa/casa-modular:v6.5.5
Bootstrap: debootstrap
MirrorURL: http://archive.ubuntu.com/ubuntu/
OSVersion: focal
%labels
APPLICATION_NAME Ubuntu LTS + CASA 6
OS_VERSION 20.04
APPLICATION_URL https://casa.nrao.edu/casadocs/latest/usingcasa/obtaining-and-installing
SYSTEM_NAME iLifu
SYSTEM_SINGULARITY_VERSION 3.9.1
SYSTEM_URL http://www.ilifu.ac.za
AUTHOR_NAME IDIA
AUTHOR_EMAIL support@ilifu.ac.za
%environment
export PYTHONPATH=$PYTHONPATH:/opt/casaaddons
export XDG_RUNTIME_DIR=$HOME
export PATH=$PATH:/opt/casaplotms/usr/bin
export PATH=$PATH:/opt/casaviewer/usr/bin
export PATH=$PATH:/opt/casatablebrowser/usr/bin
export PATH=$PATH:/opt/casalogger/usr/bin
export PATH=$PATH:/opt/casafeather/usr/bin
export CASARCFILES=/opt/.casarc
%post
# Create Installation Directories and export paths. This is needed as part of post.
# %environment scriptlet does not define these paths during %post, only after.
mkdir -p /opt
export DEBIAN_FRONTEND=noninteractive
# Installation of initial packages
apt-get update -y
apt-get install -y software-properties-common
add-apt-repository -y universe
add-apt-repository -y restricted
add-apt-repository -s ppa:kernsuite/kern-7
apt-get update -y
apt-get install -y wget vim apt-utils git build-essential bzip2 libpng-dev gfortran gfortran xvfb ghostscript curl pkg-config libxi-dev libfuse-dev python-is-python3
apt-get install -y fuse
apt-get install -y casacore-dev casacore-data
# Update pip and install python packages
apt-get install -y python3-pip
python -m pip install --upgrade cloudpickle holoviews datashader bokeh pandas dask-ms[xarray] scipy protobuf==3.20
python -m pip install --no-binary :all: python-casacore
python -m pip install pyvirtualdisplay
# Install Jupyter for IPykernel
python -m pip install jupyter ipykernel
# Install PyBDSF
apt-get install -y libboost-python-dev libboost-numpy-dev python-setuptools
python -m pip install --upgrade numpy scikit-image
python -m pip install --upgrade astropy scipy bdsf matplotlib katdal astroquery
#apt-get install -y pybdsf
python -m pip install bdsf
# Install CASA 6
apt-get install -y libopenmpi-dev
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatools==6.5.5.21
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatasks==6.5.5.21
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple almatasks==1.6.1
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casampi==0.5.3
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casadata==2023.4.10
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casaplotserver==1.5.1
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatestutils==6.5.5.21
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casaplotms==2.0.1
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casaviewer==1.7.1
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casashell==6.5.5.21
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatablebrowser==0.0.31
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casalogger==1.0.15
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casafeather==0.0.18
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatelemetry==1.3.4
cd /opt
git clone https://open-bitbucket.nrao.edu/scm/casa/casaaddons.git
# Instal katbeam
python -m pip install git+https://github.com/ska-sa/katbeam
# Extract and fix AppImage applications due to FUSE issues
# CASAplotMS
cd /opt
/usr/local/lib/python3.8/dist-packages/casaplotms/__bin__/casaplotms-x86_64.AppImage --appimage-extract
mv squashfs-root casaplotms
chmod -R go+rx /opt/casaplotms
sed -i -e "s|app_path = __os.path.join( __os.path.abspath( __os.path.join(__os.path.dirname(__file__),\"..\") ), '__bin__/casaplotms-x86_64.AppImage')|app_path = '/opt/casaplotms/usr/bin/casaplotms'|g" /usr/local/lib/python3.8/dist-packages/casaplotms/private/plotmstool.py
# CASAviewer
/usr/local/lib/python3.8/dist-packages/casaviewer/__bin__/casaviewer-x86_64.AppImage --appimage-extract
mv squashfs-root casaviewer
chmod -R go+rx /opt/casaviewer
sed -i -e "s|app_path = __os.path.join( __os.path.abspath(__os.path.join(__os.path.dirname(__file__),'..')), '__bin__/casaviewer-x86_64.AppImage' )|app_path = '/opt/casaviewer/usr/bin/casaviewer'|g" /usr/local/lib/python3.8/dist-packages/casaviewer/private/config.py
#CASAtablebrowser
/usr/local/lib/python3.8/dist-packages/casatablebrowser/__bin__/casatablebrowser-x86_64.AppImage --appimage-extract
mv squashfs-root casatablebrowser
chmod -R go+rx /opt/casatablebrowser
sed -i -e "s|app_path = __os.path.abspath(__os.path.dirname(__file__))|app_path = '/opt/casatablebrowser/usr/bin'|g" /usr/local/lib/python3.8/dist-packages/casatablebrowser/__casatablebrowser.py
sed -i -e 's|app_path = __os.path.join( app_path, "__bin__","casatablebrowser-x86_64.AppImage" )|app_path = __os.path.join( app_path, "casatablebrowser" )|g' /usr/local/lib/python3.8/dist-packages/casatablebrowser/__casatablebrowser.py
#CASAlogger
/usr/local/lib/python3.8/dist-packages/casalogger/__bin__/casalogger-x86_64.AppImage --appimage-extract
mv squashfs-root casalogger
chmod -R go+rx /opt/casalogger
sed -i -e "s|app_path = os.path.join(|app_path = '/opt/casalogger/usr/bin/casalogger'|g" /usr/local/lib/python3.8/dist-packages/casalogger/casalogger.py
sed -i '31,33d' /usr/local/lib/python3.8/dist-packages/casalogger/casalogger.py
#CASAfeather
/usr/local/lib/python3.8/dist-packages/casafeather/__bin__/casafeather-x86_64.AppImage --appimage-extract
mv squashfs-root casafeather
chmod -R go+rx /opt/casafeather
sed -i -e "s|app_path = __os.path.join(|app_path = '/opt/casafeather/usr/bin/casafeather'|g" /usr/local/lib/python3.8/dist-packages/casafeather/casafeather.py
sed -i '52,54d' /usr/local/lib/python3.8/dist-packages/casafeather/casafeather.py
# Fix path to casacore data (https://github.com/casacore/python-casacore/issues/181)
echo 'measures.directory: /usr/share/casacore/data' > /opt/.casarc
# Fix command prompt in Singularity 3.5.2
printf 'export PS1="\u@$SINGULARITY_NAME:\w$ "' > /.singularity.d/env/999-psvars.sh
# Cleanup the container
apt-get clean
apt-get autoclean
%runscript
python "$@"
Download casa-casa-modular_v6.5.5.def
#!/bin/sh
python "$@"
# /.singularity.d/env/90-environment.sh
#!/bin/sh
# Custom environment shell code should follow
export PYTHONPATH=$PYTHONPATH:/opt/casaaddons
export XDG_RUNTIME_DIR=$HOME
export PATH=$PATH:/opt/casaplotms/usr/bin
export PATH=$PATH:/opt/casaviewer/usr/bin
export PATH=$PATH:/opt/casatablebrowser/usr/bin
export PATH=$PATH:/opt/casalogger/usr/bin
export PATH=$PATH:/opt/casafeather/usr/bin
export CASARCFILES=/opt/.casarc