From 9d0b87d9ee49ea904138a94f644e6eceb33145f4 Mon Sep 17 00:00:00 2001 From: gustavderdrache Date: Wed, 28 Feb 2024 16:12:54 -0500 Subject: [PATCH 1/3] EPAD8-2370: Switch metrics container to use latest AWS CLI --- services/metrics/Dockerfile | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/services/metrics/Dockerfile b/services/metrics/Dockerfile index 083616547e..e7336e1d59 100644 --- a/services/metrics/Dockerfile +++ b/services/metrics/Dockerfile @@ -1,6 +1,25 @@ -FROM alpine:latest +FROM debian:stable-slim -RUN apk add --no-cache aws-cli curl jq +RUN set -ex \ + # 1. Install packages needed for this container + && apt-get update \ + && apt-get install --yes --no-install-recommends \ + ca-certificates \ + curl \ + jq \ + unzip \ + # 2. Download and install the latest AWS CLI + && cd /tmp \ + && curl -fsSL https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip \ + && unzip awscliv2.zip \ + && ./aws/install \ + # 3. Clean up the CLI installer files + && rm -rf ./aws awscliv2.zip \ + # 4. Remove unneeded packages by marking them as automatic and letting the + # 'autoremove' command do its thing + && apt-mark auto unzip \ + && apt-get autoremove --purge --yes \ + && rm -rf /var/apt/lists/* COPY transform.jq /etc/transform.jq COPY entrypoint.sh /bin/entrypoint.sh From 348a3c46a5058c2a378b0302c70066b4440b2c23 Mon Sep 17 00:00:00 2001 From: gustavderdrache Date: Mon, 4 Mar 2024 10:36:21 -0500 Subject: [PATCH 2/3] EPAD8-2370: Work around Kaniko issue --- .buildkite/feature.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.buildkite/feature.yml b/.buildkite/feature.yml index d69b90e9e4..28b9b442b5 100644 --- a/.buildkite/feature.yml +++ b/.buildkite/feature.yml @@ -117,25 +117,12 @@ steps: concurrency_group: $BUILDKITE_PIPELINE_SLUG/build-$BUILDKITE_BRANCH concurrency: 4 + commands: docker build services/metrics + plugins: - cultureamp/aws-assume-role#v0.1.0: role: arn:aws:iam::316981092358:role/BuildkiteRoleForImageBuilds - - docker#v3.12.0: - image: gcr.io/kaniko-project/executor:debug - workdir: /workspace - - propagate-aws-auth-tokens: true - - entrypoint: /bin/sh - command: - - -ec - - | - echo '{"credsStore":"ecr-login"}' >/kaniko/.docker/config.json - /kaniko/executor \ - --context=/workspace/services/metrics \ - --no-push - # Perform a Terraform formatting check. See the terraform-fmt.sh script for more details # on what is executed in this step. - label: ":terraform: Formatting" From 3ef42157eb24948f2a251d4a32c27034b5569e76 Mon Sep 17 00:00:00 2001 From: gustavderdrache Date: Mon, 4 Mar 2024 10:49:30 -0500 Subject: [PATCH 3/3] EPAD8-2370: Work around Kaniko issue --- .buildkite/webcms.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.buildkite/webcms.yml b/.buildkite/webcms.yml index 2dfa7f7da2..e1cd08d807 100644 --- a/.buildkite/webcms.yml +++ b/.buildkite/webcms.yml @@ -80,25 +80,14 @@ steps: concurrency_group: $BUILDKITE_PIPELINE_SLUG/build-$BUILDKITE_BRANCH concurrency: 4 + commands: + - docker build services/metrics --tag "${WEBCMS_REPO_URL}/webcms-${WEBCMS_ENVIRONMENT}-${WEBCMS_SITE}-fpm-metrics:${WEBCMS_IMAGE_TAG}" + - docker push "${WEBCMS_REPO_URL}/webcms-${WEBCMS_ENVIRONMENT}-${WEBCMS_SITE}-fpm-metrics:${WEBCMS_IMAGE_TAG}" + plugins: - cultureamp/aws-assume-role#v0.1.0: role: arn:aws:iam::316981092358:role/BuildkiteRoleForImageBuilds - - docker#v3.12.0: - image: gcr.io/kaniko-project/executor:debug - workdir: /workspace - - propagate-aws-auth-tokens: true - - entrypoint: /bin/sh - command: - - -ec - - | - echo '{"credsStore":"ecr-login"}' >/kaniko/.docker/config.json - /kaniko/executor \ - --context=/workspace/services/metrics \ - --destination="${WEBCMS_REPO_URL}/webcms-${WEBCMS_ENVIRONMENT}-${WEBCMS_SITE}-fpm-metrics:${WEBCMS_IMAGE_TAG}" - - wait: ~ - label: ":terraform: WebCMS (${WEBCMS_SITE}-en)"