Skip to content

Commit

Permalink
Merge pull request #2605 from nipreps/docker/do-not-pull-miniconda
Browse files Browse the repository at this point in the history
FIX: Optimize build job on CircleCI
  • Loading branch information
oesteban authored Oct 19, 2021
2 parents 33432c0 + d4ba805 commit 3f985d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 29 deletions.
40 changes: 12 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
fi
- restore_cache:
keys:
- build-v4-{{ .Branch }}-{{ .Revision }}
- build-v4--{{ .Revision }}
- build-v4-{{ .Branch }}-
- build-v4-master-
- build-v4-
- build-v5-{{ .Branch }}-{{ .Revision }}
- build-v5--{{ .Revision }}
- build-v5-{{ .Branch }}-
- build-v5-master-
- build-v5-
paths:
- /tmp/docker
- /tmp/images
Expand Down Expand Up @@ -71,22 +71,6 @@ jobs:
docker tag ubuntu:focal localhost:5000/ubuntu
docker push localhost:5000/ubuntu
fi
- run:
name: Pull nipreps/miniconda
command: |
set +e
docker pull localhost:5000/miniconda:py38_1.3.2
success=$?
set -e
if [[ "$success" = "0" ]]; then
echo "Pulled from local registry"
docker tag localhost:5000/miniconda:py38_1.3.2 nipreps/miniconda:py38_1.3.2
else
echo "Pulling from Docker Hub"
docker pull nipreps/miniconda:py38_1.3.2
docker tag nipreps/miniconda:py38_1.3.2 localhost:5000/miniconda:py38_1.3.2
docker push localhost:5000/miniconda:py38_1.3.2
fi
- run:
name: Pull fMRIPrep Docker image
command: |
Expand Down Expand Up @@ -146,7 +130,7 @@ jobs:
paths:
- src/fmriprep
- save_cache:
key: build-v4-{{ .Branch }}-{{ .Revision }}
key: build-v5-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down Expand Up @@ -297,7 +281,7 @@ jobs:
at: /tmp
- restore_cache:
keys:
- build-v4-{{ .Branch }}-{{ .Revision }}
- build-v5-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down Expand Up @@ -402,7 +386,7 @@ jobs:
at: /tmp
- restore_cache:
keys:
- build-v4-{{ .Branch }}-{{ .Revision }}
- build-v5-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down Expand Up @@ -637,7 +621,7 @@ jobs:
at: /tmp
- restore_cache:
keys:
- build-v4-{{ .Branch }}-{{ .Revision }}
- build-v5-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down Expand Up @@ -806,7 +790,7 @@ jobs:
at: /tmp
- restore_cache:
keys:
- build-v4-{{ .Branch }}-{{ .Revision }}
- build-v5-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down Expand Up @@ -941,7 +925,7 @@ jobs:
path: /home/circleci/src/fmriprep
- restore_cache:
keys:
- build-v4-{{ .Branch }}-{{ .Revision }}
- build-v5-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down Expand Up @@ -996,7 +980,7 @@ jobs:
fi
- restore_cache:
keys:
- build-v4-{{ .Branch }}-{{ .Revision }}
- build-v5-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/docker
- /tmp/images
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ RUN curl -sSLO https://www.humanconnectome.org/storage/app/media/workbench/workb
ENV PATH="/opt/workbench/bin_linux64:$PATH" \
LD_LIBRARY_PATH="/opt/workbench/lib_linux64:$LD_LIBRARY_PATH"

COPY --from=nipreps/miniconda:py38_1.3.2 /opt/conda /opt/conda
COPY --from=nipreps/miniconda@sha256:4d0dc0fabb794e9fe22ee468ae5f86c2c8c2b4cd9d7b7fdf0c134d9e13838729 /opt/conda /opt/conda

RUN ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
Expand Down

0 comments on commit 3f985d6

Please sign in to comment.