DCAN-Labs / BIBSnet

This BIDS App provides the utility of creating a nnU-Net anatomical MRI segmentation and mask with a infant brain trained model. It can easily be included in other processing pipelines and for circumventing JLF within Nibabies.
https://bibsnet.readthedocs.io/en/latest/
Apache License 2.0
4 stars 8 forks source link

FIX: extend read/execute permissions to all files used by BIBSnet #134

Closed scott-huberty closed 1 month ago

scott-huberty commented 2 months ago

Fixes #132 Fixes #133

Since the devs are already giving all users read+execute permissions to all files in /home/bibsnet/src, I am assuming that it is okay with the devs to extend this to /home/bibsnet/data and /opt/nnUNet


Long story:

Both of the linked issues arose from file permission issues, specifically for users who are in the others permission group (i.e. not in the user or group groups).

For example, on main, if you enter into the docker container with:

docker run -it --entrypoint /bin/bash dcanumn/bibsnet:latest

OR

singularity shell --nv --cleanenv --no-home /home/path/to/bibsnet.sif

These are the permissions for /home/bibsnet/data:

ls -l /home/bibsnet/data

drwxrws--- 2 77661 12710 4096 Aug 26  2022 MNI_templates
-rwxrwx--- 1 77661 12710 1370 Aug 26  2022 age_to_avg_head_radius_BCP.csv
-rwxrwx--- 1 77661 12710  295 Aug 26  2022 dataset_description.json
-rwxrwx--- 1 77661 12710   32 Aug 26  2022 identity_matrix.mat
drwxrws--- 2 77661 12710 4096 Aug 26  2022 look_up_tables
-rwxrwx--- 1 77661 12710  713 Aug 14 16:28 models.csv
-rwxrwx--- 1 77661 12710  295 Mar 28 21:29 sidecar_template.json

And:

ls -l /opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet/3d_fullres/

In the docker image I get:

drwxrwsr-- 3 77661 12710 4096 Aug 15 15:19 Task540
drwxrwsr-- 3 77661 12710 4096 Aug 15 15:18 Task541
drwxrwsr-- 3 77661 12710 4096 Aug 15 15:18 Task542

But in the singularity image I get:

d????????? ? ? ? ?            ? Task540

This was a really nasty one to debug.... I think it might be worth including a test that asserts that all files needed by BIBSnet give read+execute permissions to all users, to avoid a code regression in the future.

LuciMoore commented 2 months ago

@scott-huberty thank you so much for working on this! makes sense that it was a permissions issue. I just want to confirm with @tjhendrickson before merging (he's currently OOO but will be back next week)

scott-huberty commented 2 months ago

No problem! And on that note maybe we want to consider #86 before merging too? In which case we'd want to add a few lines of code to make sure we don't grant execute permissions to non-executable files.

LuciMoore commented 2 months ago

Good point, thanks for the reminder. I'll work on getting this resolved next week!

scott-huberty commented 2 months ago

No worries! We can incorporate #86 into this PR if it's easier. Happy to pick things up next week after @tjhendrickson is back in office.

LuciMoore commented 1 month ago

@scott-huberty we've decided to hold off on #86 for now, but will merge your changes and tag a new release. thanks again for your work on this!

scott-huberty commented 1 month ago

No problem and thanks @LuciMoore ! 🙏