nipreps / mriqc

Automated Quality Control and visual reports for Quality Assessment of structural (T1w, T2w) and functional MRI of the brain
http://mriqc.readthedocs.io
Apache License 2.0
300 stars 132 forks source link

Datalad Wrapper interface does not work within Docker container #1023

Closed oesteban closed 2 years ago

oesteban commented 2 years ago

In #1020, the intent was to add some sort of buffer interface, that when the inputs are found within a datalad-looking folder (i.e., the input is a broken symlink and there's a .datalad/ at the top) tries to run datalad get to fetch missing files.

However, within containers (i.e., the data folder is mounted from the host), it seems there's some further accommodation to be done, as I'm getting:

'git -c diff.ignoreSubmodules=none -c annex.merge-annex-branches=false annex find --not --in . --json --json-error-messages -c annex.dotfiles=true -- sub-0001/anat/sub-0001_T1w.nii.gz' failed with exitcode 1 under /data/ds002790 [info keys: stdout_json] [err: 'git-annex: This repository is not initialized for use by git-annex, but .git/annex/objects/ exists, which indicates this repository was used by git-annex before, and may have lost its annex.uuid and annex.version configs. Either set back missing configs, or run git-annex init to initialize with a new uuid.']

The interface works as expected with a "bare-metal" installation on the same data folder being mounted into the image. I have also made sure the folder is mounted with rw permissions.

/cc @yarikoptic

oesteban commented 2 years ago

Okay, it seems that -u $(id -u):$(id -g) is necessary when running docker. Next hurdle is: https://git-annex.branchable.com/bugs/annex_sets_remote___40__regular_http__41___to_be_ignored_while_running_in_docker_container/