Skip to content

Commit

Permalink
Merge pull request #12 from PennLINC/enh/fmriprep-parity
Browse files Browse the repository at this point in the history
[ENH] match fmriprep's build
  • Loading branch information
mattcieslak authored May 3, 2024
2 parents 6ffbb04 + 165a3f2 commit 8a27beb
Show file tree
Hide file tree
Showing 3 changed files with 187 additions and 26 deletions.
52 changes: 27 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,7 @@

# Ubuntu 22.04 LTS - Jammy
ARG BASE_IMAGE=ubuntu:jammy-20240125

FROM pennlinc/atlaspack:0.1.0 as atlaspack

#
# Build wheel
#
FROM python:slim AS src
RUN pip install build
RUN apt-get update && \
apt-get install -y --no-install-recommends git

#
# Download stages
#
Expand Down Expand Up @@ -71,7 +61,13 @@ RUN mkdir -p /opt/afni-latest \
--exclude "linux_openmp_64/afnipy" \
--exclude "linux_openmp_64/lib/RetroTS" \
--exclude "linux_openmp_64/lib_RetroTS" \
--exclude "linux_openmp_64/meica.libs"
--exclude "linux_openmp_64/meica.libs" \
# Keep only what we use
&& find /opt/afni-latest -type f -not \( \
-name "3dTshift" -or \
-name "3dUnifize" -or \
-name "3dAutomask" -or \
-name "3dvolreg" \) -delete

# Connectome Workbench 1.5.0
FROM downloader as workbench
Expand Down Expand Up @@ -104,6 +100,7 @@ RUN curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bi

ENV MAMBA_ROOT_PREFIX="/opt/conda"
COPY env.yml /tmp/env.yml
COPY requirements.txt /tmp/requirements.txt
WORKDIR /tmp
RUN micromamba create -y -f /tmp/env.yml && \
micromamba clean -y -a
Expand Down Expand Up @@ -172,20 +169,6 @@ RUN apt-get update -qq \
fi \
&& ldconfig

# Install FSL from old ASLPrep version
# Based on https://github.com/ReproNim/neurodocker/blob/a87693e5676e7c4d272bc4eb8285f9232860d0ff/neurodocker/templates/fsl.yaml
RUN curl -fsSL https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py | python3 - -d /opt/fsl-6.0.7.1 -V 6.0.7.1
ENV FSLDIR="/opt/fsl-6.0.7.1" \
PATH="$PATH:/opt/fsl-6.0.7.1/bin" \
FSLOUTPUTTYPE="NIFTI_GZ" \
FSLMULTIFILEQUIT="TRUE" \
FSLTCLSH="/opt/fsl-6.0.7.1/bin/fsltclsh" \
FSLWISH="/opt/fsl-6.0.7.1/bin/fslwish" \
FSLLOCKDIR="" \
FSLMACHINELIST="" \
FSLREMOTECALL="" \
FSLGECUDAQ="cuda.q"

# Install files from stages
COPY --from=freesurfer /opt/freesurfer /opt/freesurfer
COPY --from=afni /opt/afni-latest /opt/afni-latest
Expand Down Expand Up @@ -241,6 +224,25 @@ ENV PATH="/opt/conda/envs/aslprep/bin:$PATH" \
CPATH="/opt/conda/envs/aslprep/include:$CPATH" \
LD_LIBRARY_PATH="/opt/conda/envs/aslprep/lib:$LD_LIBRARY_PATH"

# Precaching atlases
COPY scripts/fetch_templates.py fetch_templates.py
RUN python fetch_templates.py && \
rm fetch_templates.py && \
find $HOME/.cache/templateflow -type d -exec chmod go=u {} + && \
find $HOME/.cache/templateflow -type f -exec chmod go=u {} +

# FSL environment
ENV LANG="C.UTF-8" \
LC_ALL="C.UTF-8" \
PYTHONNOUSERSITE=1 \
FSLDIR="/opt/conda/envs/aslprep" \
FSLOUTPUTTYPE="NIFTI_GZ" \
FSLMULTIFILEQUIT="TRUE" \
FSLLOCKDIR="" \
FSLMACHINELIST="" \
FSLREMOTECALL="" \
FSLGECUDAQ="cuda.q"

