Problems running Mindboggle with a Singularity Image

Summary of what happened:

Hi all,

I have been trying to run Mindboggle via my university’s HPC, which unfortunately only supports Singularity and not Docker. I tried all kinds of things, including implementing the things suggested on the Mindboggle website and the inputs of some of the previous people talking about Mindboggle and Singularity on here a while back. Creating the Singularity image was not an issue, but I’m having problems mounting to jovyan (mkdir -p $PWD/jovyan → “reader only permission” → turn off HOME binding as previously suggested?) and then with the directory not being found (“no such file or directory”) when I am in jovyan/work.

Has anyone been successful recently at running Mindboggle with Singularity?

Might be something small that doesn’t allow me to run the command, I’m quite new to programming after all. But I figured it’d be worth asking on here, since I’ve been trying to run it for a while!

Thanks in advance and best,
Lena

Command used (and if a helper script was used, a link to the helper script or the command generated):

#SBATCH --job-name=mindbogglesub10
#SBATCH --time=24:00:00
#SBATCH --partition=batch
#SBATCH --output=/project/3017084.01/Analysis/Lena/Mindboggle/logs/%x_%j.out
#SBATCH --error=/project/3017084.01/Analysis/Lena/Mindboggle/logs/%x_%j.err

#Variables
HOST=/project/3017084.01/raw/BIDS
PWD=/project/3017084.01/Analysis/Lena/Mindboggle
DOCK=/home/jovyan/work
IMAGE=/project/3017084.01/Analysis/Lena/Mindboggle/MindboggleTest_T1w.nii.gz
ID=test-01

module load singularity

#Run Mindboggle
singularity run \
  -B $HOST:$DOCK:ro \
  -B $PWD:$DOCK \
  -B $PWD/jovyan:/home/jovyan \
  -e \
  mindboggle_latest.sif \
  $DOCK/$IMAGE \
  --id $ID \
  --plugin MultiProc --plugin_args "dict(n_procs=2)" \
  --fs_openmp 5 --ants_num_threads 5 --mb_num_threads 10

Version:

PUT VERSION HERE

Environment (Docker, Singularity / Apptainer, custom installation):

Singularity / Apptainer

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

PASTE LOG OUTPUT HERE

Screenshots / relevant information:


Hi @lenkoh and welcome to neurostars!

In the future please use the Software Support post category and template to organize your post. You can see I edited your post for you this time, and there is still some information that would be helpful to know, especially the log outputs. You can edit your post to add this information.

Also, is there a reason you are mounting two different paths as DOCK in your singularity preamble? That is:

Also, $DOCK/$IMAGE is going to create a long path that combines two absolute paths, I doubt that is what you intended. I am not sure I am seeing the logic behind your bind strings here.

Why don’t you try something simpler:

OUT=/project/3017084.01/Analysis/Lena/Mindboggle #OR WHEREEVER YOU WANT OUTPUTS
singularity exec \
  -B $IMAGE:/t1.nii.gz:ro \
  -B $OUT:/out
  -e \
  mindboggle_latest.sif \
  mindboggle \
  /t1.nii.gz \
  --out /out \
  --id $ID \
  --plugin MultiProc --plugin_args "dict(n_procs=2)" \
  --fs_openmp 5 --ants_num_threads 5 --mb_num_threads 10

Best,
Steven