From 15c7190e2271de7ff347940460a484f69e27a106 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Fri, 18 Mar 2022 16:21:55 +0100 Subject: [PATCH] Deeparg singularity container fix 2 (#1406) * fix: remove left-over unnecessary code * Switch to more portable solution for singularity container issue by using bind paths * Fix input collision of dummy files * Repalce dummy with which bash * Remove dummy usage from tests * Apply suggestions from code review * Fix singularity typo --- modules/deeparg/downloaddata/main.nf | 6 +++--- modules/deeparg/downloaddata/meta.yml | 2 +- modules/deeparg/predict/main.nf | 8 ++++---- tests/modules/deeparg/downloaddata/main.nf | 2 +- tests/modules/deeparg/predict/main.nf | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/deeparg/downloaddata/main.nf b/modules/deeparg/downloaddata/main.nf index 78208d21..4e007f14 100644 --- a/modules/deeparg/downloaddata/main.nf +++ b/modules/deeparg/downloaddata/main.nf @@ -8,10 +8,10 @@ process DEEPARG_DOWNLOADDATA { 'https://depot.galaxyproject.org/singularity/deeparg:1.0.2--pyhdfd78af_1' : 'quay.io/biocontainers/deeparg:1.0.2--pyhdfd78af_1' }" /* - We have to force singularity to run with --fakeroot to allow reading of a problematic file with borked read-write permissions in an upstream dependency (theanos). - This flag may not be available on all systems and may be considered a security problem. so please document and /or warn for this in your pipeline! + We have to force singularity to run with -B to allow reading of a problematic file with borked read-write permissions in an upstream dependency (theanos). + Original report: https://github.com/nf-core/funcscan/issues/23 */ - containerOptions { "${workflow.containerEngine}" == 'singularity' ? '--fakeroot' : '' } + containerOptions { "${workflow.containerEngine}" == 'singularity' ? '-B $(which bash):/usr/local/lib/python2.7/site-packages/Theano-0.8.2-py2.7.egg-info/PKG-INFO' : '' } input: diff --git a/modules/deeparg/downloaddata/meta.yml b/modules/deeparg/downloaddata/meta.yml index 352999e2..b6b1881e 100644 --- a/modules/deeparg/downloaddata/meta.yml +++ b/modules/deeparg/downloaddata/meta.yml @@ -17,7 +17,7 @@ tools: licence: ["MIT"] input: - - none: There is no input. This module downloads a pre-built database for use with deepARG. + - none: No input required for download module. output: - versions: diff --git a/modules/deeparg/predict/main.nf b/modules/deeparg/predict/main.nf index 05cee2f8..7bb4f935 100644 --- a/modules/deeparg/predict/main.nf +++ b/modules/deeparg/predict/main.nf @@ -6,13 +6,13 @@ process DEEPARG_PREDICT { conda (params.enable_conda ? "bioconda::deeparg=1.0.2" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity//deeparg:1.0.2--pyhdfd78af_1' : + 'https://depot.galaxyproject.org/singularity/deeparg:1.0.2--pyhdfd78af_1' : 'quay.io/biocontainers/deeparg:1.0.2--pyhdfd78af_1' }" /* - We have to force singularity to run with --fakeroot to allow reading of a problematic file with borked read-write permissions in an upstream dependency (theanos). - This flag may not be available on all systems and may be considered a security problem. so please document and /or warn for this in your pipeline! + We have to force singularity to run with -B to allow reading of a problematic file with borked read-write permissions in an upstream dependency (theanos). + Original report: https://github.com/nf-core/funcscan/issues/23 */ - containerOptions { "${workflow.containerEngine}" == 'singularity' ? '--fakeroot' : '' } + containerOptions { "${workflow.containerEngine}" == 'singularity' ? '-B $(which bash):/usr/local/lib/python2.7/site-packages/Theano-0.8.2-py2.7.egg-info/PKG-INFO' : '' } input: tuple val(meta), path(fasta), val(model) diff --git a/tests/modules/deeparg/downloaddata/main.nf b/tests/modules/deeparg/downloaddata/main.nf index ed2d48bb..1074b0bc 100644 --- a/tests/modules/deeparg/downloaddata/main.nf +++ b/tests/modules/deeparg/downloaddata/main.nf @@ -5,5 +5,5 @@ nextflow.enable.dsl = 2 include { DEEPARG_DOWNLOADDATA } from '../../../../modules/deeparg/downloaddata/main.nf' workflow test_deeparg_downloaddata { - DEEPARG_DOWNLOADDATA () + DEEPARG_DOWNLOADDATA ( ) } diff --git a/tests/modules/deeparg/predict/main.nf b/tests/modules/deeparg/predict/main.nf index 2758ab58..2ada2374 100644 --- a/tests/modules/deeparg/predict/main.nf +++ b/tests/modules/deeparg/predict/main.nf @@ -13,7 +13,7 @@ workflow test_deeparg_predict { 'LS' ] - DEEPARG_DOWNLOADDATA() + DEEPARG_DOWNLOADDATA( ) DEEPARG_PREDICT ( input, DEEPARG_DOWNLOADDATA.out.db ) }