Skip to content
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

MNT: Update Ubuntu, FreeSurfer, AFNI and Convert3D #2931

Merged
merged 7 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ jobs:
- run: *check_skip_job
- restore_cache:
keys:
- build-v5-{{ .Branch }}-{{ .Revision }}
- build-v5--{{ .Revision }}
- build-v5-{{ .Branch }}-
- build-v5-master-
- build-v5-
- build-v0-{{ .Branch }}-{{ .Revision }}
- build-v0--{{ .Revision }}
- build-v0-{{ .Branch }}-
- build-v0-master-
- build-v0-
paths:
- /tmp/docker
- /tmp/images
Expand All @@ -147,19 +147,19 @@ jobs:
docker save registry:2 | gzip > /tmp/images/registry.tar.gz
fi
- run:
name: Pull Ubuntu/focal image
name: Pull Ubuntu/jammy image
command: |
set +e
docker pull localhost:5000/ubuntu
success=$?
set -e
if [[ "$success" = "0" ]]; then
echo "Pulling from local registry"
docker tag localhost:5000/ubuntu ubuntu:focal
docker tag localhost:5000/ubuntu ubuntu:jammy
else
echo "Pulling from Docker Hub"
docker pull ubuntu:focal
docker tag ubuntu:focal localhost:5000/ubuntu
docker pull ubuntu:jammy
docker tag ubuntu:jammy localhost:5000/ubuntu
docker push localhost:5000/ubuntu
fi
- run:
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
paths:
- src/fmriprep
- save_cache:
key: build-v5-{{ .Branch }}-{{ .Revision }}
key: build-v0-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down Expand Up @@ -368,7 +368,7 @@ jobs:
at: /tmp
- restore_cache:
keys:
- build-v5-{{ .Branch }}-{{ .Revision }}
- build-v0-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down Expand Up @@ -441,7 +441,7 @@ jobs:
at: /tmp
- restore_cache:
keys:
- build-v5-{{ .Branch }}-{{ .Revision }}
- build-v0-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down Expand Up @@ -651,7 +651,7 @@ jobs:
at: /tmp
- restore_cache:
keys:
- build-v5-{{ .Branch }}-{{ .Revision }}
- build-v0-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down Expand Up @@ -777,7 +777,7 @@ jobs:
at: /tmp
- restore_cache:
keys:
- build-v5-{{ .Branch }}-{{ .Revision }}
- build-v0-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down Expand Up @@ -893,7 +893,7 @@ jobs:
fi
- restore_cache:
keys:
- build-v5-{{ .Branch }}-{{ .Revision }}
- build-v0-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand All @@ -916,7 +916,7 @@ jobs:
- run: *check_skip_job
- restore_cache:
keys:
- build-v5-{{ .Branch }}-{{ .Revision }}
- build-v0-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down
43 changes: 19 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ RUN apt-get update && \
COPY . /src/fmriprep
RUN python -m build /src/fmriprep

# Use Ubuntu 20.04 LTS
FROM ubuntu:focal-20210416
# Use Ubuntu 22.04 LTS
FROM ubuntu:jammy-20221130

# Prepare environment
RUN apt-get update && \
Expand All @@ -42,6 +42,7 @@ RUN apt-get update && \
ca-certificates \
curl \
git \
gnupg \
libtool \
lsb-release \
netbase \
Expand All @@ -55,9 +56,9 @@ ENV DEBIAN_FRONTEND="noninteractive" \
LC_ALL="en_US.UTF-8"

# Installing freesurfer
COPY docker/files/freesurfer7.2-exclude.txt /usr/local/etc/freesurfer7.2-exclude.txt
RUN curl -sSL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.2.0/freesurfer-linux-ubuntu18_amd64-7.2.0.tar.gz \
| tar zxv --no-same-owner -C /opt --exclude-from=/usr/local/etc/freesurfer7.2-exclude.txt
COPY docker/files/freesurfer7.3.2-exclude.txt /usr/local/etc/freesurfer7.3.2-exclude.txt
RUN curl -sSL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.2/freesurfer-linux-ubuntu22_amd64-7.3.2.tar.gz \
| tar zxv --no-same-owner -C /opt --exclude-from=/usr/local/etc/freesurfer7.3.2-exclude.txt

