-
Notifications
You must be signed in to change notification settings - Fork 751
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
refactor: Support container_registry in modules #2291
Conversation
:( |
Is this accessible from outside aws? |
When looking at the ECR gallery, @emiller88 and I were unable to find the mulled containers there - need to ask AWS folks on whether this is not mirrored (yet?). @delagoya - can you share some insights on this? |
My suggestion is to use a profiles to set a parameter to supply the container registry and then simplify the ternary expression. profiles {
singularity {
singularity.enabled = true
params.container_registry = 'https://depot.galaxyproject.org/singularity'
}
docker {
docker.enabled = true
params.container_registry = 'quay.io/biocontainers'
}
aws {
params.container_registry = 'public.ecr.aws'
}
} and then the process TOOL_SUBTOOL {
container "${ (params.container_registry ?: 'quay.io' ) + 'image:version--build' }"
} |
This is definitely the cleanest. I think it still keeps that the modules "just work" but if they want to support singularity in a non-nf-core pipeline you'll have to add the singularity profile, if you don't want to convert. |
Also one can just override from the command-line or |
Great point! I think that solves it. |
@mahesh-panchal Thoughts on:
vs. just a closure? |
Container needs a string in this context I think. |
This works 🤷 |
If the string quotes are not needed, then you don't need the container (params.container_registry ?: 'quay.io' ) + 'mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:676c5bcfe34af6097728fea60fb7ea83f94a4a5f-0' |
No dice
|
Thoughts? I think this is clean. |
Maybe then
Hmm. Maybe then just |
I think one of the two is needed when using custom config files with |
I'm alright with it. The issue now is to think what this breaks. like pre-image download in nf-core tools. |
Opened an issue here too - it will also "break" e.g. |
Slash after quay.io missing? |
It's in the test config for now. Idk which place is better to put it, probably in the module? Also thoughts on |
The |
c0acc9d
to
1ebada0
Compare
If we do this change entirely, that means also everyone has to use a separate singularity profile to keep pipelines from converting docker -> singularity images. Something to document to tell users upfront what is happening as well as to bear in mind for potential crashes when some (unaware) users now have to rely on the docker->singularity path again. Had quite a number of people with e.g. Otherwise looking good to me in general (didn't go through 600+ modules). |
This reverts commit f1c966b.
They could just manually set the container image if they wanted the docker image right? |
Not necessarily. |
Should we then set the default of the singularity profile in nf-core to the |
Yes, I think that should be the plan, but also any institutional configs that enable containers need to also be updated to use the parameter too.
|
Would vote for merging this then after some sanity checks? 🤠 |
I vote for updating template and releasing tools and then merging this PR |
Or that way around ;-) |
I updated the template, and then realized I need to update the linter as well. Woof. 🙃 |
Co-authored-by: mahesh-panchal <[email protected]>
find modules -name 'main.nf' -exec sh -c 'cat -s $0 > $0_new' {} \; find modules -name 'main.nf' -exec rm {} \; fd main.nf_new modules -x rename '_new' '' -v \;
c03006e
to
f94adb3
Compare
* Add test data to config * Add shinyngs app creation module * Add secrets * Complete meta.yml * Remove trailing whitespace * prettify * Point at documentation for optional arguments * Modernise container definition assuming #2291 goes ahead * Revert "Modernise container definition assuming #2291 goes ahead" This reverts commit f1c966b. * Fix comment * comment secrets until I figure out how to make them optional (if it's even possible) * Document secrets usage for shinyapps.io * Update version of r-shinyngs * Appease eclint * Fix mistake in docker container string * Head off meta map comment from reviewers * Rename repeated metas * output app files as single tuple * Describe meta fields * appease eclint * Simplify input channels, shift to shinyngs with bug fixed, fix tests * spacing tweak Co-authored-by: nvnieuwk <[email protected]> * Be explicit with --contrast_stats_assay 1 in ext.args * Update module meta.yaml * Correct sample sheet variable name Co-authored-by: nvnieuwk <[email protected]>
So I just discovered this is not quite true, and oddly enough from the person I was explaining it to. |
Some potential problems:
I do not think that we should rush into merging this refactoring. It's a big change and it will cause a lot of pain if it goes ahead before we're fully ready. |
The solution would be to change the default path in the module, but that would also mean needing to write a custom config with process specific container overwrite too as well as the params if needed to change it. |
Agreed! I don't think we're going to be able to cover every possible case before they come up, so I vote we cross that bridge when we get there on the first point. But feel free to drop concerns of things that could come up! I think we're waiting on nextflow-io/nextflow#3340 just so we're on the same page, so this doesn't sit for a year or two in limbo I think for the moment if anyone really wants ECR support is to add a pipeline specific |
And the fact is that BioContainers are already across quay.io and DockerHub. Legitimate modules may well refer to DockerHub for BioContainers |
Closing for now in favor of something along the lines of https://github.com/adamrtalbot/nextflow-customregistry Leaving the branch just in case. |
* Add test data to config * Add shinyngs app creation module * Add secrets * Complete meta.yml * Remove trailing whitespace * prettify * Point at documentation for optional arguments * Modernise container definition assuming nf-core/modules#2291 goes ahead * Revert "Modernise container definition assuming nf-core/modules#2291 goes ahead" This reverts commit f1c966b93553ea47122e0581bdf6b5c0ae2ea8d1. * Fix comment * comment secrets until I figure out how to make them optional (if it's even possible) * Document secrets usage for shinyapps.io * Update version of r-shinyngs * Appease eclint * Fix mistake in docker container string * Head off meta map comment from reviewers * Rename repeated metas * output app files as single tuple * Describe meta fields * appease eclint * Simplify input channels, shift to shinyngs with bug fixed, fix tests * spacing tweak Co-authored-by: nvnieuwk <[email protected]> * Be explicit with --contrast_stats_assay 1 in ext.args * Update module meta.yaml * Correct sample sheet variable name Co-authored-by: nvnieuwk <[email protected]>
Motivated by: https://aws.amazon.com/blogs/hpc/biocontainers-are-now-available-in-amazon-ecr-public-gallery/
They don't have mulled images being pushed yet however, but this should support other urls as well so it's a nice change.