Testing a singularity image


When you use a singularity image and a process fails, to understand the problem, you have to run the command inside the container.

For exemple, run the following command:

nextflow run nextflow-io/rnaseq -with-timeline -with-trace -with-report -with-dag -r v1.5 \
--genome /usr/local/bioinfo/src/NextflowWorkflows/example_on_cluster/data/ITAG2.3_genomic_Ch6.fasta

The file /usr/local/bioinfo/src/NextflowWorkflows/example_on_cluster/data/ITAG2.3_genomic_Ch6.fasta exists, but we get the following error:

Command error:
  Error: could not open ITAG2.3_genomic_Ch6.fasta
  Error: Encountered internal Bowtie 2 exception (#1)
  Command: bowtie2-build --wrapper basic-0 --threads 1 ITAG2.3_genomic_Ch6.fasta genome.index

Work dir:
  /work/bleuet/nextflow-tutorial/work/6c/bb527b2ac54e8916eb2fb54f3774ab

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

To understand the problem, you have to re-execute the command in the same environmment, so go to the work directory of the failed process. Look at files .err or .log.

  1. Try to execute .command.run

    bash .command.run
    

    You get the same error ... and you get closer to the problem.

  2. Then get the line of singularity command in file .command.run

    $ grep singularity .command.run
    set +u; env - PATH="$PATH" SINGULARITYENV_TMP="$TMP" SINGULARITYENV_TMPDIR="$TMPDIR" SINGULARITYENV_NXF_DEBUG=${NXF_DEBUG:=0} singularity exec -B /bank -B /work2 -B /work -B /save -B /home /work/bleuet/nextflow-tutorial/work/singularity/nextflow-rnatoy@sha256-9ac0345b5851b2b20913cb4e6d469df77cf1232bafcadf8fd929535614a85c75.img /bin/bash -c "cd $PWD; /bin/bash /work/bleuet/nextflow-tutorial/work/6c/bb527b2ac54e8916eb2fb54f3774ab/.command.run nxf_trace"
    
  3. Launch the image in shell mode with the options found previously.

    singularity shell -B /bank -B /work2 -B /work -B /save -B /home <PathToImg>.img
    
  4. Execute command

    sh .command.sh
    
  5. Test the access to the input file:

    ls /usr/local/
    bin  etc  games  include  lib  man  sbin  share  src
    

    !!!! /usr/local/bioinfo/ does not exist in the container !!!! Should add option -B /usr/local/bioinfo/ in nextflow.config.

Exercise 7 :

Follow all the steps described in this section to enter in the image and reproduce the mount problem. Then correct it.

results matching ""

    No results matching ""