-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Read only Singularity cache #1879
Comments
It sounds double, only concern is trying to avoid the proliferation of magic env variables. What about adding a option in the config file eg. |
Understandable 👍🏻 I'd prefer an env variable if possible though.. In our use case I'm thinking of having @nf-core pipelines set up as environment modules on the cluster, so that people can do |
Then we can have a compromise and have both 😄 It would be enough adding a similar method nextflow/modules/nextflow/src/main/groovy/nextflow/container/SingularityCache.groovy Lines 124 to 151 in dd92772
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still planning to do this, one day (and if not new then would still be great if someone did it!) |
Was reading this again, I think the real point is having a flag (read env var) that allows enabling/disabling the pull of singularity containers. Agree on that? |
I'd prefer it as an additional location: check if the container I need is in the read-only location, fetch it to the write-location if not.. So then needs to be a little more than just a flag. |
Therefore I may not fully understand your use. You are planning to have two locations for singularity images:
Make sense? |
Yes, exactly 👍🏻 So |
ps. Whilst we're here, could even do something similar for |
This was implemented by #2381. Regarding the assets directory, not sure it should follow the same pattern. The logic behind is much more complex, we should check the impact of that before. |
Sounds good 👍🏻 The assets thing was more of a spur of the moment thought. I'm happy for that to be forgotten for now. |
hi @ewels @pditommaso I see this is marked as completed and also in the associated ticket #1706 However it sounds as if this is only implemented currently via an environment variable This is really problematic for us because its far more difficult (and far less ideal) to police users' environment variables inside the HPC to try to make sure their Nextflow runs are configured correctly to run on our systems. It would be much preferred if this same configuration was possible to be set via a https://nextflow.io/docs/latest/reference/config.html#singularity is this the case or would we need a separate Issue to request graduating this to a config option instead of just an env var? |
This seems to be a documentation bug (which is odd, I believe I've seen it there earlier). |
Yup, I'm also pretty sure that the config option exists. @christopher-hakkaart would you mind taking a look at this if you get a second please? Having some kind of automated checks (or auto-generated docs?) to make sure that every config option is documented would be a great thing to look into once we have a new config parser @bentsherman |
Thanks all; I'll add it to my sprint starting next week. If it was available earlier it might have been accidentally dropped when we did the docs restructure. Either way, it should be quick to add it back in. I'll update here with the PR once it's ready. |
New feature
Suggestion is to add a new Nextflow environment variable which works alongside
$NXF_SINGULARITY_CACHEDIR
with one difference: it is assumed to be read-only. It could be called$NXF_SINGULARITY_LIBRARY
or something.Usage scenario
With DSL2 we are relying on
$NXF_SINGULARITY_CACHEDIR
over at @nf-core much more, as users can no longer run pipelines using-with-singularity
. Generally it works great.On large shared multi-user HPC setups it makes sense to have a shared singularity cachedir for all users, to avoid duplicating many GBs of identical containers (it also makes it easier and faster for users to run pipelines). It's not a good idea to have this world writeable in such situations though. Since #1706 was closed, read-only cache dirs do work and the vision of a shared cachedir is possible 🤩 ('cc @pontus).
The problem is when a user tries to run a pipeline that hasn't already been cached. Then Nextflow will try to pull the required containers and save them to
$NXF_SINGULARITY_CACHEDIR
and fail if it's read-only. My suggestion is to add a new env var that allows the user to keep their own personal$NXF_SINGULARITY_CACHEDIR
which they can write to and also make use of a centralised shared read-only singularity cache.Suggest implementation
I guess the code doesn't need to be super complicated, just a case of looping through more than one
localpath
here:nextflow/modules/nextflow/src/main/groovy/nextflow/container/SingularityCache.groovy
Lines 177 to 183 in 671ae6d
Looking at the code we could probably avoid needing to add additional env variables if you prefer if all three of these were checked for existing images instead of just the single top priority one:
nextflow/modules/nextflow/src/main/groovy/nextflow/container/SingularityCache.groovy
Lines 115 to 118 in 671ae6d
Open to whatever solution you suggest.
The text was updated successfully, but these errors were encountered: