Skip to content

Commit bc851da

Browse files
authored
Merge pull request #1916 from FCP-INDI/upgrade/python
⬆️ Upgrade dependencies for 1.8.6
2 parents 2fe01c7 + ade61a3 commit bc851da

File tree

109 files changed

+34408
-1068
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+34408
-1068
lines changed

.circleci/main.yml

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
version: 2.1
3+
# Singularity started failing to set up on Circle circa May 2023, so those tests are currently disabled
34

45
parameters:
56
branch:
@@ -73,7 +74,7 @@ commands:
7374
version:
7475
description: "Version of Singularity to clone"
7576
type: string
76-
default: v3.7.2
77+
default: v3.8.7
7778
steps:
7879
- install-singularity-requirements
7980
- restore_cache:
@@ -84,7 +85,7 @@ commands:
8485
command: |
8586
if [[ ! -d singularity-<< parameters.version >> ]]
8687
then
87-
git clone -b << parameters.version >> https://github.com/sylabs/singularity singularity-<< parameters.version >>
88+
git clone -b << parameters.version >> https://github.com/apptainer/singularity singularity-<< parameters.version >>
8889
fi
8990
- save_cache:
9091
key: singularity-<< parameters.version >>
@@ -94,16 +95,29 @@ commands:
9495
name: "Setting up Singularity"
9596
command: |
9697
cd singularity-<< parameters.version >>
97-
./mconfig
98+
./mconfig -p /usr/local
9899
make -C builddir
99100
sudo make -C builddir install
100101
cd ..
101102
install-singularity-requirements:
102103
steps:
103104
- run:
104105
name: "Installing Singularity requirements"
106+
# https://github.com/apptainer/apptainer/blob/release-1.1/INSTALL.md
105107
command: |
106-
sudo apt-get update && sudo apt-get install flawfinder squashfs-tools uuid-dev libuuid1 libffi-dev libssl-dev libssl1.1 libarchive-dev libgpgme11-dev libseccomp-dev -y
108+
sudo apt-get update -y && \
109+
sudo apt-get install -y \
110+
build-essential \
111+
libseccomp-dev \
112+
pkg-config \
113+
uidmap \
114+
squashfs-tools \
115+
squashfuse \
116+
fuse2fs \
117+
fuse-overlayfs \
118+
fakeroot \
119+
cryptsetup \
120+
curl wget git
107121
run-pytest-docker:
108122
steps:
109123
- create-docker-test-container:
@@ -115,17 +129,18 @@ commands:
115129
steps:
116130
- restore_cache:
117131
keys:
118-
- pip-ci-requirements-{{ checksum "dev/circleci_data/requirements.txt" }}-3.8.5
132+
- pip-ci-requirements-{{ checksum "dev/circleci_data/requirements.txt" }}-3.10.10
119133
- run:
120134
name: "Installing CI dependencies"
121135
command: |
122-
pyenv global 3.8.5
136+
yes n | pyenv install 3.10.10 || true
137+
pyenv global 3.10.10
123138
pip install --upgrade pip
124139
pip install -r dev/circleci_data/requirements.txt
125140
- save_cache:
126-
key: pip-ci-requirements-{{ checksum "dev/circleci_data/requirements.txt" }}-3.8.5
141+
key: pip-ci-requirements-{{ checksum "dev/circleci_data/requirements.txt" }}-3.10.10
127142
paths:
128-
- /opt/circleci/.pyenv/versions/3.8.5
143+
- /opt/circleci/.pyenv/versions/3.10.10
129144
set-up-variant:
130145
parameters:
131146
variant:
@@ -162,21 +177,21 @@ commands:
162177
jobs:
163178
combine-coverage:
164179
machine:
165-
image: ubuntu-2004:202010-01
180+
image: ubuntu-2004:2023.04.2
166181
steps:
167182
- checkout
168183
- restore_cache:
169184
key: coverage-docker--{{ .Revision }}
170-
- restore_cache:
171-
key: coverage-singularity--{{ .Revision }}
185+
# - restore_cache:
186+
# key: coverage-singularity--{{ .Revision }}
172187
- restore_cache:
173188
key: coverage-docker-ABCD-HCP-{{ .Revision }}
174-
- restore_cache:
175-
key: coverage-singularity-ABCD-HCP-{{ .Revision }}
189+
# - restore_cache:
190+
# key: coverage-singularity-ABCD-HCP-{{ .Revision }}
176191
- restore_cache:
177192
key: coverage-docker-lite-{{ .Revision }}
178-
- restore_cache:
179-
key: coverage-singularity-lite-{{ .Revision }}
193+
# - restore_cache:
194+
# key: coverage-singularity-lite-{{ .Revision }}
180195
- set-python-version
181196
- combine-coverage
182197
- store_artifacts:
@@ -187,7 +202,7 @@ jobs:
187202
type: string
188203
default: ""
189204
machine:
190-
image: ubuntu-2004:202010-01
205+
image: ubuntu-2004:2023.04.2
191206
resource_class: medium
192207
steps:
193208
- checkout
@@ -209,7 +224,7 @@ jobs:
209224
type: string
210225
default: ""
211226
machine:
212-
image: ubuntu-2004:202010-01
227+
image: ubuntu-2004:2023.04.2
213228
resource_class: large
214229
steps:
215230
- checkout
@@ -231,7 +246,7 @@ jobs:
231246
type: string
232247
default: ""
233248
machine:
234-
image: ubuntu-2004:202010-01
249+
image: ubuntu-2004:2023.04.2
235250
resource_class: large
236251
steps:
237252
- checkout
@@ -262,11 +277,11 @@ workflows:
262277
name: "Combine coverage"
263278
requires:
264279
- "Test in Docker"
265-
- "Test in Singularity"
280+
# - "Test in Singularity"
266281
- "Test lite variant in Docker"
267-
- "Test lite variant in Singularity"
282+
# - "Test lite variant in Singularity"
268283
- "Test ABCD-HCP variant in Docker"
269-
- "Test ABCD-HCP variant in Singularity"
284+
# - "Test ABCD-HCP variant in Singularity"
270285
- "Test fMRIPrep-LTS variant in Docker"
271286
- push-branch-to-docker-hub:
272287
filters:
@@ -292,11 +307,11 @@ workflows:
292307
variant: fMRIPrep-LTS
293308
- pytest-docker:
294309
name: "Test lite variant in Docker"
295-
- pytest-singularity:
296-
name: "Test in Singularity"
297-
- pytest-singularity:
298-
name: "Test ABCD-HCP variant in Singularity"
299-
variant: ABCD-HCP
300-
- pytest-singularity:
301-
name: "Test lite variant in Singularity"
302-
variant: lite
310+
# - pytest-singularity:
311+
# name: "Test in Singularity"
312+
# - pytest-singularity:
313+
# name: "Test ABCD-HCP variant in Singularity"
314+
# variant: ABCD-HCP
315+
# - pytest-singularity:
316+
# name: "Test lite variant in Singularity"
317+
# variant: lite

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
!.github/scripts
21
bids-examples
32
.circleci
43
cpac_runs
54
.env*
65
.git
76
.github
7+
!.github/scripts
88
*.tar.gz
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
FROM ghcr.io/fcp-indi/c-pac/ubuntu:python3.10-bionic-non-free as AFNI
2+
USER root
3+
4+
# install AFNI
5+
COPY dev/docker_data/required_afni_pkgs.txt /opt/required_afni_pkgs.txt
6+
COPY dev/docker_data/checksum/AFNI.23.0.07.sha384 /tmp/AFNI.23.0.07.sha384
7+
RUN if [ -f /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 ]; then \
8+
ln -svf /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 /usr/lib/x86_64-linux-gnu/libGL.so.1; \
9+
fi \
10+
&& libs_path=/usr/lib/x86_64-linux-gnu \
11+
&& if [ -f $libs_path/libgsl.so.23 ]; then \
12+
ln -svf $libs_path/libgsl.so.23 $libs_path/libgsl.so.19 \
13+
&& ln -svf $libs_path/libgsl.so.23 $libs_path/libgsl.so.0; \
14+
elif [ -f $libs_path/libgsl.so.23.0.0 ]; then \
15+
ln -svf $libs_path/libgsl.so.23.0.0 $libs_path/libgsl.so.19 \
16+
&& ln -svf $libs_path/libgsl.so.23.0.0 $libs_path/libgsl.so.0; \
17+
elif [ -f $libs_path/libgsl.so ]; then \
18+
ln -svf $libs_path/libgsl.so $libs_path/libgsl.so.0; \
19+
fi \
20+
&& LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH \
21+
&& export LD_LIBRARY_PATH \
22+
&& apt-get update && apt-get install -y libglw1-mesa-dev \
23+
&& AFNI_VERSION="23.0.07" \
24+
&& curl -LOJ https://github.com/afni/afni/archive/AFNI_${AFNI_VERSION}.tar.gz \
25+
&& sha384sum --check /tmp/AFNI.23.0.07.sha384 \
26+
&& mkdir /opt/afni \
27+
&& tar -xvf afni-AFNI_${AFNI_VERSION}.tar.gz -C /opt/afni --strip-components 1 \
28+
&& rm -rf afni-AFNI_${AFNI_VERSION}.tar.gz \
29+
&& cd /opt/afni/src \
30+
&& sed '/^INSTALLDIR =/c INSTALLDIR = /opt/afni' Makefile.linux_ubuntu_16_64 > Makefile \
31+
&& make vastness && make cleanest \
32+
&& cd /opt/afni \
33+
# filter down to required packages
34+
ls > full_ls \
35+
&& sed 's/linux_openmp_64\///g' /opt/required_afni_pkgs.txt | sort > required_ls \
36+
&& comm -2 -3 full_ls required_ls | xargs rm -rf full_ls required_ls \
37+
&& apt-get remove -y libglw1-mesa-dev \
38+
&& ldconfig
39+
40+
# set up AFNI
41+
ENV PATH=/opt/afni:$PATH
42+
43+
ENTRYPOINT ["/bin/bash"]
44+
45+
# Link libraries for Singularity images
46+
RUN ldconfig
47+
48+
RUN apt-get clean \
49+
&& apt-get autoremove -y \
50+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
51+
52+
FROM scratch
53+
LABEL org.opencontainers.image.description "NOT INTENDED FOR USE OTHER THAN AS A STAGE IMAGE IN A MULTI-STAGE BUILD \
54+
AFNI 21.1.00 (Domitian) stage"
55+
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
56+
COPY --from=AFNI /lib/x86_64-linux-gnu/ld* /lib/x86_64-linux-gnu/
57+
COPY --from=AFNI /lib/x86_64-linux-gnu/lib*so* /lib/x86_64-linux-gnu/
58+
COPY --from=AFNI /lib64/ld* /lib64/
59+
COPY --from=AFNI /opt/afni/ /opt/afni/
60+
COPY --from=AFNI /usr/lib/x86_64-linux-gnu/lib*so* /usr/lib/x86_64-linux-gnu/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM ghcr.io/fcp-indi/c-pac/ubuntu:python3.10-bionic-non-free as ANTs
2+
3+
USER root
4+
COPY dev/docker_data/checksum/ANTs.2.4.3.sha384 /tmp/checksum.sha384
5+
RUN curl -sL https://github.com/ANTsX/ANTs/releases/download/v2.4.3/ants-2.4.3-ubuntu-18.04-X64-gcc.zip -o /tmp/ANTs.zip \
6+
&& curl -sL https://s3-eu-west-1.amazonaws.com/pfigshare-u-files/3133832/Oasis.zip -o /tmp/Oasis.zip \
7+
&& sha384sum --check /tmp/checksum.sha384 \
8+
&& unzip /tmp/ANTs.zip -d /tmp \
9+
&& mkdir /usr/lib/ants \
10+
&& mv /tmp/ants-2.4.3/* /usr/lib/ants \
11+
&& mkdir /ants_template \
12+
&& unzip /tmp/Oasis.zip -d /tmp \
13+
&& mv /tmp/MICCAI2012-Multi-Atlas-Challenge-Data /ants_template/oasis
14+
15+
# Only keep what we need
16+
FROM scratch
17+
LABEL org.opencontainers.image.description "NOT INTENDED FOR USE OTHER THAN AS A STAGE IMAGE IN A MULTI-STAGE BUILD \
18+
ANTs 2.4.3 stage"
19+
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
20+
COPY --from=ANTs /usr/lib/ants/ /usr/lib/ants/
21+
COPY --from=ANTs /ants_template/ /ants_template/

.github/Dockerfiles/C-PAC.develop-ABCD-HCP-bionic.Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ RUN rm -Rf /code/docker_data/Dockerfiles && \
1717
ENTRYPOINT ["/code/run-with-freesurfer.sh"]
1818

1919
# Link libraries for Singularity images
20-
RUN ldconfig
21-
22-
RUN apt-get clean && \
23-
apt-get autoremove -y && \
24-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
20+
RUN ldconfig \
21+
&& apt-get clean \
22+
&& apt-get autoremove -y \
23+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
24+
&& chmod 777 / \
25+
&& chmod 777 $(ls / | grep -v sys | grep -v proc)
2526

2627
# set user
2728
# USER c-pac_user

.github/Dockerfiles/C-PAC.develop-bionic.Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ RUN rm -Rf /code/docker_data/Dockerfiles && \
1717
ENTRYPOINT ["/code/run-with-freesurfer.sh"]
1818

1919
# link libraries & clean up
20-
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
21-
ldconfig && \
22-
chmod 777 $(ls / | grep -v sys | grep -v proc)
20+
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
21+
&& ldconfig \
22+
&& chmod 777 / \
23+
&& chmod 777 $(ls / | grep -v sys | grep -v proc)
2324

2425
# set user
2526
# USER c-pac_user

.github/Dockerfiles/C-PAC.develop-fMRIPrep-LTS-xenial.Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ RUN rm -Rf /code/docker_data/Dockerfiles && \
1717
ENTRYPOINT ["/code/run-with-freesurfer.sh"]
1818

1919
# link libraries & clean up
20-
RUN sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
21-
locale-gen && \
22-
apt-get clean && \
23-
apt-get autoremove -y && \
24-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
25-
ldconfig && \
26-
chmod 777 $(ls / | grep -v sys | grep -v proc)
20+
RUN sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
21+
&& locale-gen \
22+
&& apt-get clean \
23+
&& apt-get autoremove -y \
24+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
25+
&& ldconfig \
26+
&& chmod 777 / \
27+
&& chmod 777 $(ls / | grep -v sys | grep -v proc)
2728

2829
# set user
2930
# USER c-pac_user
Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
FROM ghcr.io/fcp-indi/c-pac:latest-bionic
1+
FROM ghcr.io/fcp-indi/c-pac/stage-base:lite-v1.8.6.dev1
22
LABEL org.opencontainers.image.description "Full C-PAC image without FreeSurfer"
33
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
44
USER root
5+
6+
# install C-PAC
7+
COPY dev/circleci_data/pipe-test_ci.yml /cpac_resources/pipe-test_ci.yml
8+
COPY . /code
9+
RUN pip install -e /code
10+
# set up runscript
11+
COPY dev/docker_data /code/docker_data
12+
RUN rm -Rf /code/docker_data/Dockerfiles && \
13+
mv /code/docker_data/* /code && \
14+
rm -Rf /code/docker_data && \
15+
chmod +x /code/run.py && \
16+
rm -Rf /code/run-with-freesurfer.sh
517
ENTRYPOINT ["/code/run.py"]
618

7-
# remove FreeSurfer, link libraries & clean up
8-
RUN rm -rf /usr/lib/freesurfer/ /code/run-with-freesurfer.sh /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
9-
ln -svf /usr/lib/x86_64-linux-gnu/libgsl.so.23 /usr/lib/x86_64-linux-gnu/libgsl.so.0 && ldconfig && \
10-
chmod 777 $(ls / | grep -v sys | grep -v proc)
19+
# link libraries & clean up
20+
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
21+
&& ldconfig \
22+
&& chmod 777 / \
23+
&& chmod 777 $(ls / | grep -v sys | grep -v proc)
1124

1225
# set user
1326
# USER c-pac_user

.github/Dockerfiles/FSL.5.0.10-bionic.Dockerfile

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
FROM ghcr.io/shnizzedy/c-pac/fsl:neurodebian-bionic as FSL-Neurodebian
1+
# Copyright (C) 2021-2023 C-PAC Developers
2+
3+
# This file is part of C-PAC.
4+
5+
# C-PAC is free software: you can redistribute it and/or modify it under
6+
# the terms of the GNU Lesser General Public License as published by the
7+
# Free Software Foundation, either version 3 of the License, or (at your
8+
# option) any later version.
9+
10+
# C-PAC is distributed in the hope that it will be useful, but WITHOUT
11+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13+
# License for more details.
14+
15+
# You should have received a copy of the GNU Lesser General Public
16+
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
17+
FROM ghcr.io/fcp-indi/c-pac/fsl:data as data
218
FROM ghcr.io/fcp-indi/c-pac/ubuntu:bionic-non-free AS FSL
319

420
USER root
@@ -14,7 +30,6 @@ ENV FSLDIR=/usr/share/fsl/5.0 \
1430
PATH=/usr/lib/fsl/5.0:$PATH \
1531
TZ=America/New_York
1632

17-
1833
# Installing and setting up FSL
1934
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
2035
echo $TZ > /etc/timezone && \
@@ -45,4 +60,6 @@ COPY --from=FSL /usr/bin/wish /usr/bin/wish
4560
COPY --from=FSL /usr/share/fsl/ /usr/share/fsl/
4661
COPY --from=FSL /usr/lib/ /usr/lib/
4762
COPY --from=FSL /lib/x86_64-linux-gnu/lib*so* /lib/x86_64-linux-gnu/
48-
COPY --from=FSL-Neurodebian /usr/share/fsl/5.0/data/standard/tissuepriors/*mm /usr/share/fsl/5.0/data/standard/tissuepriors/
63+
# install C-PAC resources into FSL
64+
COPY --from=data /fsl_data/standard /usr/share/fsl/5.0/data/standard
65+
COPY --from=data /fsl_data/atlases /usr/share/fsl/5.0/data/atlases

0 commit comments

Comments
 (0)