casa/casa-stable:v6.6.3-22-py3.8
Version sha256.669d3585cd757c708ccb36c7b6587ccbf77cf98e29dd5dacfd27b0734333c1e1
Image size: 4.2 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-stable:v6.6.3-22-py3.8
Shell into the container
singularity shell library://casa/casa-stable:v6.6.3-22-py3.8
Run the container
singularity run library://casa/casa-stable:v6.6.3-22-py3.8
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-stable:v6.6.3-22-py3.8
Shell into the container
apptainer shell library://casa/casa-stable:v6.6.3-22-py3.8
Run the container
apptainer run library://casa/casa-stable:v6.6.3-22-py3.8
Bootstrap: debootstrap
MirrorURL: http://archive.ubuntu.com/ubuntu/
OSVersion: jammy
%labels
APPLICATION_NAME Ubuntu LTS + CASA 6 (Modular)
OS_VERSION 20.04
APPLICATION_URL https://casadocs.readthedocs.io/en/stable/notebooks/introduction.html#Modular-Packages
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 PATH=$PATH:~/.local/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 universe
add-apt-repository -y multiverse
add-apt-repository -y restricted
add-apt-repository -s ppa:kernsuite/kern-9
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==1.13.0 protobuf==3.20 scikit-image matplotlib katdal astroquery DateTime
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 qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
python -m pip install --upgrade PyQt5==5.15.7
python -m pip install --upgrade astropy
#apt-get install -y pybdsf
python -m pip install bdsf[ishell]
# Install Healpy
#python -m pip install --user healpy
#python -m pip install --user --upgrade healpy
apt-get install -y python3-healpy
# Install PYGDSM
python -m pip install h5py
python -m pip install git+https://github.com/telegraphic/pygdsm
# Install CASA 6
apt-get install -y libopenmpi-dev
python -m pip install casatools==6.6.4.34
python -m pip install casatasks==6.6.4.34
python -m pip install casaplotms==2.4.3
python -m pip install casampi==0.5.5
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casadata==2023.9.25
python -m pip install casaplotserver==1.8.2
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatestutils==6.6.0.20
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casaviewer==2.1.4
python -m pip install casashell==6.6.4.34
python -m pip install almatasks
python -m pip install casatestutils==6.6.4.34
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatablebrowser==0.0.35
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casalogger==1.0.19
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casafeather==0.0.22
python -m pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatelemetry==1.3.4
#removing the pip matplotlib due to UserWarning: Unable to import Axes3D not available
python -m pip uninstall matplotlib -y
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.10/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.10/dist-packages/casaplotms/private/plotmstool.py
# CASAviewer
/usr/local/lib/python3.10/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.10/dist-packages/casaviewer/private/config.py
#CASAtablebrowser
/usr/local/lib/python3.10/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.10/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.10/dist-packages/casatablebrowser/__casatablebrowser.py
#CASAlogger
/usr/local/lib/python3.10/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.10/dist-packages/casalogger/casalogger.py
sed -i '31,33d' /usr/local/lib/python3.10/dist-packages/casalogger/casalogger.py
#CASAfeather
/usr/local/lib/python3.10/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.10/dist-packages/casafeather/casafeather.py
sed -i '52,54d' /usr/local/lib/python3.10/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 out of date TAI UTC tables (missing information on leap seconds) https://casaguides.nrao.edu/index.php/Fixing_out_of_date_TAI_UTC_tables_(missing_information_on_leap_seconds)
#cd /usr/local/lib/python3.10/dist-packages/casadata/__data__
#rsync -avz rsync://casa-rsync.nrao.edu/casa-data .
# 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-stable_v6.6.3-22-py3.8.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 PATH=$PATH:~/.local/bin
export CASARCFILES=/opt/.casarc