# Unless otherwise specified each process should only use one thread - nipype
# will handle parallelization
ENV MKL_NUM_THREADS=1 \
Expand Down
15 changes: 14 additions & 1 deletion env.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: aslprep
channels:
- https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/
- conda-forge
# Update this ~yearly; last updated Jan 2024
dependencies:
- python=3.10
- python=3.11
# Needed for svgo and bids-validator; consider moving to deno
- nodejs=20
# Intel Math Kernel Library for numpy
Expand All @@ -26,6 +27,18 @@ dependencies:
- pandoc=3.1
# Workflow dependencies: ANTs
- ants=2.5
# Workflow dependencies: FSL (versions pinned in 6.0.7.7)
- fsl-basil=v4.0.4
- fsl-bet2=2111.4
- fsl-flirt=2111.2
- fsl-fast4=2111.3
- fsl-fugue=2201.4
- fsl-mcflirt=2111.0
- fsl-miscmaths=2203.2
- fsl-oxford_asl=v4.0.29
- fsl-topup=2203.2
- pip
- pip:
- -r requirements.txt
variables:
FSLOUTPUTTYPE: NIFTI_GZ
146 changes: 146 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
alabaster==0.7.16
annexremote==1.6.4
APScheduler==3.10.4
astor==0.8.1
Babel==2.14.0
bids-validator==1.14.0
bokeh==3.3.4
boto==2.49.0
build==1.2.1
chardet==5.2.0
ci-info==0.3.0
codecarbon==2.3.4
codecov==2.1.13
commonmark==0.9.1
contourpy==1.2.0
coverage==7.5.0
cryptography==42.0.4
datalad==0.19.6
datalad-next==1.2.0
datalad-osf==0.3.0
distro==1.9.0
docopt==0.6.2
doctest-ignore-unicode==0.1.2
docutils==0.20.1
etelemetry==0.3.1
fasteners==0.19
filelock==3.13.1
fmriprep==23.2.1
fonttools==4.48.1
formulaic==0.5.2
fuzzywuzzy==0.18.0
greenlet==3.0.3
humanize==4.9.0
idna==3.6
imageio==2.33.1
imagesize==1.4.1
importlib-metadata==7.0.1
importlib-resources==6.1.1
iniconfig==2.0.0
interface-meta==1.3.0
ipython-genutils==0.2.0
iso8601==2.1.0
jaraco.classes==3.3.0
jeepney==0.8.0
joblib==1.3.2
keyring==24.3.0
keyrings.alt==5.0.0
latexcodec==3.0.0
lazy_loader==0.3
Levenshtein==0.25.1
lockfile==0.12.2
looseversion==1.3.0
lxml==5.1.0
lxml_html_clean==0.1.1
m2r==0.3.1
mapca==0.0.4
Markdown==3.6
matplotlib==3.8.2
migas==0.4.0
mistune==0.8.4
mkl-service==2.4.0
more-itertools==10.2.0
msgpack==1.0.7
munkres==1.1.4
nbconvert==6.5.4
nbsphinx==0.9.3
networkx==3.3
nibabel==5.2.0
nilearn==0.10.3
nipype==1.8.6
nireports==23.2.0
nitransforms==23.0.1
niworkflows==1.10.0
nose==1.3.7
num2words==0.5.13
osfclient==0.0.5
packaging==23.2
pandas==2.2.0
patool==2.1.1
pbr==6.0.0
pillow==10.2.0
pip-tools==7.4.1
platformdirs==4.2.0
pluggy==1.5.0
prometheus-client==0.19.0
prov==2.0.0
py-cpuinfo==9.0.0
pybids==0.16.4
pybtex==0.24.0
pybtex-docutils==1.0.3
pycparser==2.21
pydot==2.0.0
pydotplus==2.0.2
pynvml==11.5.0
pyparsing==3.1.1
pyproject_hooks==1.1.0
Pypubsub==4.0.3
PyQt5==5.15.9
PyQt5-sip==12.12.2
pytest==8.2.0
pytest-cov==5.0.0
python-dateutil==2.8.2
python-gitlab==4.4.0
python-Levenshtein==0.25.1
rapidfuzz==3.9.0
rdflib==7.0.0
recommonmark==0.7.1
requests-toolbelt==1.0.0
scikit-learn==1.4.0
sdcflows==2.8.0
seaborn==0.13.2
SecretStorage==3.3.3
sentry-sdk==1.40.1
simplejson==3.19.2
smriprep==0.13.2
snowballstemmer==2.2.0
Sphinx==7.3.7
sphinx-argparse==0.4.0
sphinx-markdown-tables==0.0.17
sphinx-rtd-theme==2.0.0
sphinxcontrib-apidoc==0.5.0
sphinxcontrib-applehelp==1.0.8
sphinxcontrib-bibtex==2.6.2
sphinxcontrib-devhelp==1.0.6
sphinxcontrib-htmlhelp==2.0.5
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.7
sphinxcontrib-serializinghtml==1.1.10
SQLAlchemy==2.0.25
svgutils==0.3.4
tedana==23.0.2
templateflow==24.2.0
threadpoolctl==3.2.0
tifffile==2024.1.30
tqdm==4.66.1
traits==6.3.2
transforms3d==0.4.1
types-python-dateutil==2.8.19.20240106
typing_extensions==4.9.0
tzdata==2023.4
tzlocal==5.2
urllib3==2.2.0
wrapt==1.16.0
wxPython==4.2.1
xyzservices==2023.10.1

0 comments on commit 8a27beb

Please sign in to comment.