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

[CI]: Upgrade Docker images and workflows #396

Merged
merged 12 commits into from
Jan 24, 2025
2 changes: 1 addition & 1 deletion .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- '.github/workflows/**'
jobs:
run-tests:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
run-tests:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# Use custom docs CI image
container: ghcr.io/juaml/junifer-ci:main
strategy:
Expand All @@ -31,16 +31,16 @@ jobs:
run: |
echo "Using FSL : $(flirt -version)"
- name: Install system dependencies
# actions/checkout fails to identify Git as it's not in the CI image
run: |
# actions/checkout fails to identify Git as it's not in the CI image
apt-get -qq update && \
apt-get -qq install -y \
sudo apt-get update
sudo apt-get install -y \
git \
git-annex \
make \
jq
# Copy xfms directory
mkdir -p $HOME/junifer/data/xfms && \
- name: Copy xfms directory
mkdir -p $HOME/junifer/data/xfms
cp -ar /root/junifer/data/xfms/. $HOME/junifer/data/xfms/
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -59,8 +59,8 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "GitHub Runner"
- name: Test with tox
# https://github.com/actions/checkout/issues/1169#issuecomment-2291682583
run: |
# https://github.com/actions/checkout/issues/1169#issuecomment-2291682583
git config --system --add safe.directory $(pwd)
tox
- name: Upload coverage to Codecov
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-ci-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-docs-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency: preview-${{ github.ref }}

jobs:
build-docs:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# Use custom docs CI image
container: ghcr.io/juaml/junifer-docs:main
steps:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ on:

jobs:
build-docs:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# Use custom docs CI image
container: ghcr.io/juaml/junifer-docs:main
steps:
- name: Check ANTs
run: |
echo "Using ANTs : $(antsRegistration --version)"
- name: Install system dependencies
# actions/checkout fails to identify Git as it's not in the CI image
run: |
# actions/checkout fails to identify Git as it's not in the CI image
apt-get -qq update && \
apt-get -qq install -y \
sudo apt-get update
sudo apt-get install -y \
git \
git-annex \
make \
jq
# Copy xfms directory
mkdir -p $HOME/junifer/data/xfms && \
- name: Copy xfms directory
mkdir -p $HOME/junifer/data/xfms
cp -ar /root/junifer/data/xfms/. $HOME/junifer/data/xfms/
- name: Checkout source
- name: Checkout repository
uses: actions/checkout@v4
with:
# require all of history to see all tagged versions' docs
Expand Down Expand Up @@ -59,8 +59,8 @@ jobs:
path: docs/_build
- name: Build docs
# Use the args we normally pass to sphinx-build, but run sphinx-multiversion
# https://github.com/actions/checkout/issues/1169#issuecomment-2291682583
run: |
# https://github.com/actions/checkout/issues/1169#issuecomment-2291682583
git config --system --add safe.directory $(pwd)
make -C docs/ html
touch docs/_build/.nojekyll
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and publish

on:
push:
branches:
- main
tags:
- 'v*'

