...
If you believe there is an issue with the installation of Singularity on Artemis, or an issue with the underlying Artemis hardware, open a High-Performance Computing request via the Service Management Services Portal portal. Tickets requesting support for applications running inside a container will be silently closed.
...
If you only want to run your MPI job on a single node, then you don’t have to call mpirun before the singularity call. This will use MPI installed inside the container only and not use Artemis’s MPI at all, and will still have performance equivalent to “bare metal” on Artemis.
Example to run a Dockerfile on Artemis with Singularity
Start with a Dockerfile, like this one, which contains the Trinity platform.
To run this on your computer where you have root access, you probably only need to:
Code Block |
---|
#In the directory where you have saved the Dockerfile
docker build -t trinity .
#Then this particular Dockerfile can be interfaced/run like so
sudo docker run --rm -v`pwd`:`pwd` trinity Trinity --seqType fq --single `pwd`/reads.fq.gz --max_memory 1G --CPU 4 --output `pwd`/trinity_out_dir |
But if we want to run it with Singularity we need to do a few more steps.
Firstly, we must convert the Dockerfile to a Singularity image, an easy way is to use the Python package Spython, https://vsoch.github.io/singularity-cli/recipes
Then as per Spython's instructions you can convert the Dockerfile by:
Code Block |
---|
spython recipe Dockerfile >> Singularity.trinity |
Next, edit the newly created Singularity image file. Add the Artemis-specific changes to your new singularity image, i.e.
Code Block |
---|
Bootstrap: docker From: ubuntu:16.04 %files %Dockerfile $SRC/Dockerfile.$TRINITY_VERSION %labels MAINTAINER bhaas@broadinstitute.org %post mkdir /project /scratch |
Next use Singularity to build the image (~30 minutes on my local laptop).
This image/container will be around 2GB as it contains trinity+all the dependencies+the whole operating system. This is fairly standard for Singularity images.
Code Block |
---|
sudo singularity build Singularity.trinity.build Singularity.trinity |
Now move the build to Artemis (with scp, filezilla, etc) and run it with a PBS script:
Code Block |
---|
#!/bin/bash
#PBS -P PROJECT
#PBS -l select=1:ncpus=4:mem=4gb
#PBS -l walltime=0:10:00
module load singularity/2.6.1
#Change into the directory you executed qsub from
cd "$PBS_O_WORKDIR"
#Run the singularity image, which contains the program Trinity
#The dataset "reads.fq.gz" should be in this directory,
#This will create persistent output in a folder called "trinity_out_dir"
singularity exec Singularity.trinity.build Trinity --seqType fq --single `pwd`/reads.fq.gz --max_memory 4G --CPU $NCPUS --output `pwd`/trinity_out_dir |