Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0ba48c1

Browse files
committedMay 17, 2024·
fix: clean up environment cache
1 parent 7cef99c commit 0ba48c1

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed
 

‎.circleci/config.yml

+8-20
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
- checkout
1313
- restore_cache:
1414
keys:
15-
- env-v3-{{ .Branch }}-
16-
- env-v3-master-
17-
- env-v3-
15+
- env-v5-{{ .Branch }}-
16+
- env-v5-master-
17+
- env-v5-
1818
- run:
1919
name: Setup git-annex
2020
command: |
@@ -29,17 +29,14 @@ jobs:
2929
- run:
3030
name: Setup DataLad
3131
command: |
32-
export PY3=$(pyenv versions | grep '3\.' |
33-
sed -e 's/.* 3\./3./' -e 's/ .*//')
34-
pyenv local $PY3
35-
python -m pip install --no-cache-dir -U pip "setuptools >= 45.0" "setuptools_scm[toml] >= 3.4"
36-
python -m pip install --no-cache-dir -U datalad datalad-osf
32+
python3 -m pip install --no-cache-dir -U pip "setuptools >= 45.0" "setuptools_scm[toml] >= 3.4"
33+
python3 -m pip install --no-cache-dir -U datalad datalad-osf
3734
3835
- save_cache:
39-
key: env-v3-{{ .Branch }}-{{ .BuildNum }}
36+
key: env-v5-{{ .Branch }}-{{ .BuildNum }}
4037
paths:
4138
- /opt/circleci/git-annex.linux
42-
- /opt/circleci/.pyenv/versions/3.9.4
39+
- /opt/circleci/.pyenv/versions/3.12.2
4340

4441
- restore_cache:
4542
keys:
@@ -49,10 +46,7 @@ jobs:
4946
- run:
5047
name: Install test data from GIN
5148
command: |
52-
export PY3=$(pyenv versions | grep '3\.' |
53-
sed -e 's/.* 3\./3./' -e 's/ .*//')
54-
pyenv local $PY3
55-
export PATH=/opt/circleci/git-annex.linux:$PATH
49+
export PATH=/opt/circleci/.pyenv/versions/3.12.2/bin/:/opt/circleci/git-annex.linux:$PATH
5650
mkdir -p /tmp/data
5751
cd /tmp/data
5852
datalad install -r https://gin.g-node.org/oesteban/nitransforms-tests
@@ -98,9 +92,6 @@ jobs:
9892
name: Build Docker image & push to registry
9993
no_output_timeout: 60m
10094
command: |
101-
export PY3=$(pyenv versions | grep '3\.' |
102-
sed -e 's/.* 3\./3./' -e 's/ .*//')
103-
pyenv local $PY3
10495
e=1 && for i in {1..5}; do
10596
docker build --rm --cache-from=nitransforms:latest \
10697
-t nitransforms:latest \
@@ -123,9 +114,6 @@ jobs:
123114
- run:
124115
name: Check version packaged in Docker image
125116
command: |
126-
export PY3=$(pyenv versions | grep '3\.' |
127-
sed -e 's/.* 3\./3./' -e 's/ .*//')
128-
pyenv local $PY3
129117
THISVERSION=${CIRCLE_TAG:-$(python3 setup.py --version)}
130118
INSTALLED_VERSION=$(\
131119
docker run -it --rm --entrypoint=python nitransforms \

‎Dockerfile

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
FROM ubuntu:xenial-20200114
1+
#
2+
# Build wheel
3+
#
4+
FROM python:slim AS src
5+
RUN pip install build
6+
RUN apt-get update && \
7+
apt-get install -y --no-install-recommends git
8+
COPY . /src
9+
RUN python -m build /src
10+
11+
FROM ubuntu:jammy-20240125
212

313
# Pre-cache neurodebian key
414
COPY docker/files/neurodebian.gpg /usr/local/etc/neurodebian.gpg
@@ -139,8 +149,8 @@ ENV HOME="/home/neuro"
139149
# Install package
140150
# CRITICAL: Make sure python setup.py --version has been run at least once
141151
# outside the container, with access to the git history.
142-
COPY . /src/nitransforms
143-
RUN pip install --no-cache-dir "/src/nitransforms[all]"
152+
COPY --from=src /src/dist/*.whl .
153+
RUN python -m pip install --no-cache-dir $( ls *.whl )[all]
144154

145155
RUN find $HOME -type d -exec chmod go=u {} + && \
146156
find $HOME -type f -exec chmod go=u {} +

0 commit comments

Comments
 (0)
Please sign in to comment.