jobs:
build-and-publish:
name: Build and publish
runs-on: ubuntu-latest
permissions:
# Needed for PyPI publishing
id-token: write
# Needed for GitHub releases
contents: write
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install build
run:
python -m pip install --upgrade pip
python -m pip install build
- name: Build package
run:
python -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Make release on GitHub
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dist/*.tar.gz
dist/*.whl
generate_release_notes: true
make_latest: true
31 changes: 0 additions & 31 deletions .github/workflows/pypi.yml

This file was deleted.

12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-ast
- id: check-docstring-first
Expand All @@ -17,24 +17,24 @@ repos:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
rev: v0.23
hooks:
- id: validate-pyproject
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
rev: 24.10.0
hooks:
- id: black
exclude: ^(docs/|examples/|tools/)
args: [--check]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.2
rev: v0.9.3
hooks:
- id: ruff
types_or: [python, jupyter]
exclude: ^(__init__.py)
args: [--output-format, grouped, --show-fixes]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.4.0
hooks:
- id: codespell
exclude: ^(.github/|docs/)
Expand All @@ -48,7 +48,7 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
rev: "1.19.1"
hooks:
- id: blacken-docs
additional_dependencies:
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile-ci
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ RUN apt-get update && \
file \
dc \
libquadmath0 \
libgomp1
libgomp1 \
&& rm -rf /var/lib/apt/lists/*

# Add xfms
COPY --from=ghcr.io/juaml/human-template-xfms:main /opt/xfms /root/junifer/data/xfms
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile-docs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ RUN apt-get update && \
apt-get install -y \
# ANTs runtime stuff
libhdf5-dev \
bc
bc \
&& rm -rf /var/lib/apt/lists/*

# Add xfms
COPY --from=ghcr.io/juaml/human-template-xfms:main /opt/xfms /root/junifer/data/xfms
Expand Down
1 change: 1 addition & 0 deletions docs/changes/newsfragments/396.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update Docker image recipes and GitHub Actions workflows by `Synchon Mandal`_
2 changes: 2 additions & 0 deletions ignore_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ arange
sinc
whit
amin
lets
lIns
2 changes: 1 addition & 1 deletion junifer/markers/complexity/tests/test_complexity_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

pytest.importorskip("neurokit2")

from junifer.markers.complexity.complexity_base import ( # noqa: E402
from junifer.markers.complexity.complexity_base import (
ComplexityBase,
)

Expand Down
10 changes: 5 additions & 5 deletions junifer/markers/complexity/tests/test_hurst_exponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
pytest.importorskip("neurokit2")


from junifer.datareader import DefaultDataReader # noqa: E402
from junifer.markers.complexity import HurstExponent # noqa: E402
from junifer.pipeline.utils import _check_ants # noqa: E402
from junifer.storage import SQLiteFeatureStorage # noqa: E402
from junifer.testing.datagrabbers import ( # noqa: E402
from junifer.datareader import DefaultDataReader
from junifer.markers.complexity import HurstExponent
from junifer.pipeline.utils import _check_ants
from junifer.storage import SQLiteFeatureStorage
from junifer.testing.datagrabbers import (
SPMAuditoryTestingDataGrabber,
)

Expand Down
10 changes: 5 additions & 5 deletions junifer/markers/complexity/tests/test_multiscale_entropy_auc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

pytest.importorskip("neurokit2")

from junifer.datareader import DefaultDataReader # noqa: E402
from junifer.markers.complexity import MultiscaleEntropyAUC # noqa: E402
from junifer.pipeline.utils import _check_ants # noqa: E402
from junifer.storage import SQLiteFeatureStorage # noqa: E402
from junifer.testing.datagrabbers import ( # noqa: E402
from junifer.datareader import DefaultDataReader
from junifer.markers.complexity import MultiscaleEntropyAUC
from junifer.pipeline.utils import _check_ants
from junifer.storage import SQLiteFeatureStorage
from junifer.testing.datagrabbers import (
SPMAuditoryTestingDataGrabber,
)

Expand Down
10 changes: 5 additions & 5 deletions junifer/markers/complexity/tests/test_perm_entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

pytest.importorskip("neurokit2")

from junifer.datareader import DefaultDataReader # noqa: E402
from junifer.markers.complexity import PermEntropy # noqa: E402
from junifer.pipeline.utils import _check_ants # noqa: E402
from junifer.storage import SQLiteFeatureStorage # noqa: E402
from junifer.testing.datagrabbers import ( # noqa: E402
from junifer.datareader import DefaultDataReader
from junifer.markers.complexity import PermEntropy
from junifer.pipeline.utils import _check_ants
from junifer.storage import SQLiteFeatureStorage
from junifer.testing.datagrabbers import (
SPMAuditoryTestingDataGrabber,
)

Expand Down
10 changes: 5 additions & 5 deletions junifer/markers/complexity/tests/test_range_entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
pytest.importorskip("neurokit2")


from junifer.datareader import DefaultDataReader # noqa: E402
from junifer.markers.complexity import RangeEntropy # noqa: E402
from junifer.pipeline.utils import _check_ants # noqa: E402
from junifer.storage import SQLiteFeatureStorage # noqa: E402
from junifer.testing.datagrabbers import ( # noqa: E402
from junifer.datareader import DefaultDataReader
from junifer.markers.complexity import RangeEntropy
from junifer.pipeline.utils import _check_ants
from junifer.storage import SQLiteFeatureStorage
from junifer.testing.datagrabbers import (
SPMAuditoryTestingDataGrabber,
)

Expand Down
10 changes: 5 additions & 5 deletions junifer/markers/complexity/tests/test_range_entropy_auc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
pytest.importorskip("neurokit2")


from junifer.datareader import DefaultDataReader # noqa: E402
from junifer.markers.complexity import RangeEntropyAUC # noqa: E402
from junifer.pipeline.utils import _check_ants # noqa: E402
from junifer.storage import SQLiteFeatureStorage # noqa: E402
from junifer.testing.datagrabbers import ( # noqa: E402
from junifer.datareader import DefaultDataReader
from junifer.markers.complexity import RangeEntropyAUC
from junifer.pipeline.utils import _check_ants
from junifer.storage import SQLiteFeatureStorage
from junifer.testing.datagrabbers import (
SPMAuditoryTestingDataGrabber,
)

Expand Down
10 changes: 5 additions & 5 deletions junifer/markers/complexity/tests/test_sample_entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

pytest.importorskip("neurokit2")

from junifer.datareader import DefaultDataReader # noqa: E402
from junifer.markers.complexity import SampleEntropy # noqa: E402
from junifer.pipeline.utils import _check_ants # noqa: E402
from junifer.storage import SQLiteFeatureStorage # noqa: E402
from junifer.testing.datagrabbers import ( # noqa: E402
from junifer.datareader import DefaultDataReader
from junifer.markers.complexity import SampleEntropy
from junifer.pipeline.utils import _check_ants
from junifer.storage import SQLiteFeatureStorage
from junifer.testing.datagrabbers import (
SPMAuditoryTestingDataGrabber,
)

Expand Down
Loading
Loading