Skip to content

[Docker] Install minimized version of FS6 #2024

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

Merged
merged 4 commits into from
May 17, 2017

Conversation

oesteban
Copy link
Contributor

oesteban added 2 commits May 15, 2017 10:38
Try to build nipype/base in circle build, and cache it properly.
- Replaces the full installation of FS by a minimized version by @satra
- Depends on nipy#2022
@@ -44,7 +44,7 @@ RUN apt-get update && \

WORKDIR /opt
# Installing freesurfer -- do it first so that it is cached early
RUN curl -sSL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.0/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0.tar.gz | tar zxv -C /opt \
RUN curl -sSL https://www.dropbox.com/s/0ldeovrmh26vabq/recon-all-freesurfer6.min.tgz?dl=0 | tar zxv -C /opt \
--exclude='freesurfer/trctrain' \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine you can safely remove all of the --excludes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@effigies
Copy link
Member

effigies commented May 15, 2017

This install only includes files used to run recon-all? We have at least one case where we run a command not included in that set: mris_expand

@satra
Copy link
Member

satra commented May 15, 2017

@effigies - do we actually have a test in circleci for nipype where this command is actually used?

@satra
Copy link
Member

satra commented May 15, 2017

the intent of this at present is not to provide all things that are needed to run these individual packages or all of nipype, but primarily that all of the tests can be run.

@effigies
Copy link
Member

effigies commented May 15, 2017

I linked to the test. It runs the interface if FreeSurfer is installed.

Edit: I guess I don't know if Circle skips over the test, anyway.

@satra
Copy link
Member

satra commented May 15, 2017

@effigies - ah thanks. i can update the tar ball to include that file.

@codecov-io
Copy link

codecov-io commented May 15, 2017

Codecov Report

Merging #2024 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2024   +/-   ##
=======================================
  Coverage   72.19%   72.19%           
=======================================
  Files        1132     1132           
  Lines       57012    57012           
  Branches     8162     8162           
=======================================
  Hits        41161    41161           
  Misses      14567    14567           
  Partials     1284     1284
Flag Coverage Δ
#smoketests 72.19% <ø> (ø) ⬆️
#unittests 69.79% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4358fe5...d32be0b. Read the comment docs.

@satra
Copy link
Member

satra commented May 15, 2017

@effigies, @oesteban - here is the updated tarball: https://dl.dropbox.com/s/y3hvbdgfu4pfad8/recon-all-freesurfer6.min.tgz?dl=0

@satra
Copy link
Member

satra commented May 16, 2017

@oesteban - can you retrigger the build? for some reason i can't. it looks like the failure came from the freesurfer test.

also i'm curious how docker handles things like a curl when the content of a URL changes but the URL is still the same. does it actually rerun it?

so to avoid confusion here is the new download link:

https://dl.dropbox.com/s/y3hvbdgfu4pfad8/recon-all-freesurfer6-1.min.tgz?dl=0

@satra
Copy link
Member

satra commented May 16, 2017

@oesteban - i was able to update things in your branch and as a result the build re-triggered. added ants directly here to save time.

@oesteban
Copy link
Contributor Author

Something is odd with freesurfer installation:

=================================== FAILURES ===================================

_____________________________ test_associated_file _____________________________



    @pytest.mark.skipif(fs.no_freesurfer(), reason="freesurfer is not installed")

    def test_associated_file():

        fssrc = FreeSurferSource(subjects_dir=fs.Info.subjectsdir(),

                                 subject_id='fsaverage', hemi='lh')

    

        fsavginfo = fssrc.run().outputs.get()

    

        # Pairs of white/pial files in the same directories

        for white, pial in [('lh.white', 'lh.pial'),

                            ('./lh.white', './lh.pial'),

                            (fsavginfo['white'], fsavginfo['pial'])]:

    

            # Unspecified paths, possibly with missing hemisphere information,

            # are equivalent to using the same directory and hemisphere

            for name in ('pial', 'lh.pial', pial):

                assert FSSurfaceCommand._associated_file(white, name) == pial

    

            # With path information, no changes are made

            for name in ('./pial', './lh.pial', fsavginfo['pial']):

>               assert FSSurfaceCommand._associated_file(white, name) == name



../../interfaces/freesurfer/tests/test_FSSurfaceCommand.py:50: 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

../../interfaces/freesurfer/base.py:225: in _associated_file

    path, base = os.path.split(out_name)

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 



p = <undefined>



    def split(p):

        """Split a pathname.  Returns tuple "(head, tail)" where "tail" is

        everything after the final slash.  Either part may be empty."""

>       p = os.fspath(p)

E       TypeError: expected str, bytes or os.PathLike object, not _Undefined



/usr/local/miniconda/lib/python3.6/posixpath.py:105: TypeError

_______________________________ test_mrisexpand ________________________________



tmpdir = local('/tmp/pytest-of-root/pytest-0/test_mrisexpand0')



    @pytest.mark.skipif(fs.no_freesurfer(), reason="freesurfer is not installed")

    def test_mrisexpand(tmpdir):

        fssrc = FreeSurferSource(subjects_dir=fs.Info.subjectsdir(),

                                 subject_id='fsaverage', hemi='lh')

    

        fsavginfo = fssrc.run().outputs.get()

    

        # dt=60 to ensure very short runtime

        expand_if = fs.MRIsExpand(in_file=fsavginfo['smoothwm'],

                                  out_name='expandtmp',

                                  distance=1,

                                  dt=60)

    

        expand_nd = pe.Node(

            fs.MRIsExpand(in_file=fsavginfo['smoothwm'],

                          out_name='expandtmp',

                          distance=1,

                          dt=60),

            name='expand_node')

    

        # Interfaces should have same command line at instantiation

        orig_cmdline = 'mris_expand -T 60 {} 1 expandtmp'.format(fsavginfo['smoothwm'])

>       assert expand_if.cmdline == orig_cmdline



/src/nipype/nipype/interfaces/freesurfer/tests/test_utils.py:188: 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

/src/nipype/nipype/interfaces/base.py:1673: in cmdline

    self._check_mandatory_inputs()

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 



self = <nipype.interfaces.freesurfer.utils.MRIsExpand object at 0x7f9be9611dd8>



    def _check_mandatory_inputs(self):

        """ Raises an exception if a mandatory input is Undefined

            """

        for name, spec in list(self.inputs.traits(mandatory=True).items()):

            value = getattr(self.inputs, name)

            self._check_xor(spec, name, value)

            if not isdefined(value) and spec.xor is None:

                msg = ("%s requires a value for input '%s'. "

                       "For a list of required inputs, see %s.help()" %

                       (self.__class__.__name__, name, self.__class__.__name__))

>               raise ValueError(msg)

E               ValueError: MRIsExpand requires a value for input 'in_file'. For a list of required inputs, see MRIsExpand.help()



/src/nipype/nipype/interfaces/base.py:969: ValueError

======== 2 failed, 2616 passed, 42 skipped, 7 xfailed in 652.87 seconds ========

@satra
Copy link
Member

satra commented May 16, 2017

@oesteban - mris_expand is expecting a few additional files from fsaverage that are not required for recon-all. i will add them and update the tar file.

@satra
Copy link
Member

satra commented May 16, 2017

@oesteban - just pushed an update - hopefully this will work

@satra satra merged commit f92a333 into nipy:master May 17, 2017
@oesteban oesteban deleted the docker/install-fs-min branch May 17, 2017 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants