Mriqc v0.15.2: read-only error on HPC cluster - OSError: [Errno 30] Read-only file system: '/home/bidsapp/.cache/mriqc'

Hi folks,

I’m trying to run the latest version of mriqc (0.15.2) on our HPC cluster (called biowulf) using a singularity container. The container was built, with singularity 3.5.3, using the following command:
singularity build mriqc-0.15.2 docker://poldracklab/mriqc:0.15.2

While running mriqc on a BIDS directory, with the following command, I end up with OSError: [Errno 30] Read-only file system: ‘/home/bidsapp/.cache/mriqc’

singularity run --cleanenv -B /data/PNC/BIDS:/data -B /data/PNC/BIDS/derivatives/mriqc/:/out /data/containers/mriqc-0.15.2.simg /data /out participant --participant-label sub-1234 -v

I tried a few things to fix this:

Test 1: exporting singularity specific environment variables. With the following script.

export MRIQC_HOST_HOME=/home/$USER/.cache/mriqc; 
mkdir -p ${MRIQC_HOST_HOME}; 

export SINGULARITYENV_MRIQC_HOME="/mriqc"; 

export SINGULARITY_BINDPATH=/scratch,/data,/lscratch,/home; 

singularity run --cleanenv -B ${MRIQC_HOST_HOME}:${SINGULARITYENV_MRIQC_HOME} /data/containers/mriqc-0.15.2.simg /data/PNC/BIDS /data/PNC/BIDS/derivatives/mriqc participant --participant-label sub-1234 -v

exporting SINGULARITYENV_* fixed a similar templateflow OSError I had with fmriprep. It did not work for mriqc though.

Test 2: Running with the previous version of mriqc (0.15.1) worked without errors on biowulf. This was the command I used for it:

singularity run --cleanenv -B /data/PNC/BIDS:/data -B /data/PNC/BIDS/derivatives/mriqc:/out /data/containers/mriqc-0.15.1.simg /data /out participant --participant-label sub-1234 -v

Test 3: Based on the error, it seemed like running it with root privileges, to create a directory in the /home share of the cluster, would fix it. However, I don’t have root privileges on biowulf but I do on another cluster of ours called prom. I tried running the following command (with mriqc 0.15.2) as root and that seemed to have fixed it:

singularity run --cleanenv -B /data/PNC/BIDS:/data -B /data/PNC/BIDS/derivatives/mriqc:/out /data/containers/mriqc-0.15.2.simg /data /out participant --participant-label sub-1234 -v

I would like to run the latest version of mriqc on biowulf for many reasons, but mostly because the rest of my analysis is on it. So, can I run mriqc-0.15.2 without root privileges ? What do I need to fix in my command to do so?

You are struggling to write to the home directory “/home/bidsapp/”. There used to be a -H flag for singlularity that you could specify a flag other than your own home directory on the host (which certainly used to be mounted automatically). If there’s no -H, just mount a user writeable directory (using -B as you have done above) to /home/bidsapp and that should fix your problem

1 Like

Thanks @leej3 ! Mounting user writeable directory to the /home/bidsapp worked. These are the following commands that fixed the issue:

export MRIQC_HOST_HOME=/home/$USER/singularity_home/mriqc; # mriqc directory on user's home directory
mkdir -p $MRIQC_HOST_HOME # creating mriqc host home if doesn't already exist 
export SINGULARITYENV_MRIQC_HOME="/home/bidsapp/" 
export SINGULARITY_BINDPATH=/scratch,/data,/lscratch # binding the /data and other relevant HPC directories to the singularity container

singularity run --cleanenv -B ${MRIQC_HOST_HOME}:${SINGULARITYENV_MRIQC_HOME} /data/DSST/containers/mriqc_0.15.2.simg /data/PNC/BIDS /data/PNC/BIDS/derivatives/mriqc participant --participant-label sub-1234 -vvvv --n_procs=10