Skip to content

Commit

Permalink
Merge pull request #2100 from FCP-INDI/rc/v1.8.7
Browse files Browse the repository at this point in the history
Release v1.8.7
  • Loading branch information
sgiavasis authored May 3, 2024
2 parents 6448fed + e098f66 commit 96db8b0
Show file tree
Hide file tree
Showing 104 changed files with 3,341 additions and 625 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/fcp-indi/c-pac/stage-base:abcd-hcp-v1.8.6.dev1
FROM ghcr.io/fcp-indi/c-pac/stage-base:abcd-hcp-v1.8.7.dev1
LABEL org.opencontainers.image.description "Full C-PAC image with software dependencies version-matched to [ABCD-HCP BIDS fMRI Pipeline](https://github.com/DCAN-Labs/abcd-hcp-pipeline/blob/e480a8f99534f1b05f37bf44c64827384b69b383/Dockerfile)"
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
USER root
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/fcp-indi/c-pac/stage-base:fmriprep-lts-v1.8.6.dev1
FROM ghcr.io/fcp-indi/c-pac/stage-base:fmriprep-lts-v1.8.7.dev1
LABEL org.opencontainers.image.description "Full C-PAC image with software dependencies version-matched to [fMRIPrep LTS](https://reproducibility.stanford.edu/fmriprep-lts#long-term-support-lts)"
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
USER root
Expand Down
2 changes: 1 addition & 1 deletion .github/Dockerfiles/C-PAC.develop-jammy.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# You should have received a copy of the GNU Lesser General Public
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
FROM ghcr.io/fcp-indi/c-pac/stage-base:standard-v1.8.6.dev1
FROM ghcr.io/fcp-indi/c-pac/stage-base:standard-v1.8.7.dev1
LABEL org.opencontainers.image.description "Full C-PAC image"
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
USER root
Expand Down
2 changes: 1 addition & 1 deletion .github/Dockerfiles/C-PAC.develop-lite-jammy.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# You should have received a copy of the GNU Lesser General Public
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
FROM ghcr.io/fcp-indi/c-pac/stage-base:lite-v1.8.6.dev1
FROM ghcr.io/fcp-indi/c-pac/stage-base:lite-v1.8.7.dev1
LABEL org.opencontainers.image.description "Full C-PAC image without FreeSurfer"
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
USER root
Expand Down
14 changes: 9 additions & 5 deletions .github/Dockerfiles/base-ABCD-HCP.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
FROM ghcr.io/fcp-indi/c-pac/afni:21.1.00-bionic as AFNI
FROM ghcr.io/fcp-indi/c-pac/ants:2.2.0.neurodocker-bionic as ANTs
FROM ghcr.io/fcp-indi/c-pac/c3d:1.0.0-bionic as c3d
FROM ghcr.io/fcp-indi/c-pac/connectome-workbench:1.3.2-1.neurodebian-bionic as connectome-workbench
FROM ghcr.io/fcp-indi/c-pac/freesurfer:6.0.0-min.neurodocker-bionic as FreeSurfer
FROM ghcr.io/fcp-indi/c-pac/fsl:5.0.10-bionic as FSL
FROM ghcr.io/fcp-indi/c-pac/ica-aroma:0.4.3-beta-bionic as ICA-AROMA
Expand Down Expand Up @@ -43,7 +42,7 @@ COPY --from=ANTs /ants_template /ants_template
# install FSL
COPY --from=FSL /usr/bin/tclsh /usr/bin/tclsh
COPY --from=FSL /usr/bin/wish /usr/bin/wish
COPY --from=FSL /usr/share/fsl/ /usr/share/fsl/
COPY --from=FSL /usr/share/fsl /usr/share/fsl
COPY --from=FSL /lib/x86_64-linux-gnu/lib*so* /lib/x86_64-linux-gnu/
COPY --from=FSL /usr/lib/lib*so* /usr/lib/
# set up FSL environment
Expand Down Expand Up @@ -76,9 +75,14 @@ ENV MSMBINDIR=/opt/msm/Ubuntu \
PATH=$PATH:/opt/msm/Ubuntu

