Singularity Image

Hello,

I am trying to set up a local Nextstrain build for SARS-CoV-2 sequenicng surveillance. My compute cluster does not get along with docker, but singularity works fine. I installed the latest version simply enough with “singularity pull docker://nextstrain/base:latest” however when I run " singularity pull docker://nextstrain/base" it returns that docker is not supported. Is there a way to force set the environment to singularity or docker via singularity in some way?

Thanks,
Wes

Hi @whottel! We don’t have much experience with Singularity on our team, other than some tentative, incomplete efforts to use the Nextstrain Docker image with Singularity on our own SLURM cluster. Running with nextstrain/base:latest is a safe bet, generally, though, if you have a way to specify that version information when you run your analyses.

On a related note, would you be willing to share here how you’re running your analyses with Singularity on your cluster? I bet other folks would be interested in your efforts here and, if your solution seems generally applicable, we could add your notes to the official workflow documentation.

Unfortunatley, I will not be very helpful as I ended up going with the conda/snakemake route.
For what It might be worth, as stated above in my post I opened an interactive singualrity shell with the nextstrain image to see if docker was recognized as a supported environment.

nextstrain check-setup --set-default

did not return docker as a supported envirnoment.

Also tried an non-interactive shell approach:

singularity exec -e -B .:/data --pwd /data -H <Path/to/working/directory> </Path/to/singularity/image.sif> nextstrain check-setup --set-defualt

Again, docker not supproted.

-Wes

Ah, I see; I misunderstood the Singularity environment + Nextstrain CLI context. The nextstrain command doesn’t support Singularity yet but there is an open issue to add this support eventually. Whether that issue gets resolved will depend on demand for that feature.

I’m glad the Conda + Snakemake approach is working though!

First I wanted to say what an awesome tool/pipeline! Every time I use it, I discover yet another cool feature.

I thought I would share how we are running the github snakemake pipeline using singularity on a cluster that does not support docker.

  1. Install singularity (singularity pull nextstrain.sif docker://nextstrain/base:latest).
  2. Pull latest snakemake pipeline repo (git clone GitHub - nextstrain/ncov: Nextstrain build for novel coronavirus SARS-CoV-2)
  3. Update data files, configs, etc
  4. run (singularity exec --cleanenv nextstrain.sif snakemake --profile my_profiles/<my_user_profile>)

It doesn’t use docker, but the Singularity environment + Nextstrain CLI.
The only limitations I have found so far is I can’t update the image and need to re-install when new software versions come out (when I run nextstrain update inside the container it fails) and pangolin isn’t installed inside the container so I have not been able to take advantage of the run_pangolin feature that looks like it was added in April.

Thanks again for all the hard work, it is really impressive.

Best,
Kim

3 Likes

@whottel @klauer FWIW, the just-released Nextstrain CLI 6.1.0 now supports Singularity directly. If you want to give it a go, please do report back any issues, suggestions, etc.

Thanks! I was able to install nextstrain with the singularity runtime, and I was able to run the Zika tutorial without any issues.

1 Like