Skip to content

Commit

Permalink
fix: clean up environment cache
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban committed May 17, 2024
1 parent 7cef99c commit 6aae481
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
28 changes: 8 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ ENV HOME="/home/neuro"
# 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]"
RUN python -m pip install --no-cache-dir "/src/nitransforms[all]"

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

0 comments on commit 6aae481

Please sign in to comment.