This is an old revision of the document!


Using singularity

On a desktop/laptop

Singularity can serve to provide a portable complete environment for EIC studies. Due to the ubiquity of Docker, a convenient approach is to maintain a Docker image which can be used to generate Singularity images. The generated Singularity image can then be used on the end user's computer and transported to machines with greater resources when needed.

As an example, let's use an established Docker image. First, Singularity must be installed on your system (see http://singularity.lbl.gov). Then, we will create an image with enough room to fit the Docker image contents. Warning, this will take 6 GB! The image can be readily deleted when it is no longer needed.

sudo singularity create -s 6000 fpadsim.img
sudo singularity import fpadsim.img docker://dbcooper/fpadsim:singularity

Note that sudo is needed. This is only for the creation of the image. Running the image does not require special privileges. Note also that a special tag (:singularity) in this repository has been created for use with Singularity. This is because this particular tag references a flattened image, since Singularity does not correctly handle multiple layers when files are overwritten in the Docker image build.

The file “fpadsim.img” now contains an complete environment necessary for simulating and reconstructing EIC events. In order to use the image, we have a few options. The most direct way to get into a fully set up environment is

singularity exec fpadsim.img bash -l

. Barring any errors, you are now running inside a container. It is a container configured to be quite transparent, and you should be able to see all the files within your home directory as well as the processes that are running outside of the container when you run “top”. This is in contrast to the default configuration of a Docker container, where isolation is desired. While your home directory is mounted within the container, the system files have been replaced by the contents of the container. Go ahead and try commands like “slic”, “promc_browser”, “jaspp”, etc.