Each curated community model is deployed in a Singularity container that is extended to support standardized execution of all currated community models. This repository contains build recipies (definintion files) and tools for building model specific singularity (apptainer) images. To get started please use our guides in the documentation.
git clone https://github.com/JDACS4C-IMPROVE/Singularity.git
cd Singularity
./setup
From within the Singularity repo call:
make
make deploy
This will build and test the container and deploy them into ./images . If you want to deploy the images at a different location invoke the make command and set PREFIX to a path of your choosing, default is the current directory. The deploy process will create an image directory at the specified location and copy the image files into it.
make deploy PREFIX=/my/deploy/path/
Every container has a standardized scriptfor training the model called train.sh and a standard location (/candle_data_dir) for model input and output. train.sh expects /candle_data_dir To train a model you have to make your data directory available inside the container as /candle_data_dir.
singularity exec --nv --bind ${IMPROVE_DATA_DIR}:/candle_data_dir ${CONTAINER} train.sh ${GPUID}
With:
Singularity options:
--nv
enable Nvidia support--bind
make the directory available inside container For more examples see the documentation
see: (https://sylabs.io/guides/3.7/user-guide/definition_files.html)
When crafting your recipe, it is best to consider the following:
Create a singularity container from a def file. In the first case, an image is created. In the second example, a writable container is created. In the third example, an image is created from a writable container.
For working with sanboxes make sure that your sanbox directory is not on a shared volumne.
# Here we use as a pseudo standard the tmp directory for writable containers.
# IMPROVE environment variables begin with I
export WORKDIR=/tmp
export ISL=${WORKDIR}/sandboxes
export IIL=${WORKDIR}/images
singularity build --sandbox ${ISL}/${SANDBOX} $DEFILE
singularity build ${SANDBOX}.sif ${ISL}/${SANDBOX}
singularity build ${IMAGE}.sif $DEFFILE