From 017b1328f6e2ccac676eb2d7b91d9c77950b0ef5 Mon Sep 17 00:00:00 2001 From: Eric Maydeck Date: Wed, 4 Sep 2024 16:22:57 -0600 Subject: [PATCH 1/9] fix: fixed docker tag command --- .circleci/config.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c594f1fc0..162ada09a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -446,8 +446,8 @@ jobs: fi echo "export GAR_IMAGE=\"<>/${GCP_GAR_PROJECT_ID}/${GCP_GAR_REPO}/<>\"" >> $BASH_ENV source $BASH_ENV - docker tag <>:<> $GAR_IMAGE:$GAR_TAG - docker tag <>:<> $GAR_IMAGE:latest + docker tag <> $GAR_IMAGE:$GAR_TAG + docker tag <> $GAR_IMAGE:latest # push-image parameters: # https://circleci.com/developer/orbs/orb/circleci/gcp-gcr#commands-push-image - gcp-gcr/push-image: @@ -549,7 +549,9 @@ workflows: tags: only: /.*/ branches: - only: master + only: + - master + - RRM-181 - deploy-to-gar: name: deploy-autoendpoint-gar @@ -563,7 +565,9 @@ workflows: tags: only: /.*/ branches: - only: master + only: + - master + - RRM-181 - deploy-load-test: requires: From 26169ea50fb343c846cedb044e3bf7187f6f173b Mon Sep 17 00:00:00 2001 From: Eric Maydeck Date: Wed, 4 Sep 2024 16:24:19 -0600 Subject: [PATCH 2/9] test: added debug scenario to conditionals --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 162ada09a..c520160ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -441,6 +441,8 @@ jobs: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then echo 'export GAR_TAG=master' >> $BASH_ENV + elif [ "${CIRCLE_BRANCH}" == "RRM-181" ]; then + echo 'export GAR_TAG=debug' >> $BASH_ENV elif [ ! -z "${CIRCLE_TAG}" ]; then echo "export GAR_TAG=$CIRCLE_TAG" >> $BASH_ENV fi From f551d303dd7ba9f8c590caa34abb91eb061482bb Mon Sep 17 00:00:00 2001 From: Eric Maydeck Date: Wed, 4 Sep 2024 16:26:44 -0600 Subject: [PATCH 3/9] test: try testing only the tag and push portions of the workflow --- .circleci/config.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c520160ed..d82c22c3d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -542,11 +542,11 @@ workflows: - deploy-to-gar: name: deploy-autoconnect-gar image: autoconnect - requires: - - build-autoconnect - - Integration Tests - - Rust Unit Tests - - Rust Formatting Check + #requires: + # - build-autoconnect + # - Integration Tests + # - Rust Unit Tests + # - Rust Formatting Check filters: tags: only: /.*/ @@ -558,11 +558,11 @@ workflows: - deploy-to-gar: name: deploy-autoendpoint-gar image: autoendpoint - requires: - - build-autoendpoint - - Integration Tests - - Rust Unit Tests - - Rust Formatting Check + #requires: + # - build-autoendpoint + # - Integration Tests + # - Rust Unit Tests + # - Rust Formatting Check filters: tags: only: /.*/ From 8d428d8526ab17d1fac6000f3dfb5fce3cf68776 Mon Sep 17 00:00:00 2001 From: Eric Maydeck Date: Wed, 4 Sep 2024 16:41:10 -0600 Subject: [PATCH 4/9] fix: pulling image from cache now --- .circleci/config.yml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d82c22c3d..dc38853ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -436,6 +436,11 @@ jobs: use_oidc: true workload_identity_pool_id: GCP_OIDC_WIP_ID workload_identity_pool_provider_id: GCP_OIDC_WIP_PROVIDER_ID + - attach_workspace: + at: /cache + - run: + name: Restore Docker image cache + command: docker load -i /cache/docker.tar - run: name: Tag image command: | @@ -448,8 +453,8 @@ jobs: fi echo "export GAR_IMAGE=\"<>/${GCP_GAR_PROJECT_ID}/${GCP_GAR_REPO}/<>\"" >> $BASH_ENV source $BASH_ENV - docker tag <> $GAR_IMAGE:$GAR_TAG - docker tag <> $GAR_IMAGE:latest + docker tag <>:build $GAR_IMAGE:$GAR_TAG + docker tag <>:build $GAR_IMAGE:latest # push-image parameters: # https://circleci.com/developer/orbs/orb/circleci/gcp-gcr#commands-push-image - gcp-gcr/push-image: @@ -542,11 +547,11 @@ workflows: - deploy-to-gar: name: deploy-autoconnect-gar image: autoconnect - #requires: - # - build-autoconnect - # - Integration Tests - # - Rust Unit Tests - # - Rust Formatting Check + requires: + - build-autoconnect + - Integration Tests + - Rust Unit Tests + - Rust Formatting Check filters: tags: only: /.*/ @@ -558,11 +563,11 @@ workflows: - deploy-to-gar: name: deploy-autoendpoint-gar image: autoendpoint - #requires: - # - build-autoendpoint - # - Integration Tests - # - Rust Unit Tests - # - Rust Formatting Check + requires: + - build-autoendpoint + - Integration Tests + - Rust Unit Tests + - Rust Formatting Check filters: tags: only: /.*/ From 72e8204e2b054eec238b5ea09becd40d95b33f2e Mon Sep 17 00:00:00 2001 From: Eric Maydeck Date: Wed, 4 Sep 2024 17:12:52 -0600 Subject: [PATCH 5/9] test: try using /tmp/cache mount point --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dc38853ed..e7b056980 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -328,9 +328,9 @@ jobs: # required since Workflows do not have the same remote docker instance. - run: name: docker save <> - command: mkdir -p /cache; docker save -o /cache/docker.tar "<>" + command: mkdir -p /tmp/cache; docker save -o /tmp/cache/docker.tar "<>" - persist_to_workspace: - root: /cache + root: /tmp/cache paths: - docker.tar @@ -369,10 +369,10 @@ jobs: - setup_remote_docker - docker_login - attach_workspace: - at: /cache + at: /tmp/cache - run: name: Restore Docker image cache - command: docker load -i /cache/docker.tar + command: docker load -i /tmp/cache/docker.tar - run: name: Deploy to Dockerhub command: | @@ -437,10 +437,10 @@ jobs: workload_identity_pool_id: GCP_OIDC_WIP_ID workload_identity_pool_provider_id: GCP_OIDC_WIP_PROVIDER_ID - attach_workspace: - at: /cache + at: /tmp/cache - run: name: Restore Docker image cache - command: docker load -i /cache/docker.tar + command: docker load -i /tmp/cache/docker.tar - run: name: Tag image command: | From f350f26424f9325f6add1a056128648e38097554 Mon Sep 17 00:00:00 2001 From: Eric Maydeck Date: Wed, 4 Sep 2024 17:14:40 -0600 Subject: [PATCH 6/9] test: only use /tmp in gar jobs --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e7b056980..1568e1730 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -328,9 +328,9 @@ jobs: # required since Workflows do not have the same remote docker instance. - run: name: docker save <> - command: mkdir -p /tmp/cache; docker save -o /tmp/cache/docker.tar "<>" + command: mkdir -p /cache; docker save -o /cache/docker.tar "<>" - persist_to_workspace: - root: /tmp/cache + root: /cache paths: - docker.tar @@ -369,10 +369,10 @@ jobs: - setup_remote_docker - docker_login - attach_workspace: - at: /tmp/cache + at: /cache - run: name: Restore Docker image cache - command: docker load -i /tmp/cache/docker.tar + command: docker load -i /cache/docker.tar - run: name: Deploy to Dockerhub command: | From 93c227b6836fe191baec3aeaca46a9aee9332fec Mon Sep 17 00:00:00 2001 From: Eric Maydeck Date: Wed, 4 Sep 2024 17:32:52 -0600 Subject: [PATCH 7/9] test: trying a different image name when pushing --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1568e1730..530a2ddb5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -458,7 +458,7 @@ jobs: # push-image parameters: # https://circleci.com/developer/orbs/orb/circleci/gcp-gcr#commands-push-image - gcp-gcr/push-image: - image: $GAR_IMAGE + image: "${GCP_GAR_REPO}/<>" google-project-id: GCP_GAR_PROJECT_ID registry-url: <> tag: $GAR_TAG,latest From 94e9a0db50701eba8e38d6febb0cb78b0f205c3a Mon Sep 17 00:00:00 2001 From: Eric Maydeck Date: Wed, 4 Sep 2024 17:50:40 -0600 Subject: [PATCH 8/9] chore: remove debug items in gar workflows --- .circleci/config.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 530a2ddb5..87562f4de 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -446,8 +446,6 @@ jobs: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then echo 'export GAR_TAG=master' >> $BASH_ENV - elif [ "${CIRCLE_BRANCH}" == "RRM-181" ]; then - echo 'export GAR_TAG=debug' >> $BASH_ENV elif [ ! -z "${CIRCLE_TAG}" ]; then echo "export GAR_TAG=$CIRCLE_TAG" >> $BASH_ENV fi @@ -556,9 +554,7 @@ workflows: tags: only: /.*/ branches: - only: - - master - - RRM-181 + only: master - deploy-to-gar: name: deploy-autoendpoint-gar @@ -572,9 +568,7 @@ workflows: tags: only: /.*/ branches: - only: - - master - - RRM-181 + only: master - deploy-load-test: requires: From 2c3633a0946075b6ecd6a0aab68ba122ef0e2df8 Mon Sep 17 00:00:00 2001 From: Eric Maydeck Date: Wed, 4 Sep 2024 17:53:10 -0600 Subject: [PATCH 9/9] chore: use param name instead of hardcoding "build" --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 87562f4de..9d2722da4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -451,8 +451,8 @@ jobs: fi echo "export GAR_IMAGE=\"<>/${GCP_GAR_PROJECT_ID}/${GCP_GAR_REPO}/<>\"" >> $BASH_ENV source $BASH_ENV - docker tag <>:build $GAR_IMAGE:$GAR_TAG - docker tag <>:build $GAR_IMAGE:latest + docker tag <>:<> $GAR_IMAGE:$GAR_TAG + docker tag <>:<> $GAR_IMAGE:latest # push-image parameters: # https://circleci.com/developer/orbs/orb/circleci/gcp-gcr#commands-push-image - gcp-gcr/push-image: