Image size: 803.2 MB

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://sofia/sofia:v2.5.1-2023-03-16

Shell into the container

singularity shell library://sofia/sofia:v2.5.1-2023-03-16

Run the container

singularity run library://sofia/sofia:v2.5.1-2023-03-16

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://sofia/sofia:v2.5.1-2023-03-16

Shell into the container

apptainer shell library://sofia/sofia:v2.5.1-2023-03-16

Run the container

apptainer run library://sofia/sofia:v2.5.1-2023-03-16
This container includes SoFiA2 master, SoFiA-image-pipeline master and ImageMagick
Bootstrap: debootstrap
MirrorURL: http://archive.ubuntu.com/ubuntu/
OSVersion: focal

%help
	This container includes SoFiA2 master, SoFiA-image-pipeline master and ImageMagick

%labels

	APPLICATION_NAME Ubuntu LTS + SoFiA2 + SIP + ImageMagick
	APPLICATION_URL https://github.com/SoFiA-Admin/SoFiA-2
	OS_VERSION 20.04 

	SYSTEM_NAME iLifu
	SYSTEM_SINGULARITY_VERSION 3.9.1
	SYSTEM_URL http://www.ilifu.ac.za

	AUTHOR_NAME Jeremy Smith
	AUTHOR_EMAIL jeremy@idia.ac.za

%environment

	export LC_ALL=C

	export SOFIA2_PATH="/opt/SoFiA-2"
	export PATH="$PATH:/opt/SoFiA-2"

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

	# Installation of initial packages
	export DEBIAN_FRONTEND=noninteractive
	apt-get update -y
	apt-get install -y software-properties-common
	add-apt-repository -y universe
	apt-get install -y wget vim apt-utils git build-essential make bzip2 gfortran xvfb ghostscript curl pkg-config python3-pip python-is-python3 libpng-dev

	# Install SoFiA2
	apt-get install -y gcc wcslib-dev libopenmpi-dev openmpi-bin openmpi-common
	cd /opt
	git clone https://github.com/SoFiA-Admin/SoFiA-2.git
	cd SoFiA-2
	#git checkout tags/v2.5.0
	./compile.sh -fopenmp

	# Install SoFiAX
	cd /opt
	git clone https://github.com/AusSRC/SoFiAX.git
	sed -i -e "s|    schema = config.get('db_schema', 'wallaby')|    schema = config.get('db_schema', 'laduma')|g" SoFiAX/sofiax/merge.py
	cd SoFiAX
	python setup.py install

	# Install ImageMagick (https://imagemagick.org/script/install-source.php)
	cd /opt
	git clone https://github.com/ImageMagick/ImageMagick.git ImageMagick-7.1.0
	cd ImageMagick-7.1.0
	./configure
	make
	make install
	ldconfig /usr/local/lib

	# Install SoFiA-Image-Pipeline
	cd /opt
	git clone https://github.com/kmhess/SoFiA-image-pipeline.git
	cd SoFiA-image-pipeline
	pip3 install .
	pip3 install cmasher

	#Install requirements for OptiFind (https://github.com/SoFiA-Admin/OptiFind)
	pip3 install astropy
	
	# 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

	exec sofia "$@" 
Download sofia-sofia_v2.5.1-2023-03-16.def
#!/bin/sh


	exec sofia "$@" 
# /.singularity.d/env/90-environment.sh
#!/bin/sh
# Custom environment shell code should follow



	export LC_ALL=C

	export SOFIA2_PATH="/opt/SoFiA-2"
	export PATH="$PATH:/opt/SoFiA-2"