Skip to content

Exercise 9b: Singularity

For a minimum Singularity job using Docker images create the following submission file exercise9b.sub:

universe                = vanilla
executable              = job.sh

should_transfer_files   = IF_NEEDED
when_to_transfer_output = ON_EXIT

output                  = out.$(ClusterId).$(ProcId)
error                   = err.$(ClusterId).$(ProcId)
log                     = log.$(ClusterId).$(ProcId)

queue 1

The executable script job.sh contains explicit call to singularity to launch the image. In this example we are using a CC7 image hosted in CVMFS:

#!/bin/bash

singularity exec --contain --ipc --pid \
                --home $PWD:/srv \
                --bind /cvmfs \
                /cvmfs/singularity.opensciencegrid.org/opensciencegrid/osgvo:el7 \
                /bin/cat /etc/redhat-release

A new service is being prepared which will allow experiments to convert docker images into CVMFS-hosted unpacked directories suitable for use by Singularity. In the meantime, we suggest you use these ones:

  • /cvmfs/singularity.opensciencegrid.org/opensciencegrid/osgvo:el6 for SL6
  • /cvmfs/singularity.opensciencegrid.org/opensciencegrid/osgvo:el7 for CC7