diff --git a/.circleci/config.yml b/.circleci/config.yml index 1a067007..e1297c48 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,9 +12,9 @@ jobs: - checkout - restore_cache: keys: - - env-v3-{{ .Branch }}- - - env-v3-master- - - env-v3- + - env-v5-{{ .Branch }}- + - env-v5-master- + - env-v5- - run: name: Setup git-annex command: | @@ -29,17 +29,14 @@ jobs: - run: name: Setup DataLad command: | - export PY3=$(pyenv versions | grep '3\.' | - sed -e 's/.* 3\./3./' -e 's/ .*//') - pyenv local $PY3 - python -m pip install --no-cache-dir -U pip "setuptools >= 45.0" "setuptools_scm[toml] >= 3.4" - python -m pip install --no-cache-dir -U datalad datalad-osf + python3 -m pip install --no-cache-dir -U pip "setuptools >= 45.0" "setuptools_scm[toml] >= 3.4" + python3 -m pip install --no-cache-dir -U datalad datalad-osf - save_cache: - key: env-v3-{{ .Branch }}-{{ .BuildNum }} + key: env-v5-{{ .Branch }}-{{ .BuildNum }} paths: - /opt/circleci/git-annex.linux - - /opt/circleci/.pyenv/versions/3.9.4 + - /opt/circleci/.pyenv/versions/3.12.2 - restore_cache: keys: @@ -49,10 +46,7 @@ jobs: - run: name: Install test data from GIN command: | - export PY3=$(pyenv versions | grep '3\.' | - sed -e 's/.* 3\./3./' -e 's/ .*//') - pyenv local $PY3 - export PATH=/opt/circleci/git-annex.linux:$PATH + export PATH=/opt/circleci/.pyenv/versions/3.12.2/bin/:/opt/circleci/git-annex.linux:$PATH mkdir -p /tmp/data cd /tmp/data datalad install -r https://gin.g-node.org/oesteban/nitransforms-tests @@ -98,9 +92,6 @@ jobs: name: Build Docker image & push to registry no_output_timeout: 60m command: | - export PY3=$(pyenv versions | grep '3\.' | - sed -e 's/.* 3\./3./' -e 's/ .*//') - pyenv local $PY3 e=1 && for i in {1..5}; do docker build --rm --cache-from=nitransforms:latest \ -t nitransforms:latest \ @@ -123,9 +114,6 @@ jobs: - run: name: Check version packaged in Docker image command: | - export PY3=$(pyenv versions | grep '3\.' | - sed -e 's/.* 3\./3./' -e 's/ .*//') - pyenv local $PY3 THISVERSION=${CIRCLE_TAG:-$(python3 setup.py --version)} INSTALLED_VERSION=$(\ docker run -it --rm --entrypoint=python nitransforms \ diff --git a/Dockerfile b/Dockerfile index e578d3ed..3ced65d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,15 @@ -FROM ubuntu:xenial-20200114 +FROM ubuntu:jammy-20240125 + +# +# Build wheel +# +FROM python:slim AS src +RUN pip install build +RUN apt-get update && \ + apt-get install -y --no-install-recommends git +COPY . /src +RUN python -m build /src + # Pre-cache neurodebian key COPY docker/files/neurodebian.gpg /usr/local/etc/neurodebian.gpg @@ -139,8 +150,8 @@ ENV HOME="/home/neuro" # Install package # CRITICAL: Make sure python setup.py --version has been run at least once # outside the container, with access to the git history. -COPY . /src/nitransforms -RUN pip install --no-cache-dir "/src/nitransforms[all]" +COPY --from=src /src/dist/*.whl . +RUN python -m pip install --no-cache-dir $( ls *.whl )[all] RUN find $HOME -type d -exec chmod go=u {} + && \ find $HOME -type f -exec chmod go=u {} +