From e9b87987ecbe135201860137275424118a2197c1 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Mon, 30 Aug 2021 09:27:36 +0200 Subject: [PATCH 1/4] fix: use orb and set up Docker Hub authentication --- .circleci/config.yml | 49 +++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ec081df2..2325c987 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,9 +21,11 @@ docs_deploy: &docs name: Deploy docs to gh-pages branch command: gh-pages --dotfiles --message "doc(update) [skip ci]" --dist docs/_build/html -version: 2 -jobs: +version: 2.1 +orbs: + docker: circleci/docker@1.6.0 +jobs: build: machine: image: circleci/classic:201711-01 @@ -48,6 +50,13 @@ jobs: - build-v1- paths: - /tmp/docker + - docker/install-docker-credential-helper + - run: + name: Login into Docker Hub + command: | + if [[ -n "$DOCKER_PAT" ]]; then + echo "$DOCKER_PAT" | docker login -u $DOCKER_USER --password-stdin + fi - run: name: Set-up a Docker registry command: | @@ -452,6 +461,13 @@ jobs: - build-v1- paths: - /tmp/docker + - docker/install-docker-credential-helper + - run: + name: Login into Docker Hub + command: | + if [[ -n "$DOCKER_PAT" ]]; then + echo "$DOCKER_PAT" | docker login -u $DOCKER_USER --password-stdin + fi - run: name: Set-up a Docker registry command: | @@ -466,11 +482,8 @@ jobs: name: Deploy to Docker Hub no_output_timeout: 40m command: | - if [[ -n "$DOCKER_PASS" ]]; then - docker login -u $DOCKER_USER -p $DOCKER_PASS - docker tag nipreps/dmriprep nipreps/dmriprep:${CIRCLE_BRANCH#docker/} - docker push nipreps/dmriprep:${CIRCLE_BRANCH#docker/} - fi + docker tag nipreps/dmriprep nipreps/dmriprep:${CIRCLE_BRANCH#docker/} + docker push nipreps/dmriprep:${CIRCLE_BRANCH#docker/} deploy_docker: machine: @@ -501,6 +514,13 @@ jobs: - build-v1- paths: - /tmp/docker + - docker/install-docker-credential-helper + - run: + name: Login into Docker Hub + command: | + if [[ -n "$DOCKER_PAT" ]]; then + echo "$DOCKER_PAT" | docker login -u $DOCKER_USER --password-stdin + fi - run: name: Set-up a Docker registry command: | @@ -515,15 +535,12 @@ jobs: name: Deploy to Docker Hub no_output_timeout: 40m command: | - if [[ -n "$DOCKER_PASS" ]]; then - docker login -u $DOCKER_USER -p $DOCKER_PASS - docker tag nipreps/dmriprep nipreps/dmriprep:unstable - docker push nipreps/dmriprep:unstable - if [[ -n "$CIRCLE_TAG" ]]; then - docker push nipreps/dmriprep:latest - docker tag nipreps/dmriprep nipreps/dmriprep:$CIRCLE_TAG - docker push nipreps/dmriprep:$CIRCLE_TAG - fi + docker tag nipreps/dmriprep nipreps/dmriprep:unstable + docker push nipreps/dmriprep:unstable + if [[ -n "$CIRCLE_TAG" ]]; then + docker push nipreps/dmriprep:latest + docker tag nipreps/dmriprep nipreps/dmriprep:$CIRCLE_TAG + docker push nipreps/dmriprep:$CIRCLE_TAG fi test_deploy_pypi: From 27aea07ba072307ff3786d399ad7e688ab8f0d7a Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Mon, 30 Aug 2021 09:33:14 +0200 Subject: [PATCH 2/4] maint: update machine executor image, following recommendations --- .circleci/config.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2325c987..b73232fb 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,9 @@ orbs: jobs: build: machine: - image: circleci/classic:201711-01 + # https://discuss.circleci.com/t/linux-machine-executor-images-2021-april-q2-update/39928 + # upgrade Docker version + image: ubuntu-2004:202104-01 working_directory: /tmp/src/dmriprep environment: TZ: "/usr/share/zoneinfo/America/Los_Angeles" @@ -228,7 +230,9 @@ jobs: ds000206: machine: - image: circleci/classic:201711-01 + # https://discuss.circleci.com/t/linux-machine-executor-images-2021-april-q2-update/39928 + # upgrade Docker version + image: ubuntu-2004:202104-01 working_directory: /tmp/ds000206 environment: - FS_LICENSE: /tmp/fslicense/license.txt @@ -346,7 +350,9 @@ jobs: ds001771: machine: - image: circleci/classic:201711-01 + # https://discuss.circleci.com/t/linux-machine-executor-images-2021-april-q2-update/39928 + # upgrade Docker version + image: ubuntu-2004:202104-01 working_directory: /tmp/ds001771 environment: - FS_LICENSE: /tmp/fslicense/license.txt @@ -434,7 +440,9 @@ jobs: deploy_docker_patches: machine: - image: circleci/classic:201711-01 + # https://discuss.circleci.com/t/linux-machine-executor-images-2021-april-q2-update/39928 + # upgrade Docker version + image: ubuntu-2004:202104-01 working_directory: /tmp/src/dmriprep steps: - run: @@ -487,7 +495,9 @@ jobs: deploy_docker: machine: - image: circleci/classic:201711-01 + # https://discuss.circleci.com/t/linux-machine-executor-images-2021-april-q2-update/39928 + # upgrade Docker version + image: ubuntu-2004:202104-01 working_directory: /tmp/src/dmriprep steps: - run: From 754a2acd339b82a5c672d165ee8d39819257dc65 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Mon, 30 Aug 2021 09:45:51 +0200 Subject: [PATCH 3/4] fix: better cache identifiers (see nipreps/fmriprep#2457) --- .circleci/config.yml | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b73232fb..78ce89e3 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,7 +46,8 @@ jobs: fi - restore_cache: keys: - - build-v1-{{ .Branch }}-{{ epoch }} + - build-v1-{{ .Branch }}-{{ .Revision }} + - build-v1--{{ .Revision }} - build-v1-{{ .Branch }}- - build-v1-master- - build-v1- @@ -121,7 +122,7 @@ jobs: docker exec -it registry /bin/registry garbage-collect --delete-untagged \ /etc/docker/registry/config.yml - save_cache: - key: build-v1-{{ .Branch }}-{{ epoch }} + key: build-v1-{{ .Branch }}-{{ .Revision }} paths: - /tmp/docker - persist_to_workspace: @@ -165,7 +166,8 @@ jobs: - restore_cache: keys: - - data-ds001771-v3-{{ .Branch }}-{{ .Revision }}- + - data-ds001771-v3-{{ .Branch }}-{{ .Revision }} + - data-ds001771-v3--{{ .Revision }} - data-ds001771-v3-{{ .Branch }}- - data-ds001771-v3-master- - data-ds001771-v3- @@ -185,13 +187,14 @@ jobs: ds001771/derivatives/freesurfer-6.0.1/sub-36/surf/rh.thickness - save_cache: - key: data-ds001771-v3-{{ .Branch }}-{{ .Revision }}-{{ epoch }} + key: data-ds001771-v3-{{ .Branch }}-{{ .Revision }} paths: - /tmp/data/ds001771 - restore_cache: keys: - - data-ds000206-v2-{{ .Branch }}-{{ .Revision }}- + - data-ds000206-v2-{{ .Branch }}-{{ .Revision }} + - data-ds000206-v2--{{ .Revision }}- - data-ds000206-v2-{{ .Branch }}- - data-ds000206-v2-master- - data-ds000206-v2- @@ -204,7 +207,7 @@ jobs: datalad get -J 2 -r -d ds000206/derivatives/ ds000206/derivatives/freesurfer-6.0.1/sub-05/* - save_cache: - key: data-ds000206-v2-{{ .Branch }}-{{ .Revision }}-{{ epoch }} + key: data-ds000206-v2-{{ .Branch }}-{{ .Revision }} paths: - /tmp/data/ds000206 @@ -255,16 +258,15 @@ jobs: at: /tmp - restore_cache: keys: - - data-ds000206-v2-{{ .Branch }}-{{ .Revision }}-{{ epoch }} + - data-ds000206-v2-{{ .Branch }}-{{ .Revision }} - data-ds000206-v2-{{ .Branch }}-{{ .Revision }}- + - data-ds000206-v2--{{ .Revision }}- - data-ds000206-v2-{{ .Branch }}- - data-ds000206-v2-master- - data-ds000206-v2- - restore_cache: keys: - - build-v1-{{ .Branch }}-{{ epoch }} - - build-v1-{{ .Branch }}- - - build-v1- + - build-v1-{{ .Branch }}-{{ .Revision }} paths: - /tmp/docker - run: @@ -306,7 +308,7 @@ jobs: rm -rf /tmp/ds000206/work/reportlets when: on_success - save_cache: - key: ds000206-anat-v01-{{ .Branch }}-{{ .Revision }}-{{ epoch }} + key: ds000206-anat-v01-{{ .Branch }}-{{ .Revision }} paths: - /tmp/ds000206/work - run: @@ -375,15 +377,15 @@ jobs: at: /tmp - restore_cache: keys: - - data-ds001771-v3-{{ .Branch }}-{{ .Revision }}-{{ epoch }} - data-ds001771-v3-{{ .Branch }}-{{ .Revision }}- + - data-ds001771-v3--{{ .Revision }}- - data-ds001771-v3-{{ .Branch }}- - data-ds001771-v3-master- - data-ds001771-v3- - restore_cache: keys: - - build-v1-{{ .Branch }}-{{ epoch }} - - build-v1-{{ .Branch }}- + - build-v1-{{ .Branch }}-{{ .Revision }} + - build-v1--{{ .Revision }} - build-v1- paths: - /tmp/docker @@ -464,9 +466,7 @@ jobs: fi - restore_cache: keys: - - build-v1-{{ .Branch }}-{{ epoch }} - - build-v1-{{ .Branch }}- - - build-v1- + - build-v1-{{ .Branch }}-{{ .Revision }} paths: - /tmp/docker - docker/install-docker-credential-helper @@ -519,9 +519,7 @@ jobs: fi - restore_cache: keys: - - build-v1-{{ .Branch }}-{{ epoch }} - - build-v1-{{ .Branch }}- - - build-v1- + - build-v1-{{ .Branch }}-{{ .Revision }} paths: - /tmp/docker - docker/install-docker-credential-helper @@ -665,6 +663,7 @@ jobs: - restore_cache: keys: - docs-v1-{{ .Branch }}-{{ .Revision }} + - docs-v1--{{ .Revision }} - docs-v1-{{ .Branch }}- - docs-v1-master - docs-v1- From 1585e0c74b84d3f2a5ae8cc2a5135e200f0d0d5a Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Mon, 30 Aug 2021 09:47:10 +0200 Subject: [PATCH 4/4] enh: relax python packaging tests (see nipreps/fmriprep#2472) --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 78ce89e3..b8a71941 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -761,9 +761,9 @@ workflows: - test_deploy_pypi: filters: branches: - ignore: - - /docs\/.*/ - - /docker\/.*/ + only: + - /rel\/.*/ + - /maint\/.*/ tags: only: /.*/