From 69366b130a28e14c3c9548eabd69b499bb128c7b Mon Sep 17 00:00:00 2001 From: Wesley Pettit Date: Fri, 16 Jun 2023 14:49:20 -0700 Subject: [PATCH] integ: validator image must support different platforms, linux vs windows, arm vs amd Signed-off-by: Wesley Pettit --- buildspec_integ.yml | 4 ++-- integ/run-integ.ps1 | 4 ++-- integ/s3/updating_validator_image.md | 12 ++++++++---- integ/test_cloudwatch/docker-compose.validate.yml | 2 +- .../docker-compose.validate-and-clean-s3.yml | 2 +- .../docker-compose.validate-and-clean-s3.yml | 2 +- .../docker-compose.validate-s3-multipart.yml | 2 +- .../docker-compose.validate-s3-putobject.yml | 2 +- .../updating_validator_image.md | 14 +++++++++----- 9 files changed, 26 insertions(+), 18 deletions(-) diff --git a/buildspec_integ.yml b/buildspec_integ.yml index 8716a0d23..c0e26bfd7 100644 --- a/buildspec_integ.yml +++ b/buildspec_integ.yml @@ -10,8 +10,8 @@ phases: commands: # Enforce STS regional endpoints - export AWS_STS_REGIONAL_ENDPOINTS=regional - - export CW_INTEG_VALIDATOR_IMAGE=${AWS_ACCOUNT}.dkr.ecr.us-west-2.amazonaws.com/cw-integ-validator:latest - - export S3_INTEG_VALIDATOR_IMAGE=${AWS_ACCOUNT}.dkr.ecr.us-west-2.amazonaws.com/s3-integ-validator:latest + - export CW_INTEG_VALIDATOR_IMAGE=${AWS_ACCOUNT}.dkr.ecr.us-west-2.amazonaws.com/cw-integ-validator + - export S3_INTEG_VALIDATOR_IMAGE=${AWS_ACCOUNT}.dkr.ecr.us-west-2.amazonaws.com/s3-integ-validator # Get the default credentials and set as environment variables - 'CREDS=`curl 169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`' - 'export AWS_ACCESS_KEY_ID=`echo $CREDS | jq -r .AccessKeyId`' diff --git a/integ/run-integ.ps1 b/integ/run-integ.ps1 index dc77b355b..31094fd71 100644 --- a/integ/run-integ.ps1 +++ b/integ/run-integ.ps1 @@ -75,8 +75,8 @@ $env:FLUENT_BIT_IMAGE = $FluentBitImage $env:TAG = -join ((65..90) + (97..122) | Get-Random -Count 10 | % {[char]$_}) # AWS_FOR_FLUENT_BIT_CONTAINER_NAME is the name for the fluent-bit container ran for each service. $env:AWS_FOR_FLUENT_BIT_CONTAINER_NAME = "aws-for-fluent-bit-$($env:TAG)" -$env:CW_INTEG_VALIDATOR_IMAGE = "906394416424.dkr.ecr.us-west-2.amazonaws.com/cw-integ-validator:latest" -$env:S3_INTEG_VALIDATOR_IMAGE = "906394416424.dkr.ecr.us-west-2.amazonaws.com/s3-integ-validator:latest" +$env:CW_INTEG_VALIDATOR_IMAGE = "906394416424.dkr.ecr.us-west-2.amazonaws.com/cw-integ-validator-windows" +$env:S3_INTEG_VALIDATOR_IMAGE = "906394416424.dkr.ecr.us-west-2.amazonaws.com/s3-integ-validator-windows" # Windows specific settings. $env:ARCHITECTURE= "x86-64" diff --git a/integ/s3/updating_validator_image.md b/integ/s3/updating_validator_image.md index fdc6b58d6..a3c272539 100644 --- a/integ/s3/updating_validator_image.md +++ b/integ/s3/updating_validator_image.md @@ -1,15 +1,19 @@ -## CW Validator Image +## S3 Validator Image The S3 Validator image exists in our account as: ``` -906394416424.dkr.ecr.us-west-2.amazonaws.com/s3-integ-validator:latest +906394416424.dkr.ecr.us-west-2.amazonaws.com/s3-integ-validator:arm64 +906394416424.dkr.ecr.us-west-2.amazonaws.com/s3-integ-validator:x86_64 +906394416424.dkr.ecr.us-west-2.amazonaws.com/s3-integ-validator-windows:x86_64 ``` If we need to perform a change or dependency update, build the image and push it to the account with that name. -The image is set as an env var `S3_INTEG_VALIDATOR_IMAGE` in: +The base image URI is set as an env var `S3_INTEG_VALIDATOR_IMAGE` in: - Linux: buildspec_integ.yml -- Windows: integ/run-integ.ps1 +- Windows: run-integ.ps1 + +The tag is the value of `${ARCHITECTURE}` The env var is used in the `docker-compose.validate-and-clean.yml` files for firehose, kinesis, and S3 tests. diff --git a/integ/test_cloudwatch/docker-compose.validate.yml b/integ/test_cloudwatch/docker-compose.validate.yml index 2d032621f..64e673b5d 100644 --- a/integ/test_cloudwatch/docker-compose.validate.yml +++ b/integ/test_cloudwatch/docker-compose.validate.yml @@ -2,7 +2,7 @@ version: "2" services: cloudwatch_validator: - image: ${CW_INTEG_VALIDATOR_IMAGE} + image: ${CW_INTEG_VALIDATOR_IMAGE}:${ARCHITECTURE} environment: - "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" - "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" diff --git a/integ/test_firehose/docker-compose.validate-and-clean-s3.yml b/integ/test_firehose/docker-compose.validate-and-clean-s3.yml index 0674f67d5..8ce14e154 100644 --- a/integ/test_firehose/docker-compose.validate-and-clean-s3.yml +++ b/integ/test_firehose/docker-compose.validate-and-clean-s3.yml @@ -2,7 +2,7 @@ version: "2" services: validate-s3: - image: ${S3_INTEG_VALIDATOR_IMAGE} + image: ${S3_INTEG_VALIDATOR_IMAGE}:${ARCHITECTURE} environment: - "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" - "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" diff --git a/integ/test_kinesis/docker-compose.validate-and-clean-s3.yml b/integ/test_kinesis/docker-compose.validate-and-clean-s3.yml index 2753cdfa5..5cf92cf6b 100644 --- a/integ/test_kinesis/docker-compose.validate-and-clean-s3.yml +++ b/integ/test_kinesis/docker-compose.validate-and-clean-s3.yml @@ -2,7 +2,7 @@ version: "2" services: validate-s3: - image: ${S3_INTEG_VALIDATOR_IMAGE} + image: ${S3_INTEG_VALIDATOR_IMAGE}:${ARCHITECTURE} environment: - "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" - "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" diff --git a/integ/test_s3/docker-compose.validate-s3-multipart.yml b/integ/test_s3/docker-compose.validate-s3-multipart.yml index 06272f5b0..4503fe121 100644 --- a/integ/test_s3/docker-compose.validate-s3-multipart.yml +++ b/integ/test_s3/docker-compose.validate-s3-multipart.yml @@ -2,7 +2,7 @@ version: "2" services: validate-s3-multipart: - image: ${S3_INTEG_VALIDATOR_IMAGE} + image: ${S3_INTEG_VALIDATOR_IMAGE}:${ARCHITECTURE} environment: - "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" - "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" diff --git a/integ/test_s3/docker-compose.validate-s3-putobject.yml b/integ/test_s3/docker-compose.validate-s3-putobject.yml index 4783a9180..10331bb02 100644 --- a/integ/test_s3/docker-compose.validate-s3-putobject.yml +++ b/integ/test_s3/docker-compose.validate-s3-putobject.yml @@ -2,7 +2,7 @@ version: "2" services: validate-s3-put-object: - image: ${S3_INTEG_VALIDATOR_IMAGE} + image: ${S3_INTEG_VALIDATOR_IMAGE}:${ARCHITECTURE} environment: - "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" - "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" diff --git a/integ/validate_cloudwatch/updating_validator_image.md b/integ/validate_cloudwatch/updating_validator_image.md index 2b8cca13e..d66202969 100644 --- a/integ/validate_cloudwatch/updating_validator_image.md +++ b/integ/validate_cloudwatch/updating_validator_image.md @@ -3,13 +3,17 @@ The CW Validator image exists in our account as: ``` -906394416424.dkr.ecr.us-west-2.amazonaws.com/cw-integ-validator:latest +906394416424.dkr.ecr.us-west-2.amazonaws.com/cw-integ-validator:arm64 +906394416424.dkr.ecr.us-west-2.amazonaws.com/cw-integ-validator:x86_64 +906394416424.dkr.ecr.us-west-2.amazonaws.com/cw-integ-validator-windows:x86_64 ``` -If we need to perform a change or dependency update, build the image and push it to the account with that name. +If we need to perform a change or dependency update, build the image and push it to the account with that name. -The image is set as an env var `CW_INTEG_VALIDATOR_IMAGE` in: +The base image URI is set as an env var `CW_INTEG_VALIDATOR_IMAGE` in: - Linux: buildspec_integ.yml -- Windows: integ/run-integ.ps1 +- Windows: run-integ.ps1 -The env var is used in `integ/test_cloudwatch/docker-compose.validate.yml`. +The tag is the value of `${ARCHITECTURE}` + +The env var is used in the `docker-compose.validate-and-clean.yml` files for firehose, kinesis, and S3 tests.