Skip to content
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

Modules Docker containers no longer includes quay.io as prefix #2249

Merged
merged 3 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Added config `docker.registry` to pipeline template for a configurable default container registry when using Docker containers. Defaults to `quay.io` ([#2133](https://github.com/nf-core/tools/pull/2133))
- Add tower.yml file to the pipeline template ([#2251](https://github.com/nf-core/tools/pull/2251))
- Add mastodon badge to README ([#2253](https://github.com/nf-core/tools/pull/2253))
- Removed `quay.io` from all module Docker container references as this is now supplied at pipeline level. ([#2249](https://github.com/nf-core/tools/pull/2249))

### Linting

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ The Singularity image download finds containers using two methods:
2. It scrapes any files it finds with a `.nf` file extension in the workflow `modules` directory for lines
that look like `container = "xxx"`. This is the typical method for DSL2 pipelines, which have one container per process.

Some DSL2 modules have container addresses for docker (eg. `quay.io/biocontainers/fastqc:0.11.9--0`) and also URLs for direct downloads of a Singularity continaer (eg. `https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0`).
Some DSL2 modules have container addresses for docker (eg. `biocontainers/fastqc:0.11.9--0`) and also URLs for direct downloads of a Singularity continaer (eg. `https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0`).
Where both are found, the download URL is preferred.

Once a full list of containers is found, they are processed in the following order:
Expand Down
2 changes: 1 addition & 1 deletion nf_core/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def find_container_images(self):
Later DSL2:
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0' :
'quay.io/biocontainers/fastqc:0.11.9--0' }"
'biocontainers/fastqc:0.11.9--0' }"

DSL1 / Special case DSL2:
container "nfcore/cellranger:6.0.2"
Expand Down
2 changes: 1 addition & 1 deletion nf_core/module-template/modules/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ process {{ component_name_underscore|upper }} {
conda "{{ bioconda if bioconda else 'YOUR-TOOL-HERE' }}"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'{{ singularity_container if singularity_container else 'https://depot.galaxyproject.org/singularity/YOUR-TOOL-HERE' }}':
'{{ docker_container if docker_container else 'quay.io/biocontainers/YOUR-TOOL-HERE' }}' }"
'{{ docker_container if docker_container else 'biocontainers/YOUR-TOOL-HERE' }}' }"

input:
{% if not_empty_template -%}
Expand Down
2 changes: 1 addition & 1 deletion nf_core/modules/bump_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def bump_module_version(self, module):

patterns = [
(bioconda_packages[0], f"'bioconda::{bioconda_tool_name}={last_ver}'"),
(rf"quay.io/biocontainers/{bioconda_tool_name}:[^'\"\s]+", docker_img),
(rf"biocontainers/{bioconda_tool_name}:[^'\"\s]+", docker_img),
(
rf"https://depot.galaxyproject.org/singularity/{bioconda_tool_name}:[^'\"\s]+",
singularity_img,
Expand Down
9 changes: 8 additions & 1 deletion nf_core/modules/lint/main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ def check_process_section(self, lines, fix_version, progress_bar):
else:
self.failed.append(("docker_tag", "Unable to parse docker tag", self.main_nf))
docker_tag = None
if l.startswith("biocontainers/"):
# When we think it is a biocontainer, assume we are querying quay.io/biocontainers and insert quay.io as prefix
l = "quay.io/" + l
url = urlparse(l.split("'")[0])
# lint double quotes
if l.count('"') > 2:
Expand Down Expand Up @@ -578,5 +581,9 @@ def _container_type(line):
if url_match:
return "singularity"
return None
if line.startswith("biocontainers/") or line.startswith("quay.io/"):
if (
line.startswith("biocontainers/")
or line.startswith("quay.io/")
or (line.count("/") == 1 and line.count(":") == 1)
):
return "docker"
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ process SAMPLESHEET_CHECK {
conda "conda-forge::python=3.8.3"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/python:3.8.3' :
'quay.io/biocontainers/python:3.8.3' }"
'biocontainers/python:3.8.3' }"

input:
path samplesheet
Expand Down
3 changes: 2 additions & 1 deletion nf_core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,8 @@ def get_tag_date(tag_date):
docker_image = all_docker[k]["image"]
singularity_image = all_singularity[k]["image"]
current_date = date
return docker_image["image_name"], singularity_image["image_name"]
docker_image_name = docker_image["image_name"].lstrip("quay.io/")
return docker_image_name, singularity_image["image_name"]
except TypeError:
raise LookupError(f"Could not find docker or singularity container for {package}")
elif response.status_code != 404:
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def mock_biocontainers_api_calls(rsps: responses.RequestsMock, module, version):
},
{
"image_type": "Docker",
"image_name": f"quay.io/biocontainers/{module}:{version}",
"image_name": f"biocontainers/{module}:{version}",
"updated": "2021-09-04T00:00:00Z",
},
],
Expand Down