From 691393e0c98759dc85a0f5513fd11e2be7f10cb7 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 12 Dec 2024 10:50:10 +0100 Subject: [PATCH 1/7] bump versions and fix missing args and command formatting --- .../nf-core/centrifuge/build/environment.yml | 3 +- modules/nf-core/centrifuge/build/main.nf | 28 +++++++------ .../centrifuge/build/tests/main.nf.test.snap | 6 +-- .../centrifuge/centrifuge/environment.yml | 3 +- modules/nf-core/centrifuge/centrifuge/main.nf | 42 ++++++++++--------- .../centrifuge/kreport/environment.yml | 3 +- modules/nf-core/centrifuge/kreport/main.nf | 17 ++++---- 7 files changed, 56 insertions(+), 46 deletions(-) diff --git a/modules/nf-core/centrifuge/build/environment.yml b/modules/nf-core/centrifuge/build/environment.yml index 42592891580..b49177e9759 100644 --- a/modules/nf-core/centrifuge/build/environment.yml +++ b/modules/nf-core/centrifuge/build/environment.yml @@ -1,5 +1,6 @@ channels: - conda-forge - bioconda + dependencies: - - bioconda::centrifuge=1.0.4.1 + - bioconda::centrifuge=1.0.4.2 diff --git a/modules/nf-core/centrifuge/build/main.nf b/modules/nf-core/centrifuge/build/main.nf index b767040de7f..02cfd8ccf92 100644 --- a/modules/nf-core/centrifuge/build/main.nf +++ b/modules/nf-core/centrifuge/build/main.nf @@ -1,11 +1,11 @@ process CENTRIFUGE_BUILD { - tag "$meta.id" + tag "${meta.id}" label 'process_high' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/centrifuge:1.0.4.1--hdcf5f25_1' : - 'biocontainers/centrifuge:1.0.4.1--hdcf5f25_1' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/centrifuge:1.0.4.2--hdcf5f25_0' + : 'biocontainers/centrifuge:1.0.4.2--hdcf5f25_0'}" input: tuple val(meta), path(fasta) @@ -15,8 +15,8 @@ process CENTRIFUGE_BUILD { path size_table output: - tuple val(meta), path("${prefix}/") , emit: cf - path "versions.yml" , emit: versions + tuple val(meta), path("${prefix}/"), emit: cf + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -29,13 +29,15 @@ process CENTRIFUGE_BUILD { mkdir ${prefix} centrifuge-build \\ - -p $task.cpus \\ - $fasta \\ + -p ${task.cpus} \\ + ${fasta} \\ ${prefix}/${prefix} \\ - --conversion-table $conversion_table \\ - --taxonomy-tree $taxonomy_tree \\ - --name-table $name_table \\ - ${size_table_cmd} + --conversion-table ${conversion_table} \\ + --taxonomy-tree ${taxonomy_tree} \\ + --name-table ${name_table} \\ + ${size_table_cmd} \\ + ${args} \\ + cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -44,7 +46,7 @@ process CENTRIFUGE_BUILD { """ stub: - def args = task.ext.args ?: '' + def _args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" """ mkdir -p ${prefix}/ diff --git a/modules/nf-core/centrifuge/build/tests/main.nf.test.snap b/modules/nf-core/centrifuge/build/tests/main.nf.test.snap index fa7d1dc3682..4a7b1247d38 100644 --- a/modules/nf-core/centrifuge/build/tests/main.nf.test.snap +++ b/modules/nf-core/centrifuge/build/tests/main.nf.test.snap @@ -80,9 +80,9 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.10.2" }, - "timestamp": "2024-02-15T10:10:19.439629103" + "timestamp": "2024-12-12T10:38:44.613715625" } } \ No newline at end of file diff --git a/modules/nf-core/centrifuge/centrifuge/environment.yml b/modules/nf-core/centrifuge/centrifuge/environment.yml index 42592891580..b49177e9759 100644 --- a/modules/nf-core/centrifuge/centrifuge/environment.yml +++ b/modules/nf-core/centrifuge/centrifuge/environment.yml @@ -1,5 +1,6 @@ channels: - conda-forge - bioconda + dependencies: - - bioconda::centrifuge=1.0.4.1 + - bioconda::centrifuge=1.0.4.2 diff --git a/modules/nf-core/centrifuge/centrifuge/main.nf b/modules/nf-core/centrifuge/centrifuge/main.nf index d9a5653df56..f287dc25c23 100644 --- a/modules/nf-core/centrifuge/centrifuge/main.nf +++ b/modules/nf-core/centrifuge/centrifuge/main.nf @@ -1,11 +1,11 @@ process CENTRIFUGE_CENTRIFUGE { - tag "$meta.id" + tag "${meta.id}" label 'process_high' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/centrifuge:1.0.4.1--hdcf5f25_1' : - 'biocontainers/centrifuge:1.0.4.1--hdcf5f25_1' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/centrifuge:1.0.4.2--hdcf5f25_0' + : 'biocontainers/centrifuge:1.0.4.2--hdcf5f25_0'}" input: tuple val(meta), path(reads) @@ -14,12 +14,12 @@ process CENTRIFUGE_CENTRIFUGE { val save_aligned output: - tuple val(meta), path('*report.txt') , emit: report - tuple val(meta), path('*results.txt') , emit: results - tuple val(meta), path('*.{sam,tab}') , optional: true, emit: sam - tuple val(meta), path('*.mapped.fastq{,.1,.2}.gz') , optional: true, emit: fastq_mapped - tuple val(meta), path('*.unmapped.fastq{,.1,.2}.gz') , optional: true, emit: fastq_unmapped - path "versions.yml" , emit: versions + tuple val(meta), path('*report.txt'), emit: report + tuple val(meta), path('*results.txt'), emit: results + tuple val(meta), path('*.{sam,tab}'), optional: true, emit: sam + tuple val(meta), path('*.mapped.fastq{,.1,.2}.gz'), optional: true, emit: fastq_mapped + tuple val(meta), path('*.unmapped.fastq{,.1,.2}.gz'), optional: true, emit: fastq_unmapped + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -27,13 +27,14 @@ process CENTRIFUGE_CENTRIFUGE { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def paired = meta.single_end ? "-U ${reads}" : "-1 ${reads[0]} -2 ${reads[1]}" + def paired = meta.single_end ? "-U ${reads}" : "-1 ${reads[0]} -2 ${reads[1]}" def unaligned = '' def aligned = '' if (meta.single_end) { unaligned = save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : '' aligned = save_aligned ? "--al-gz ${prefix}.mapped.fastq.gz" : '' - } else { + } + else { unaligned = save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' aligned = save_aligned ? "--al-conc-gz ${prefix}.mapped.fastq.gz" : '' } @@ -49,13 +50,13 @@ process CENTRIFUGE_CENTRIFUGE { centrifuge \\ -x \$db_name \\ --temp-directory ./temp \\ - -p $task.cpus \\ - $paired \\ + -p ${task.cpus} \\ + ${paired} \\ --report-file ${prefix}.report.txt \\ -S ${prefix}.results.txt \\ - $unaligned \\ - $aligned \\ - $args + ${unaligned} \\ + ${aligned} \\ + ${args} cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -64,15 +65,16 @@ process CENTRIFUGE_CENTRIFUGE { """ stub: - def args = task.ext.args ?: '' + def _args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def paired = meta.single_end ? "-U ${reads}" : "-1 ${reads[0]} -2 ${reads[1]}" + def _paired = meta.single_end ? "-U ${reads}" : "-1 ${reads[0]} -2 ${reads[1]}" def unaligned = '' def aligned = '' if (meta.single_end) { unaligned = save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : '' aligned = save_aligned ? "--al-gz ${prefix}.mapped.fastq.gz" : '' - } else { + } + else { unaligned = save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' aligned = save_aligned ? "--al-conc-gz ${prefix}.mapped.fastq.gz" : '' } diff --git a/modules/nf-core/centrifuge/kreport/environment.yml b/modules/nf-core/centrifuge/kreport/environment.yml index 42592891580..b49177e9759 100644 --- a/modules/nf-core/centrifuge/kreport/environment.yml +++ b/modules/nf-core/centrifuge/kreport/environment.yml @@ -1,5 +1,6 @@ channels: - conda-forge - bioconda + dependencies: - - bioconda::centrifuge=1.0.4.1 + - bioconda::centrifuge=1.0.4.2 diff --git a/modules/nf-core/centrifuge/kreport/main.nf b/modules/nf-core/centrifuge/kreport/main.nf index 25eb7167b7c..b7e83604950 100644 --- a/modules/nf-core/centrifuge/kreport/main.nf +++ b/modules/nf-core/centrifuge/kreport/main.nf @@ -1,11 +1,11 @@ process CENTRIFUGE_KREPORT { - tag "$meta.id" + tag "${meta.id}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/centrifuge:1.0.4.1--hdcf5f25_1' : - 'biocontainers/centrifuge:1.0.4.1--hdcf5f25_1' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/centrifuge:1.0.4.2--hdcf5f25_0' + : 'biocontainers/centrifuge:1.0.4.2--hdcf5f25_0'}" input: tuple val(meta), path(report) @@ -13,7 +13,7 @@ process CENTRIFUGE_KREPORT { output: tuple val(meta), path('*.txt'), emit: kreport - path "versions.yml" , emit: versions + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -23,7 +23,10 @@ process CENTRIFUGE_KREPORT { def prefix = task.ext.prefix ?: "${meta.id}" """ db_name=`find -L ${db} -name "*.1.cf" -not -name "._*" | sed 's/\\.1.cf\$//'` - centrifuge-kreport -x \$db_name ${report} > ${prefix}.txt + centrifuge-kreport \\ + ${args} \\ + -x \$db_name \\ + ${report} > ${prefix}.txt cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -32,7 +35,7 @@ process CENTRIFUGE_KREPORT { """ stub: - def args = task.ext.args ?: '' + def _args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.txt From 3644e04afd7ccced03200f04dfc291d8cb8bc05e Mon Sep 17 00:00:00 2001 From: Sateesh Date: Fri, 13 Dec 2024 07:23:44 +0000 Subject: [PATCH 2/7] CI: docker self hosted - userEmulate and dont fixOwnership --- tests/config/nf-test.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/config/nf-test.config b/tests/config/nf-test.config index 32966754152..61a9a981d52 100644 --- a/tests/config/nf-test.config +++ b/tests/config/nf-test.config @@ -29,8 +29,8 @@ profiles { } docker_self_hosted { docker.enabled = true - docker.userEmulation = false - docker.fixOwnership = true + docker.userEmulation = true + docker.fixOwnership = false docker.runOptions = '--platform=linux/amd64 --security-opt=no-new-privileges' } arm { From 560b8884bd9c5365d50cb280abfccf9a66ad438d Mon Sep 17 00:00:00 2001 From: Sateesh Date: Fri, 13 Dec 2024 07:34:31 +0000 Subject: [PATCH 3/7] try suggestion from claude --- tests/config/nf-test.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/config/nf-test.config b/tests/config/nf-test.config index 61a9a981d52..d8a53861be9 100644 --- a/tests/config/nf-test.config +++ b/tests/config/nf-test.config @@ -31,7 +31,7 @@ profiles { docker.enabled = true docker.userEmulation = true docker.fixOwnership = false - docker.runOptions = '--platform=linux/amd64 --security-opt=no-new-privileges' + docker.runOptions = '--platform=linux/amd64 --security-opt=no-new-privileges --cgroup-parent=/docker --userns=host' } arm { docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' From 493e82100e83b48214b2804537ffcec8223d499a Mon Sep 17 00:00:00 2001 From: Sateesh Date: Fri, 13 Dec 2024 07:38:44 +0000 Subject: [PATCH 4/7] fix cgroup parent slice --- tests/config/nf-test.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/config/nf-test.config b/tests/config/nf-test.config index d8a53861be9..5f8a1a30c6b 100644 --- a/tests/config/nf-test.config +++ b/tests/config/nf-test.config @@ -31,7 +31,7 @@ profiles { docker.enabled = true docker.userEmulation = true docker.fixOwnership = false - docker.runOptions = '--platform=linux/amd64 --security-opt=no-new-privileges --cgroup-parent=/docker --userns=host' + docker.runOptions = '--platform=linux/amd64 --security-opt=no-new-privileges --cgroup-parent=/system.slice --userns=host' } arm { docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' From 23bb3f623a0bc0e6dad25eede4231b7728fa56bb Mon Sep 17 00:00:00 2001 From: Sateesh Date: Fri, 13 Dec 2024 07:42:02 +0000 Subject: [PATCH 5/7] rm cgroup parent slice --- tests/config/nf-test.config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/config/nf-test.config b/tests/config/nf-test.config index 5f8a1a30c6b..249dc4db3e7 100644 --- a/tests/config/nf-test.config +++ b/tests/config/nf-test.config @@ -29,9 +29,9 @@ profiles { } docker_self_hosted { docker.enabled = true - docker.userEmulation = true - docker.fixOwnership = false - docker.runOptions = '--platform=linux/amd64 --security-opt=no-new-privileges --cgroup-parent=/system.slice --userns=host' + docker.userEmulation = false + docker.fixOwnership = true + docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64 --security-opt=no-new-privileges' } arm { docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' From 904976944bcac7831421e9b912365c45425d2171 Mon Sep 17 00:00:00 2001 From: Sateesh Date: Fri, 13 Dec 2024 08:09:18 +0000 Subject: [PATCH 6/7] rm security opts --- tests/config/nf-test.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/config/nf-test.config b/tests/config/nf-test.config index 249dc4db3e7..a3614034fee 100644 --- a/tests/config/nf-test.config +++ b/tests/config/nf-test.config @@ -31,7 +31,7 @@ profiles { docker.enabled = true docker.userEmulation = false docker.fixOwnership = true - docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64 --security-opt=no-new-privileges' + docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' } arm { docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' From 58336433a45b033c5adcdd79758b48607e69a3e6 Mon Sep 17 00:00:00 2001 From: Sateesh Date: Fri, 13 Dec 2024 08:17:31 +0000 Subject: [PATCH 7/7] userns n security opts --- tests/config/nf-test.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/config/nf-test.config b/tests/config/nf-test.config index a3614034fee..7f5f0082766 100644 --- a/tests/config/nf-test.config +++ b/tests/config/nf-test.config @@ -31,7 +31,7 @@ profiles { docker.enabled = true docker.userEmulation = false docker.fixOwnership = true - docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' + docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64 --security-opt=no-new-privileges --userns=host' } arm { docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64'