DKFZ-ODCF / nf-bam2fastq

Nextflow-based BAM-to-FASTQ conversion and FASTQ-sorting workflow.
3 stars 4 forks source link

Fix Singularity container startup #52

Open vinjana opened 1 year ago

vinjana commented 1 year ago

On a another workflow I got problems with running a similar container with Nextflow 22. There the Singularity container will fail to initialize the Conda environment. Not sure why this wasn't a problem in the past, but Nextflow uses singularity exec to execute the container. exec does not run the runscript section (by definition). Additionally, bash, as called by Nextflow (non-interactive, non-login) failed to load any of the initialization files (I tried even --init-file), so an initialization via /etc/bash.bashrc seemed not to be possible.

To-Do

  1. Check whether we have the same problems here.
  2. If so, see here how the fix is done for another workflow with a dedicated Singularity.def that has an %environment block.
vinjana commented 1 year ago

Add singularity.runOptions = "--no-home" to the "singularity" block in the nextflow.config. This will prevent automatic loading of the .bashrc and the Conda initialization done there.