alesssia / YAMP

YAMP: Yet Another Metagenomic Pipeline
GNU General Public License v3.0
56 stars 28 forks source link

Something missing in singularity container #25

Open mfreidin1975 opened 2 years ago

mfreidin1975 commented 2 years ago

Hi Alessia,

Here is the command I run

nextflow run YAMP/YAMP.nf \ --reads1 /scratch/microb/xyz_1.fastq.gz \ --reads2 /scratch/microb/xyz_2.fastq.gz \ --prefix XYZ \ --mode QC -profile base,singularity

And this is the error I face

Error executing process > 'quality_assessment (XYZ)'

Caused by: Process quality_assessment (XYZ) terminated with an error exit status (1)

Command executed:

fastqc -q SRR13350704_1.fastq.gz SRR13350704_2.fastq.gz

Command exit status: 1

Command output: (empty)

Command error: WARNING: Skipping mount /var/lib/singularity/mnt/session/etc/resolv.conf [files]: /etc/resolv.conf doesn't exist in container /bin/bash: line 0: cd: /scratch/users/k1471250/work/9d/45759087de2ad752480ba58e000320: No such file or directory /bin/bash: .command.sh: No such file or directory

Work dir: /scratch/users/k1471250/work/9d/45759087de2ad752480ba58e000320

Tip: view the complete command output by changing to the process work dir and entering the command cat .command.out

It was not an issue before, when we used other HPC .

Thanks,

Max

vshanka23 commented 1 year ago

Hi Max,

I had the same issue. The way to fix it is to replace the singularity parameter block with the following in your nextflow.config.

singularity {
  singularity.enabled = true
  singularity.engineOptions = '--debug'
  singularity.autoMounts = true
 }

A brief explanation: Singularity lets you create and mount paths that do not exist within the container but nextflow does not by default let user-specific host paths to be mounted within. In order to do this, we need to add the additional autoMounts flag to let Singularity know to mount user-specific host paths. This issue only occurs if the Singularity image doesn't contain a directory path that exists in the host. For example, on our HPC architecture, we have NFSes mounted on /data but /data doesn't exist within the images for YAMP. One important caveat, the installation for Singularity must have the user bind control feature enabled within the Singularity config file for this to work. Fortunately, I am the sysadmin for our cluster and I had complied Singularity with this flag enabled during installation. It is easy to turn it on, assuming your sysadmin is willing. engineOptions is simply there to provide more verbose logs from Singularity and feed to nextflow.

Vijay