Image size: 3.3 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.0

Shell into the container

singularity shell library://casa/casa-modular:v6.5.0

Run the container

singularity run library://casa/casa-modular:v6.5.0

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.0

Shell into the container

apptainer shell library://casa/casa-modular:v6.5.0

Run the container

apptainer run library://casa/casa-modular:v6.5.0
BootStrap: docker
From: ubuntu:20.04

%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.5.2
        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 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
        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
	add-apt-repository -y universe
        add-apt-repository -y multiverse
        add-apt-repository -y restricted
        add-apt-repository -s ppa:kernsuite/kern-7
        apt-get install -y casacore-dev casacore-data

        # Update pip and install python packages
        apt-get install -y python3-pip
        pip install --upgrade cloudpickle holoviews datashader bokeh pandas dask-ms[xarray] scipy protobuf==3.20
        pip install --no-binary :all: python-casacore
        pip install pyvirtualdisplay

        # Install Jupyter for IPykernel
        pip install jupyter ipykernel

        # Install PyBDSF
        apt-get install -y libboost-python-dev libboost-numpy-dev python-setuptools
        pip install --upgrade numpy scikit-image
        pip install astropy==4.1 bdsf matplotlib katdal astroquery
        apt-get install -y pybdsf

        # Install CASA 6
        apt-get install -y libopenmpi-dev
        pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatools==6.5.0.15
        pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatasks==6.5.0.15
        pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple almatasks==1.5.2
        pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casampi==0.5.0
        pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casadata==2022.5.23
        pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casaplotserver==1.2.1
        pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatestutils==6.5.0.15
        # Install unvalidated packages
        pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casaplotms==1.6.2
        pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casaviewer==1.5.2
        pip install --index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casashell==6.5.0.15

        cd /opt
        git clone https://open-bitbucket.nrao.edu/scm/casa/casaaddons.git

        # Instal katbeam
        pip install git+https://github.com/ska-sa/katbeam

        # Extract and fix casaplotms due to FUSE issues
        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

        # 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.0.def
#!/bin/sh


	python "$@"
# /.singularity.d/env/10-docker2singularity.sh
#!/bin/sh
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# /.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 CASARCFILES=/opt/.casarc