nf-core / tools

Python package with helper tools for the nf-core community.
https://nf-co.re
MIT License
240 stars 188 forks source link

Tool to create child images for users without overlayFS #69

Closed ewels closed 4 years ago

ewels commented 6 years ago

One of the most common problems for users with singularity is that they don't have overlayFS configured, so the pipeline fails with directory mounting issues.

This subcommand would generate a Singularity image script based on the main pipeline, but dynamically adding in all base directories (detected or specified) so that mounting works properly.

Steps:

apeltzer commented 6 years ago

Maybe we could have a look at Packer.io - unfortunately no support for Singularity yet.

https://www.packer.io/docs/builders/index.html

ewels commented 6 years ago

@aanil and @remiolsen - could you add some comments here describing how far you got with this issue at the hackathon please? It would be good to come to a conclusion and get this implemented somehow (I remember that we had some different ideas for what kind of solution we could use).

remiolsen commented 6 years ago

Previously, I have fixed this issue in Nexflow configs. You can do this by setting singularity.runOptions='-B /mount1:/mount1 -B /mount2:/mount2'. Ex

So a suggestion might be to in stead of a tool that creates a new image, why not have one that creates a new config?

apeltzer commented 6 years ago

Cool idea - but I fear this will only work on systems with enabled OverlayFS. We should probably test this on a system where there is no OverlayFS available and then find out if this works - would be much easier and not require setting up a new container for users with specific hardware...

ewels commented 6 years ago

I've asked if this can be tested in Gothenburg - xref: https://github.com/nf-core/rnaseq/issues/76#issuecomment-415359282

mihai-sysbio commented 6 years ago

Even if the solution above would work well for one user, we would basically need to tell everybody to fix it this way. For us at Hebbe the solution was to build the Singularity image from this recipe: edit: I'm referring to rnaseq in particular, which is used in the Hebbe cluster

Bootstrap: docker
From: nfcore/rnaseq

%post
    mkdir -p /c3se
    mkdir -p /local
    mkdir -p /apps
    mkdir -p /usr/share/lmod/lmod
    mkdir -p /var/hasplm
    mkdir -p /var/opt/thinlinc
    mkdir -p /usr/lib64
    touch /usr/lib64/libdlfaker.so
    touch /usr/lib64/libvglfaker.so
    touch /usr/bin/nvidia-smi

Apparently overlayfs isn't available in centos 6.

mihai-sysbio commented 6 years ago

Docker compose can take in multiple files. Singularity seems to have something similar for its recipes.

I was thinking it would be useful if Singularity had, like Docker, an automatic way to merge config files. At a glance, though, it doesn't seem it handles overriding the base config by another config.

ewels commented 4 years ago

I think we should close this issue now. We haven't seen the problem nearly so frequently recently and I don't think that it is worth the effort to write this helper tool.