Image size: 3.7 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://simba/simba:2022-08-24

Shell into the container

singularity shell library://simba/simba:2022-08-24

Run the container

singularity run library://simba/simba:2022-08-24

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://simba/simba:2022-08-24

Shell into the container

apptainer shell library://simba/simba:2022-08-24

Run the container

apptainer run library://simba/simba:2022-08-24
Bootstrap: debootstrap
MirrorURL: http://ftp.leg.uct.ac.za/ubuntu/
OSVersion: bionic
Include: software-properties-common

%labels

	APPLICATION_NAME_BASE Ubuntu LTS + Anaconda3 + pyloser + martini 
	OS_VERSION 18.04 

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

	AUTHOR_NAME Jeremy Smith
	AUTHOR_EMAIL jeremy@idia.ac.za

%environment


	export PATH="/anaconda3/bin:$PATH:/opt/pyloser:/opt/analytic"
	export SPS_HOME="/opt/fsps/"
	export LC_ALL=C.UTF-8
	export PYTHONPATH="/opt/analytic:$PYTHONPATH"

%post
	##############################################################################
	# Setting up Environment  
	# Create Installation Directories and export paths. This is needed as part of post.
	# %environment scriptlet does not define these paths during %post, only after.jhhgjhgiufdgddggfgfjkj
	export PATH="/anaconda3/bin:${PATH}"
	mkdir -p /opt

	#Declare variables for downloaded applications
	export ANACONDA_FILENAME=Anaconda3-5.2.0-Linux-x86_64.sh
	export LC_ALL=C.UTF-8

	# Fix command prompt in Singularity 3.5.2
	printf 'export PS1="\u@$SINGULARITY_NAME:\w$ "' > /.singularity.d/env/999-psvars.sh
	###############################################################################

	# Installation of initial packages
	apt-get update -y
	add-apt-repository universe
	apt-get update -y
	apt-get install -y wget vim apt-utils git bzip2 build-essential mercurial gfortran python-dev gcc libboost-python-dev libgsl-dev

	# Installation of Anaconda
	cd /opt
	wget https://repo.continuum.io/archive/${ANACONDA_FILENAME}
	bash ${ANACONDA_FILENAME} -b -p /anaconda3
	rm ${ANACONDA_FILENAME}
	conda install -y python=3.6.12
	conda remove -y pyyaml sympy

	# Install python packages
	pip install --upgrade pip
	rm -r /anaconda3/lib/python3.6/site-packages/certifi*
	pip install --upgrade numpy scipy astropy cython h5py mercurial matplotlib==3.2.2 pandas spectral-cube six radio-beam extinction joblib scikit-learn aplpy regions yt h5json

	# Install Caesar
	cd /opt
	git clone https://github.com/dnarayanan/caesar.git
	cd caesar
	python setup.py install

	# Install pygadgetreader
	cd /opt
	#hg clone https://bitbucket.org/rthompson/pygadgetreader
	git clone https://github.com/dnarayanan/pygadgetreader.git
	cd pygadgetreader
	#sed -i 's/if h.boxsize > 0. and h.Ol > 0:/if h.boxsize > 0. and h.Omega0 > 0:/' /opt/pygadgetreader/readgadget/modules/common.py
	python setup.py build
	python setup.py install

	# Install pygad
	#cd /opt
	#git clone https://romeeld@bitbucket.org/dsorini/pygadds.git
	#cd pygadds
	#wget https://bitbucket.org/broett/pygad/downloads/iontbls.tar.gz
	#tar -xzf iontbls.tar.gz 
	#wget https://bitbucket.org/broett/pygad/downloads/bc03.tar.gz
	#tar -xzf bc03.tar.gz
	#potential error with ~/.config/pygad 
	#python setup.py install

	# Install pyloser
	cd /opt
	#git clone https://github.com/cconroy20/fsps
	#export SPS_HOME="/opt/fsps"
	#sed -i 's/F90FLAGS := -O3 -cpp /F90FLAGS := -O3 -cpp -fPIC /' /opt/fsps/src/Makefile
	#cd /opt/fsps/src/
	#make
	#cd /opt
	git clone https://github.com/dfm/python-fsps.git
	cd python-fsps
	git submodule init
	git submodule update
	python setup.py install
	cd /opt
	git clone https://bitbucket.org/romeeld/pyloser.git
	sed -i '1 i\#!/anaconda3/bin/python' /opt/pyloser/pyloser.py
	chmod +x /opt/pyloser/pyloser.py
	#sed -i 's/    gaccept = np\.array(\[i if (gaccept\[i]>0)/#    gaccept = np\.array(\[i if (gaccept\[i]>0)/' /opt/pyloser/loadsim.py

	# Install martini
	#pip install astromartini	
	cd /opt
	git clone https://github.com/kyleaoman/martini.git
	cd martini
	python setup.py install


	# Fix python string decode error
	pip install h5py==2.10.0

	# install pysynch
	cd /opt
	git clone https://github.com/mhardcastle/pysynch.git
	cd pysynch
	python setup.py install

	# install analytic (no install script, just required to be on python path)
	cd /opt
	git clone https://github.com/mhardcastle/analytic.git


	# Cleanup the container
	apt-get clean
	apt-get autoclean
Download simba-simba_2022-08-24.def
#!/bin/sh
# /.singularity.d/env/90-environment.sh
#!/bin/sh
# Custom environment shell code should follow




	export PATH="/anaconda3/bin:$PATH:/opt/pyloser:/opt/analytic"
	export SPS_HOME="/opt/fsps/"
	export LC_ALL=C.UTF-8
	export PYTHONPATH="/opt/analytic:$PYTHONPATH"