# install Connectome Workbench
COPY --from=connectome-workbench /lib64/* /lib64.
COPY --from=connectome-workbench /lib/x86_64-linux-gnu/* /lib/x86_64-linux-gnu/
COPY --from=connectome-workbench /usr/* /usr/
RUN APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC && \
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 && \
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DCC9EFBF77E11517 && \
printf '\ndeb http://httpredir.debian.org/debian/ buster main non-free' >> /etc/apt/sources.list && \
apt-get update --allow-insecure-repositories && \
apt-get install connectome-workbench=1.3.2-1 -y && \
strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
ENV PATH=/usr:$PATH

# install ICA-AROMA
COPY --from=ICA-AROMA /opt/ICA-AROMA /opt/ICA-AROMA
Expand Down
2 changes: 1 addition & 1 deletion .github/Dockerfiles/base-standard.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
FROM ghcr.io/fcp-indi/c-pac/freesurfer:6.0.0-min.neurodocker-jammy as FreeSurfer

FROM ghcr.io/fcp-indi/c-pac/stage-base:lite-v1.8.6.dev1
FROM ghcr.io/fcp-indi/c-pac/stage-base:lite-v1.8.7.dev1
LABEL org.opencontainers.image.description "NOT INTENDED FOR USE OTHER THAN AS A STAGE IMAGE IN A MULTI-STAGE BUILD \
Standard software dependencies for C-PAC standard images"
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
Expand Down
62 changes: 62 additions & 0 deletions .github/scripts/autoversioning.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash

# Copyright (C) 2024 C-PAC Developers

# This file is part of C-PAC.

# C-PAC is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.

# C-PAC is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License for more details.

# You should have received a copy of the GNU Lesser General Public
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.

# Update version comment strings
cd CPAC
VERSION=$(python -c "from info import __version__; print(('.'.join(('.'.join(__version__[::-1].split('-')[1].split('.')[1:])[::-1], __version__.split('-')[1])) if '-' in __version__ else __version__).split('+', 1)[0])")
cd ..
echo "v${VERSION}" > version
export _SED_COMMAND="s/^(# [Vv]ersion ).*$/# Version ${VERSION}/g"
if [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
find ./CPAC/resources/configs -name "*.yml" -exec sed -i '' -E "${_SED_COMMAND}" {} \;
else
# Linux and others
find ./CPAC/resources/configs -name "*.yml" -exec sed -i'' -r "${_SED_COMMAND}" {} \;
fi
git add version
VERSIONS=( `git show $(git log --pretty=format:'%h' -n 2 version | tail -n 1):version` `cat version` )
export PATTERN="(declare|typeset) -a"
if [[ "$(declare -p VERSIONS)" =~ $PATTERN ]]
then
for DOCKERFILE in $(find ./.github/Dockerfiles -name "*.Dockerfile")
do
export IFS=""
for LINE in $(grep "FROM ghcr\.io/fcp\-indi/c\-pac/.*\-${VERSIONS[0]}" ${DOCKERFILE})
do
echo "Updating stage tags in ${DOCKERFILE}"
if [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
sed -i "" "s/\-${VERSIONS[0]}/\-${VERSIONS[1]}/g" ${DOCKERFILE}
else
# Linux and others
sed -i "s/\-${VERSIONS[0]}/\-${VERSIONS[1]}/g" ${DOCKERFILE}
fi
done
done
unset IFS
fi
git add CPAC/resources/configs .github/Dockerfiles

# Overwrite top-level Dockerfiles with the CI Dockerfiles
cp .github/Dockerfiles/C-PAC.develop-jammy.Dockerfile Dockerfile
cp .github/Dockerfiles/C-PAC.develop-ABCD-HCP-bionic.Dockerfile variant-ABCD-HCP.Dockerfile
cp .github/Dockerfiles/C-PAC.develop-fMRIPrep-LTS-xenial.Dockerfile variant-fMRIPrep-LTS.Dockerfile
cp .github/Dockerfiles/C-PAC.develop-lite-jammy.Dockerfile variant-lite.Dockerfile
git add *Dockerfile
71 changes: 1 addition & 70 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,77 +35,8 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Check if version updated
id: version_updated
run: |
git config --global user.email "CMI_CPAC_Support@childmind.org"
git config --global user.name "Theodore (Machine User)"
GITHUB_BRANCH=$(echo ${GITHUB_REF} | cut -d '/' -f 3-)
export PYTHONPATH=$PWD
pip install -q wheel
pip install -q nipype numpy matplotlib pandas pathvalidate pytz pyyaml voluptuous
python ./CPAC/utils/configuration/yaml_template.py
if [[ ! -z $(git diff origin/${GITHUB_BRANCH}) ]]
then
git add CPAC/resources/configs
git commit -m ":bulb: Update comments based on default preconfig"
fi
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
if [[ ! "$COMMIT_MESSAGE" == *"Update version to"* ]]
then
cd CPAC
VERSION=$(python -c "from info import __version__; print(('.'.join(('.'.join(__version__[::-1].split('-')[1].split('.')[1:])[::-1], __version__.split('-')[1])) if '-' in __version__ else __version__).split('+', 1)[0])")
cd ..
echo "v${VERSION}" > version
find ./CPAC/resources/configs -name "*.yml" -exec sed -i -r "s/^(# [Vv]ersion ).*$/# Version ${VERSION}/g" {} \;
git add version
VERSIONS=($(git diff origin/${GITHUB_BRANCH} -- version | tail -n 2))
export PATTERN="(declare|typeset) -a"
if [[ "$(declare -p VERSIONS)" =~ $PATTERN ]]
then
for DOCKERFILE in $(find ./.github/Dockerfiles -name "*.Dockerfile")
do
export IFS=""
for LINE in $(grep "FROM ghcr\.io/fcp\-indi/c\-pac/.*\-${VERSIONS[0]:1}" ${DOCKERFILE})
do
echo "Updating stage tags in ${DOCKERFILE}"
sed -i "s/\-${VERSIONS[0]:1}/\-${VERSIONS[1]:1}/g" ${DOCKERFILE}
done
done
unset IFS
fi
if [[ ! -z $(git diff origin/${GITHUB_BRANCH}) ]]
then
git add CPAC/resources/configs .github/Dockerfiles
git commit -m ":bookmark: Update version to ${VERSION} ($COMMIT_MESSAGE)" || true
git push origin HEAD:${GITHUB_BRANCH} || true
fi
cd ..
fi
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]
then
cd $HOME/work/C-PAC/C-PAC
for DOCKERFILE in $(ls .github/Dockerfiles/C-PAC.develop-*.Dockerfile)
do
if [[ "$DOCKERFILE" =~ .*C-PAC.develop-(.*)-(bionic|xenial).Dockerfile ]]
then
cp $DOCKERFILE variant-${BASH_REMATCH[1]}.Dockerfile
else
cp $DOCKERFILE Dockerfile
fi
done
git add *ockerfile
git commit -m ":truck: Copy develop Dockerfiles to root directory \
\
[skip ci]"
git push origin HEAD:${GITHUB_BRANCH} || true
fi
- name: Get changed files since last commit
uses: tj-actions/changed-files@v35.7.6
uses: tj-actions/changed-files@v41.0.0
id: changed-files
with:
since_last_remote_commit: "true"
Expand Down
4 changes: 4 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ MD013: false
# no duplicate headers
MD024:
siblings_only: true
# allow specific inline HTML elements
MD033:
allowed_elements:
- span
36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (C) 2024 C-PAC Developers

# This file is part of C-PAC.

# C-PAC is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.

# C-PAC is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License for more details.

# You should have received a copy of the GNU Lesser General Public
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.

repos:
- repo: local
hooks:
- id: autoversioning
name: Update Dockerfiles and version comments
entry: .github/scripts/autoversioning.sh
language: script
files: '.*Dockerfile$|.*\.yaml$|^CPAC/info\.py$'
- id: update-yaml-comments
name: Update YAML comments
entry: CPAC/utils/configuration/yaml_template.py
language: python
files: '^CPAC/resources/configs/pipeline_config_.*\.ya?ml'
additional_dependencies:
- "click"
- "nipype"
- "pathvalidate"
- "pyyaml"
- "voluptuous"
29 changes: 26 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,31 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.8.6]
## [1.8.7] - 2024-05-03

## Added
### Added

- `Robustfov` feature in `FSL-BET` to crop images ensuring removal of neck regions that may appear in the skull-stripped images.
- Ability to throttle nodes, estimating all available memory when threading.
- Ability to configure FreeSurfer ingress from the command line.

### Changed

- The ABCD-pipeline based surface post-processing workflows have been modularized to be more robust, resolving a running issue with this part of the pipeline stalling or crashing in some runs.
- Moved autoversioning from CI to pre-commit
- Updated `FSL-BET` config to default `-mask-boolean` flag as on, and removed all removed `mask-boolean` keys from configs.
- Added `dvars` as optional output in `cpac_outputs`.

### Fixed

- Fixed a bug where ingressing fmriprep outputs into C-PAC with a blank nuisance confounds field in the C-PAC pipeline configuration file would cause a crash.
- Fixed a bug where spatial smoothing and z-scoring of final outputs would sometimes fail to run when running a C-PAC pipeline that would ingress fmriprep outputs.
- Fixed a bug where ingress of distortion correction-related field map metadata would sometimes fail to recognize both echo times, when there were two present, leading to an error message claiming an echo time is missing.
- Changed an extraneous default pipeline configuration setting - `surface_connectivity` is now disabled in the default configuration as intended.

## [1.8.6] - 2024-01-15

### Added

- Some automatic handling of user-provided BIDSy atlas names.
- `sig_imports` static method decorator for `Function` nodes, to accommodate type hinting in signatures of `Function` node functions.
Expand All @@ -26,7 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `switch_is_off`, `switch_is_on` and `switch_is_on_off` methods to `Configuration` class
- `__repr__` and `__str__` methods to `ResourcePool`s and `NodeBlockFunction`s

## Fixed
### Fixed

- Fixed a bug where some connectivity matrices wouldn't generate if anatomical and functional outputs were in different resolutions.
- Handling of `3dECM` outputs for AFNI ≥ 21.1.1.
Expand Down Expand Up @@ -272,6 +294,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

See [Version 1.8.1 Beta](https://fcp-indi.github.io/docs/user/release_notes/v1.8.1) for release notes for v1.8.1 and [Release Notes](https://fcp-indi.github.io/docs/user/release_notes) for all release notes back to v0.1.1.

[unreleased]: https://github.com/FCP-INDI/C-PAC/compare/v1.8.6...develop
[1.8.6]: https://github.com/FCP-INDI/C-PAC/releases/tag/v1.8.6
[1.8.5]: https://github.com/FCP-INDI/C-PAC/releases/tag/v1.8.5
[1.8.4]: https://github.com/FCP-INDI/C-PAC/releases/tag/v1.8.4
Expand Down
30 changes: 29 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Copyright (C) 2022 C-PAC Developers
<!-- Copyright (C) 2022-2024 C-PAC Developers
This file is part of C-PAC.
Expand All @@ -7,19 +7,47 @@ C-PAC is free software: you can redistribute it and/or modify it under the terms
C-PAC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with C-PAC. If not, see <https://www.gnu.org/licenses/>. -->

# CONTRIBUTING

## pre-commit

This project uses [pre-commit](https://pre-commit.com/), a framework for managing and maintaining git hooks. Pre-commit can be used to manage the hooks that run on every commit to automatically point out issues in code such as missing semicolons, trailing whitespace, and debug statements. By using these hooks, you can ensure code quality and prevent bad code from being uploaded.

To install `pre-commit`, you can use `pip`:

```bash
pip install pre-commit
```

After installation, you can set up your git hooks with this command at the root of this repository:

```bash
pre-commit install
```

This will add a pre-commit script to your `.git/hooks/` directory. This script will run whenever you run `git commit`.

For more details on how to configure and use pre-commit, please refer to the official documentation.

## Git branches, tags and continuous integration

GitHub Actions builds C-PAC images for each branch and tag pushed to GitHub; these images are pushed to <span title="GitHub Container Registry">[GHCR](https://github.com/FCP-INDI/C-PAC/pkgs/container/c-pac/versions)</span> and deleted upon branch deletion on GitHub.

If a commit is pushed or merged into [`develop` on GitHub](https://github.com/FCP-INDI/C-PAC/tree/develop), GitHub Actions will push [`nightly` and its variants to Docker Hub](https://hub.docker.com/repository/registry-1.docker.io/fcpindi/c-pac/tags?page=1&ordering=last_updated&name=nightly).

If a tag is pushed to GitHub that matches the regular expression

```Regular Expression
^v[0-9]+\.[0-9]+\.[0-9]+$
```

GitHub Actions will push [`release-${TAG}` and its variants](https://hub.docker.com/repository/registry-1.docker.io/fcpindi/c-pac/tags?page=1&ordering=last_updated&name=release-) and [`latest` and its variants to Docker Hub](https://hub.docker.com/repository/registry-1.docker.io/fcpindi/c-pac/tags?page=1&ordering=last_updated&name=latest).

## Software dependencies and variant images

We currently have one main and 3 variant images:

* `ABCD-HCP`: dependency versions matched to [ABCD-HCP BIDS fMRI Pipeline](https://github.com/DCAN-Labs/abcd-hcp-pipeline/releases/tag/v0.1.1) versions
* `fMRIPrep-LTS`: dependency versions matched to [fMRIPrep Long-term support](https://reproducibility.stanford.edu/fmriprep-lts/) versions
* `lite`: same dependency versions as main image without FreeSurfer (smaller image)
Expand Down
Loading

0 comments on commit 96db8b0

Please sign in to comment.