Closed ewels closed 4 years ago
Maybe we could have a look at Packer.io - unfortunately no support for Singularity yet.
@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).
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?
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...
I've asked if this can be tested in Gothenburg - xref: https://github.com/nf-core/rnaseq/issues/76#issuecomment-415359282
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.
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.
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.
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:
nf-core
tools subcommandfix-overlay
, takes name of target pipelineSingularity
file from the target pipelineFrom
and%post
statements in Singularity file/tmp
and runsingularity build
to make a new image with the required mount points