# Simulate SetUpFreeSurfer.sh
ENV FSL_DIR="/opt/fsl-6.0.5.1" \
Expand Down Expand Up @@ -158,28 +159,20 @@ ENV FSLDIR="/opt/fsl-6.0.5.1" \
FSLGECUDAQ="cuda.q" \
LD_LIBRARY_PATH="/opt/fsl-6.0.5.1/lib:$LD_LIBRARY_PATH"

# Convert3D (neurodocker build)
RUN echo "Downloading Convert3D ..." \
&& mkdir -p /opt/convert3d-1.0.0 \
&& curl -fsSL --retry 5 https://sourceforge.net/projects/c3d/files/c3d/1.0.0/c3d-1.0.0-Linux-x86_64.tar.gz/download \
| tar -xz -C /opt/convert3d-1.0.0 --strip-components 1 \
--exclude "c3d-1.0.0-Linux-x86_64/lib" \
--exclude "c3d-1.0.0-Linux-x86_64/share" \
--exclude "c3d-1.0.0-Linux-x86_64/bin/c3d_gui"
ENV C3DPATH="/opt/convert3d-1.0.0" \
PATH="/opt/convert3d-1.0.0/bin:$PATH"

# Configure PPA for libpng12
RUN GNUPGHOME=/tmp gpg --keyserver hkps://keyserver.ubuntu.com --no-default-keyring --keyring /usr/share/keyrings/linuxuprising.gpg --recv 0xEA8CACC073C3DB2A \
&& echo "deb [signed-by=/usr/share/keyrings/linuxuprising.gpg] https://ppa.launchpadcontent.net/linuxuprising/libpng12/ubuntu jammy main" > /etc/apt/sources.list.d/linuxuprising.list
# AFNI latest (neurodocker build)
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
apt-utils \
ed \
gsl-bin \
libglib2.0-0 \
libglu1-mesa-dev \
libglw1-mesa \
libgomp1 \
libjpeg62 \
libpng12-0 \
libxm4 \
netpbm \
tcsh \
Expand All @@ -193,9 +186,6 @@ RUN apt-get update -qq \
&& curl -sSL --retry 5 -o /tmp/libxp6.deb http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb \
&& dpkg -i /tmp/libxp6.deb \
&& rm /tmp/libxp6.deb \
&& curl -sSL --retry 5 -o /tmp/libpng.deb http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb \
&& dpkg -i /tmp/libpng.deb \
&& rm /tmp/libpng.deb \
&& apt-get install -f \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
Expand Down Expand Up @@ -267,6 +257,15 @@ ENV PATH="/opt/conda/bin:$PATH" \
LC_ALL="C.UTF-8" \
PYTHONNOUSERSITE=1

RUN conda install -y -n base \
-c anaconda \
-c conda-forge \
convert3d=1.3.0 \
&& sync \
&& conda clean -afy; sync \
&& rm -rf ~/.conda ~/.cache/pip/*; sync \
&& ldconfig

# Unless otherwise specified each process should only use one thread - nipype
# will handle parallelization
ENV MKL_NUM_THREADS=1 \
Expand Down Expand Up @@ -297,10 +296,6 @@ RUN find $HOME -type d -exec chmod go=u {} + && \
find $HOME -type f -exec chmod go=u {} + && \
rm -rf $HOME/.npm $HOME/.conda $HOME/.empty

# HACK for FreeSurfer 7.2.0
# Fixed in https://github.com/freesurfer/freesurfer/pull/886, so remove on release
ENV FREESURFER="/opt/freesurfer"

ENV IS_DOCKER_8395080871=1

RUN ldconfig
Expand Down
Loading