-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH] New FreeSurfer's license mechanism #787
Conversation
Enables the online provision of a local license file
For |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple comments, nothing major.
wrapper/fmriprep_docker.py
Outdated
@@ -245,11 +246,21 @@ def main(): | |||
g_dev.add_argument('-p', '--patch-nipype', metavar='PATH', | |||
type=os.path.abspath, | |||
help='working nipype repository') | |||
g_dev.add_argument('--fs-license', metavar='PATH', type=os.path.abspath, | |||
default=os.getenv('FS_LICENSE', None), | |||
help='folder containing FreeSurfer\'s license.txt file') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it's a little bit neither here nor there, I think this is more of a "wrapper" option than a "dev" option.
.circle/tests.sh
Outdated
@@ -39,14 +39,14 @@ case ${CIRCLE_NODE_INDEX} in | |||
| tee $HOME/docs/builddocs.log | |||
cat $HOME/docs/builddocs.log && if grep -q "ERROR" $HOME/docs/builddocs.log; then false; else true; fi | |||
fmriprep-docker -i poldracklab/fmriprep:latest --help | |||
fmriprep-docker -i poldracklab/fmriprep:latest --config $HOME/nipype.cfg -w $HOME/ds054/scratch $HOME/data/ds054 $HOME/ds054/out participant --no-freesurfer --debug --write-graph --force-syn | |||
fmriprep-docker --fs-license /tmp/fslicense -i poldracklab/fmriprep:latest --config $HOME/nipype.cfg -w $HOME/ds054/scratch $HOME/data/ds054 $HOME/ds054/out participant --no-freesurfer --debug --write-graph --force-syn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a --no-freesurfer
run, so it's not really testing anything except that fmriprep-docker
doesn't fail when it receives the flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I'm aware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we call it --fs-license-file
?
.circle/tests.sh
Outdated
# Place mock crash log and rebuild report | ||
UUID="$(date '+%Y%m%d-%H%M%S_')$(uuidgen)" | ||
mkdir -p $HOME/ds054/out/fmriprep/sub-100185/log/$UUID/ | ||
cp fmriprep/data/tests/crash_files/*.txt $HOME/ds054/out/fmriprep/sub-100185/log/$UUID/ | ||
# Expect one error | ||
set +e | ||
fmriprep-docker -i poldracklab/fmriprep:latest --config $HOME/nipype.cfg -w $HOME/ds054/scratch $HOME/data/ds054 $HOME/ds054/out participant --no-freesurfer --debug --write-graph --force-syn --reports-only --run-uuid $UUID | ||
fmriprep-docker --fs-license /tmp/fslicense -i poldracklab/fmriprep:latest --config $HOME/nipype.cfg -w $HOME/ds054/scratch $HOME/data/ds054 $HOME/ds054/out participant --no-freesurfer --debug --write-graph --force-syn --reports-only --run-uuid $UUID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also --no-freesurfer
.
Sorry, thought I was done commenting, but it would be helpful to check for the license file at the beginning, ourselves, rather than just letting In default_license = op.join(os.getenv('FREESURFER_HOME', ''), 'license.txt')
license_file = os.getenv('FS_LICENSE', default_license)
if opts.freesurfer and not os.path.exists(license_file):
raise RuntimeError(...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it confusing that --fs-license-file
is a command line argument for fmriprep-docker but not for native fmriprep. I think it would be better to have it in both places.
docs/installation.rst
Outdated
poldracklab/fmriprep:latest \ | ||
/data /out/out \ | ||
participant \ | ||
--ignore fieldmaps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be call include --fs-license-file
?
docs/installation.rst
Outdated
|
||
It is also possible to run ``fmriprep-docker`` with FreeSurfer processing: :: | ||
|
||
$ fmriprep-docker --fs-license $HOME/.licenses/freesurfer /path/to/data/dir /path/to/output/dir participant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--fs-license-file
?
wrapper/fmriprep_docker.py
Outdated
@@ -231,6 +232,9 @@ def main(): | |||
type=os.path.abspath, | |||
help='Grid reference image for resampling BOLD files to volume template ' | |||
'space.') | |||
g_wrap.add_argument('--fs-license-file', metavar='PATH', type=os.path.abspath, | |||
default=os.getenv('FS_LICENSE', None), | |||
help='folder containing FreeSurfer\'s license.txt file') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help="Path to FreeSurfer license key file. To obtain it you need to register (for free) at https://surfer.nmr.mgh.harvard.edu/registration.html"
circle.yml
Outdated
@@ -20,6 +21,7 @@ dependencies: | |||
- mkdir -p $HOME/ds005/out && sudo setfacl -R -d -m group:ubuntu:rwx $HOME/ds005 && sudo setfacl -R -m group:ubuntu:rwx $HOME/ds005 | |||
- mkdir -p $HOME/ds054 && sudo setfacl -d -m group:ubuntu:rwx $HOME/ds054 && sudo setfacl -m group:ubuntu:rwx $HOME/ds054 | |||
- mkdir -p $HOME/docs && sudo setfacl -d -m group:ubuntu:rwx $HOME/docs && sudo setfacl -m group:ubuntu:rwx $HOME/docs | |||
- mkdir -p /tmp/fslicense && printf "${FS_LICENSE_CONTENT}" > ${FS_LICENSE} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed - this would be a more robust way to populate the license for CI https://github.com/BIDS-Apps/freesurfer/pull/36/files#diff-29944324a3cbf9f4bd0162dfe3975d88R25
…til it works, fix help of --fs-license-file
Addressing all the latest comments from Chris.
Since |
I agree with @oesteban. It's a necessary feature for |
Tests are passing, this is RTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple [docs only]
changes. And want to add a changelog entry?
I'd recommend holding off on merging this until ready to make a new release, though. This is going to cause every build to re-download FreeSurfer until another release is made with this PR included.
docs/installation.rst
Outdated
$ fmriprep-docker --fs-license-file $HOME/.licenses/freesurfer/license.txt \ | ||
/path/to/data/dir /path/to/output/dir participant | ||
RUNNING: docker run --rm -it -v /path/to/data/dir:/data:ro \ | ||
-v /path/to_output/dir:/out poldracklab/fmriprep:1.0.0 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command doesn't have a -v /home/user/.licenses/freesurfer/license.txt:/etc/licenses/freesurfer/license.txt
line (or similar.
docs/installation.rst
Outdated
$ export FS_LICENSE=$HOME/.licenses/freesurfer/license.txt | ||
$ fmriprep-docker /path/to/data/dir /path/to/output/dir participant | ||
RUNNING: docker run --rm -it -v /path/to/data/dir:/data:ro \ | ||
-v /path/to_output/dir:/out poldracklab/fmriprep:1.0.0 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again.
docs/usage.rst
Outdated
@@ -29,7 +29,7 @@ Command-Line Arguments | |||
:prog: fmriprep | |||
:nodefault: | |||
:nodefaultconst: | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably unintentional space?
This looks good to me, though, again, I think merging should wait until just before the next release. @chrisfilo do you still feel that the |
Yes - we need it for OpenNeuro integration that does not support passing files via environment variables. |
Why not mounting the file directly?
…On Nov 6, 2017 16:54, "Chris Filo Gorgolewski" ***@***.***> wrote:
Yes - we need it for OpenNeuro integration that does not support passing
files via environment variables.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#787 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAkhxnsjsjGnjDZa7Gw8mzzeTosWoLfJks5sz6pHgaJpZM4QE750>
.
|
This feature would have to be added to OpenNeuro specifically for this app. Passing files via command line argument is already supported (as in FreeSurfer BIDS App). |
After talking with Chris, I think he's right we can't get around this. OpenNeuro mounts the file arbitrarily, and then passes that location with a command-line flag. Given we can't tell them where to mount it, It doesn't necessarily require any changes to the |
a030180
to
9f9d9ad
Compare
@chrisfilo Good to go? |
Hi guys,
When I try to run docker (with 1.0.0rc10) I get an error message:
I also tried to mount a local directory inside the container and provide the path to it as --fs-license-file, but it still does not work properly. Any ideas? |
Hi Marcel, The simplest approach is to use fmriprep-docker -w /home/marcel/experiments/SDT3/work --use-aroma --omp-nthreads 12 \
--mem_mb 24000 /home/marcel/experiments/SDT3/SDT3_BIDS \
/home/marcel/experiments/SDT3/derivatives/fmriprep participant However, given your current setup, the easiest quick fix is to mount the license file directly into the FreeSurfer directory: docker run -ti --rm -v /home/marcel/experiments/SDT3/work:/work \
-v /home/marcel/experiments/SDT3/SDT3_BIDS:/data:ro \
-v /home/marcel/experiments/SDT3/derivatives/fmriprep:/out \
-v /usr/local/freesurfer/license.txt:/opt/freesurfer/license.txt:ro \
poldracklab/fmriprep:latest -w /work --use-aroma --omp-nthreads 12 --mem_mb 24000 \
/data /out participant |
Thank you very much @effigies, this works fine now! |
Enables the online provision of a local license file