ReproNim / containers

Containers "distribution" for reproducible neuroimaging
Apache License 2.0
25 stars 14 forks source link

Warning in output: Set MPLCONFIGDIR when running bids-mriqc #83

Open asmacdo opened 1 year ago

asmacdo commented 1 year ago

Matplotlib expects a config/cache dir at /home/mriqc/.config/matplotlib There is no failure, because something (at least in mriqc 22.0.6) creates a directory in /tmp.

If we have a way to create a directory and set this envvar to it, matplotlib will apparently have better performance.

Matplotlib created a temporary config/cache directory at /tmp/matplotlib-hotj8pb8 because the default path (/home/mriqc/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
yarikoptic commented 1 year ago

"interesting" since in principle we do provide a HOME directory at https://github.com/ReproNim/containers/blob/master/scripts/singularity_cmd#L104 and it is writeable. But here specifically (didn't try/look inside) we are talking about /home/mriqc user home, whenever I believe actual HOME for that session might be somewhere else -- worth looking into. Before that -- to make sure, did you use that container via that singularity_cmd or directly via singularity?

asmacdo commented 1 year ago

I was using datalad and singularity_cmd.

I added an echo to the datalad containers-run

$ datalad containers-run --explicit --container-name containers/bids-mriqc --input sourcedata --output out '{inputs}' '{outputs}' participant group -w workdir
[INFO   ] Making sure inputs are available (this may take some time) 
[INFO   ] == Command start (output follows) ===== 
singularity run -W /tmp/singtmp.v4PBw8 -B /home/vagrant/DEMO/ds000003-qc/containers/binds/zoneinfo/UTC:/etc/localtime -B /tmp/singtmp.v4PBw8/tmp:/tmp -B /tmp/singtmp.v4PBw8/var/tmp:/var/tmp -e -B /home/vagrant/DEMO/ds000003-qc -H /home/vagrant/DEMO/ds000003-qc/containers/binds/HOME --pwd /home/vagrant/DEMO/ds000003-qc containers/images/bids/bids-mriqc--22.0.6.sing sourcedata out participant group -w workdir
asmacdo commented 1 year ago

(repronim-venv) vagrant@ubuntu2204:~/DEMO/ds000003-qc/containers/binds/HOME$ ls -lah

total 24K
drwxrwxr-x 2 vagrant vagrant 4.0K Feb  3 19:12 .
drwxrwxr-x 4 vagrant vagrant 4.0K Feb  3 18:57 ..
-rw-rw-r-- 1 vagrant vagrant 1.4K Feb  3 18:57 .bashrc
-rw-rw-r-- 1 vagrant vagrant   60 Feb  3 19:12 .gitconfig
-rw-rw-r-- 1 vagrant vagrant   24 Feb  3 18:57 .gitignore
-rw-rw-r-- 1 vagrant vagrant  709 Feb  3 18:57 README.md
yarikoptic commented 1 year ago

did quick check and I think that may be -H isn't really enough on its own to really establish new "HOME" inside the container... need to check more in detail later.