Runing Singularity/ Docker fMRIprep

Hi,

I am trying to run a docker image (fMRIprep) for the first time - so pardon me for the noob question.

  1. run
    singularity run [path to img] [other container specific arguements]
    srun singularity run [path to img] [other container specific arguements]
    srun singularity run --cleanenv [path to img] [other container specific arguements] and got the following error:
    [WARNING] DueCredit internal failure while running <function _get_active_due at 0x2b1a9e824b70>: PermissionError(13, ‘Permission denied’). Please report to developers at Issues · duecredit/duecredit · GitHub (utils.py:194)
    2022-06-20 11:14:50,208 [ERROR ] Failed to import duecredit due to Both inactive and active collectors should be provided. Got active=None, inactive=InactiveDueCreditCollector() (due.py:63)

  2. exec
    srun singularity exec [path to img] [other container specific arguements], and got this error: /.singularity.d/actions/exec: 9: exec: /home/users/t/tanm/data/final_experiment/fmri/data4analyses/: Permission denied

  3. I attempted to use the argument bind -B, but got this error: ERROR : Image path doesn’t exists
    ABORT : Retval = 255

What should I change to be able to launch this docker image?

Thank you very much.

Best,
Mi Xue

Hello,

Thanks to contact HPC team regarding this problem. If you need to use docker image on the cluster it is mandatory to usesingularity.

Usage of this tool is documented on the wiki :

https://doc.eresearch.unige.ch/hpc/applications_and_libraries?s[]=singularity

Did you put the module load command on the top of your script?

ml GCC/9.3.0 Singularity/3.7.3-Go-1.14

Best regards,

1 Like

Hi,

according to this link you can use directly singularity as we have version bigger than 2.5.

Build the fMRIpre image:

[sagon@login2.baobab fmirep]$ ml GCC/9.3.0 Singularity/3.7.3-Go-1.14
[sagon@login2.baobab fmirep]$ singularity build fmriprep-latest.simg docker://poldracklab/fmriprep:latest
INFO:    Starting build...
Getting image source signatures
Copying blob 0a01a72a686c done
[...]
INFO:    Creating SIF file...
INFO:    Build complete: fmriprep-latest.simg
[sagon@login2.baobab fmirep]$ singularity build fmriprep-latest.simg docker://poldracklab/fmriprep:latest�^C
[sagon@login2.baobab fmirep]$ ls -lah fmriprep-latest.simg
-rwxr-xr-x 1 sagon unige 4.6G Jun 22 10:53 fmriprep-latest.simg

Create an sbatch script runfmriprep.sh:

#!/bin/sh

#SBATCH --partition=debug-cpu
#SBATCH --cpus-per-task=2

ml GCC/9.3.0 Singularity/3.7.3-Go-1.14

srun singularity run --cleanenv fmriprep-latest.simg \
    datadir outputdir \
    participant \
    --participant-label label

Run the script on a compute node:

[sagon@login2.baobab fmirep]$ sbatch runfmriprep.sh

You should of course adapt the script to your needs.

Best

2 Likes

awesome, thank you so much!

my only issue now is that the version of the image is not the latest, even though we stated ‘latest’ when downloading the image… though I guess this might be a problem on their side?

Hello,

Yes issue is not from our side, this is due to the tag latest not pointing on the latest version, but you can easily replace “latest” by the appropriate version number :

poldracklab/fmriprep Tags | Docker Hub

Have a nice day,