Image size: 993.1 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://wkapp/pyfat:2024-03-12

Shell into the container

singularity shell library://wkapp/pyfat:2024-03-12

Run the container

singularity run library://wkapp/pyfat:2024-03-12

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://wkapp/pyfat:2024-03-12

Shell into the container

apptainer shell library://wkapp/pyfat:2024-03-12

Run the container

apptainer run library://wkapp/pyfat:2024-03-12
This container includes SoFiA2 master, pyFAT, BBarolo, MCGSuite
Bootstrap: debootstrap
MirrorURL: http://archive.ubuntu.com/ubuntu/
OSVersion: jammy

%help
	This container includes SoFiA2 master, pyFAT, BBarolo, MCGSuite

%labels

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

	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 LC_ALL=C

	export SOFIA2_PATH="/opt/SoFiA-2"
	export PATH="$PATH:/opt/SoFiA-2"
	export PATH="$PATH:/opt/tirific/bin"
	export PATH="$PATH:/opt/Bbarolo"
	export PATH="$PATH:/opt/MCGSuite"

%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://gitlab.com/SoFiA-Admin/SoFiA-2.git
	cd SoFiA-2
	#git checkout tags/v2.5.0
	./compile.sh -fopenmp
	ln -s /opt/SoFiA-2/sofia /opt/SoFiA-2/sofia2

	#Install pyFAT (requires SoFiA2 & tirific)
	apt-get install -y libfftw3-dev libgsl-dev wcslib-dev libreadline-dev
	cd /opt
	git clone https://github.com/gigjozsa/tirific.git
	cd tirific
	git checkout no_pgp
	sed -i 's|/Users/peter/Github/tirific/|/usr/include/|' /opt/tirific/settings
	sed -i 's|/usr/local/include/|/usr/include/|' /opt/tirific/settings
	sed -i 's|/usr/local/lib/|/usr/lib/x86_64-linux-gnu/|' /opt/tirific/settings
	make

	python -m pip install --upgrade pip
	python -m pip install pyFAT-astro
	python -m pip install omegaconf

	# Install package requirements
	apt-get install -y libfftw3-dev wcslib-dev libcfitsio-dev gnuplot python3-pip qtbase5-dev
	python -m pip install astropy scipy pandas matplotlib pyBBarolo

	# Install BBarolo https://github.com/editeodoro/Bbarolo
	cd /usr/bin
	cd $INSTALLER_PATH
	git clone -b master --single-branch https://github.com/editeodoro/Bbarolo
	cd Bbarolo
	./configure
	make
	make install
	make pybbinst

	# Install MCGSuite https://github.com/CIRADA-Tools/MCGSuite
	apt-get install -y libbz2-dev libcurl4-gnutls-dev
	cd /opt
	git clone https://github.com/CIRADA-Tools/MCGSuite.git
	sed -i 's|FitsLibLoc=$(PARENT_DIR)/third_party/cfitsio-3.3x/libcfitsio.a -lcurl -lz|FitsLibLoc=/usr/lib/x86_64-linux-gnu/libcfitsio.a -lcurl -lz -pthread -lbz2 |' /opt/MCGSuite/src/makeflags
	sed -i 's|$(PARENT_DIR)/third_party/fftw-3.3.8/api|/usr/include/|' /opt/MCGSuite/src/makeflags
	sed -i 's|/$(PARENT_DIR)/third_party/fftw-3.3.8/.libs|/usr/lib/x86_64-linux-gnu/|' /opt/MCGSuite/src/makeflags
	sed -i 's|$(FFTW_LIBS)/libfftw3.a|/usr/lib/x86_64-linux-gnu/libfftw3.a|' /opt/MCGSuite/src/makeflags
	cd MCGSuite/src
	mkdir mods
	make
	ln -s /opt/MCGSuite/Programs /opt/MCGSuite/MockCubeGenerator

	# Fix command prompt in Singularity 3+
	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 wkapp-pyfat_2024-03-12.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"
	export PATH="$PATH:/opt/tirific/bin"
	export PATH="$PATH:/opt/Bbarolo"
	export PATH="$PATH:/opt/MCGSuite"