ASLprep docker image always downloading templateflow files

Summary of what happened:

In running aslprep, I am on a system without internet. I downloaded the docker image and installed via a tar’d file from a system with internet. ASLprep image runs as normal and I can see templateflow files in /home/aslprep/.cache/templateflow. However, when I run aslprep it attempts to download MNI152NLin2009cAsym_res-01_T2w.nii.gz despite this file in the cached directory. Obviously this fails but is there a way I can route around the download process?

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

docker run -it --rm -m 12GB -v .license:/license.txt -v /rawdata:/data:ro -v /derivatives:/out:rw -v aslprep_work:/work:rw pennlinc/aslprep /data /out participant --participant-label 101 --fs-license-file /license.txt -w /work --fs-subjects-dir /out/sourcedata/freesurfer --fs-no-resume --skip_bids_validation --bids-filter-file /data/bids_filter.json --output-spaces MNI152NLin2009cAsym:res-2 T1w --nprocs 4 --force-bbr --write-graph --asl2anat-dof 6 --derivatives /out

Version:

0.7.5

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

Docker

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

bids_validator docker image

See screenshow below.

Relevant log outputs (up to 20 lines):

Screenshots / relevant information:


Hi @matt.sherwood,

In the future, text snippets represented as code

like this (using the </> button in the text editor or using tickmarks (`)

is preferable to screenshots.

Are these actual files (e.g. retrieved with datalad get) or just symlinks? Can you open them with an image viewer and do they have plausible filesizes? If not, you will need to download them. If your login node also doesn’t have internet, you will need to download them elsewhere and upload via ssh or other method to your cluster. If you upload them in your /home/aslprep/.cache/templateflow folder that works, but you can also do it elsewhere as long as you update the TEMPLATEFLOW_HOME variable in the container accordingly (and make sure it is mounted to the container at runtime).

Best,
Steven

You make a great point. I was running fmriprep before without issue. Upon checking both, many of the files in the templateflow directory have a size of 0. I will try to get them downloaded them just bind mount the templateflow directory and try again.

Thanks for the insight.
-Matt

1 Like

Ok so I downloaded all templateflow files and put them in a local folder /templateflow. I then attempted to run again using the command above but adding:

-e TEMPLATEFLOW_HOME=/templateflow -v /templateflow:/templateflow:rw

It still attempts to download. I then tried to put into the .cache:

-v /templateflow:/home/aslprep/.cache/templateflow:rw

aslprep is still attempting to download. Now it is the tpl-MNI152NLin2009cAsym_res-01_T1w.nii.gz even though I am specifying the res-02. Originally it was attempting to download the res-01_T2w.nii.gz. I have confirmed by changing the entrypoint to /bin/bash that when mounting the ways above the files now have files sizes and exist in this directory.

Hi @matt.sherwood,

What’s the file structure here? Does it look identical to how templateflow is supposed to look? E.g., with the tpl- subfolders like in your .cache folder? You should make sure, like original templateflow, that it is a datalad dataset.

It might need both. Did you download both of them?

Best,
Steven

Thanks for the quick response. Yes the file structure is the same. I downloaded via python templateflow using the code (7.4GB, 5,232 files)

from templateflow import api
for a in api.templates():
api.get(a)

Below are some screenshots:


Hi @matt.sherwood,

Is that in /templateflow or /home/aslprep/.cache/templateflow?

Best,
Steven

Found the problem. I had a templateflow/templateflow folder. This had cached empty files. I removed that, aslprep and matplotlib from /templateflow. It is now running.

1 Like