Skip to content

Commit 9fb760b

Browse files
committed
integ: re-building validator images for every test run is inefficient
Signed-off-by: Wesley Pettit <[email protected]>
1 parent f1cab92 commit 9fb760b

11 files changed

+46
-17
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- [Using the AWS Plugins outside of a container](#using-the-aws-plugins-outside-of-a-container)
2727
- [Running aws-for-fluent-bit Windows containers](#running-aws-for-fluent-bit-windows-containers)
2828
- [Development](#development)
29-
- [Releasing](#releasing)
29+
- [Local testing](#local-testing)
3030
- [Developing Features in the AWS Plugins](#developing-features-in-the-aws-plugins)
3131
- [Fluent Bit Examples](#fluent-bit-examples)
3232
- [License](#license)
@@ -326,12 +326,17 @@ For more details about running Fluent Bit Windows containers in Amazon ECS, plea
326326

327327
### Development
328328

329-
#### Releasing
329+
#### Local testing
330330

331331
Use `make release` to build the image.
332+
332333
To run the integration tests, run `make integ-dev`. The `make integ-dev` command will run the integration tests for all of our plugins-
333334
kinesis streams, kinesis firehose, and cloudwatch.
334335

336+
The integ tests require the following env vars to be set:
337+
* `CW_INTEG_VALIDATOR_IMAGE`: Build the [integ/validate_cloudwatch/](integ/validate_cloudwatch/) folder with `docker build` and set the resulting image as the value of this env var.
338+
* `S3_INTEG_VALIDATOR_IMAGE`: Build the [integ/s3/](integ/s3/) folder with `docker build` and set the resulting image as the value of this env var.
339+
335340
To run integration tests separately, execute `make integ-cloudwatch` or `make integ-kinesis` or `make integ-firehose`.
336341

337342
[Documentation on GitHub steps for releases](Release_Process.md).

buildspec_integ.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ phases:
1010
commands:
1111
# Enforce STS regional endpoints
1212
- export AWS_STS_REGIONAL_ENDPOINTS=regional
13+
- export CW_INTEG_VALIDATOR_IMAGE=${AWS_ACCOUNT}.dkr.ecr.us-west-2.amazonaws.com/cw-integ-validator:latest
14+
- export S3_INTEG_VALIDATOR_IMAGE=${AWS_ACCOUNT}.dkr.ecr.us-west-2.amazonaws.com/s3-integ-validator:latest
1315
# Get the default credentials and set as environment variables
1416
- 'CREDS=`curl 169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`'
1517
- 'export AWS_ACCESS_KEY_ID=`echo $CREDS | jq -r .AccessKeyId`'

integ/integ.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
export AWS_REGION="us-west-2"
33
export PROJECT_ROOT="$(pwd)"
44
export VOLUME_MOUNT_CONTAINER="/out"
5-
export ValidateS3Dockerfile="Dockerfile"
65

76
test_cloudwatch() {
87
export ARCHITECTURE=$(uname -m)

integ/run-integ.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ $env:FLUENT_BIT_IMAGE = $FluentBitImage
7575
$env:TAG = -join ((65..90) + (97..122) | Get-Random -Count 10 | % {[char]$_})
7676
# AWS_FOR_FLUENT_BIT_CONTAINER_NAME is the name for the fluent-bit container ran for each service.
7777
$env:AWS_FOR_FLUENT_BIT_CONTAINER_NAME = "aws-for-fluent-bit-$($env:TAG)"
78+
$env:CW_INTEG_VALIDATOR_IMAGE = "906394416424.dkr.ecr.us-west-2.amazonaws.com/cw-integ-validator:latest"
79+
$env:S3_INTEG_VALIDATOR_IMAGE = "906394416424.dkr.ecr.us-west-2.amazonaws.com/s3-integ-validator:latest"
7880

7981
# Windows specific settings.
8082
$env:ARCHITECTURE= "x86-64"
8183
$env:LOG_GROUP_NAME="fluent-bit-integ-test-$Platform-$env:ARCHITECTURE"
8284
$env:VOLUME_MOUNT_CONTAINER="C:/out"
83-
$env:ValidateS3Dockerfile = "Dockerfile.windows"
8485
# For Windows, we need to specify a static IP address for the fluent-bit container.
8586
# This is because fluent-bit container would be started first and then the other containers
8687
# would need to connect to the fluent-bit container over a TCP socket.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## CW Validator Image
2+
3+
The S3 Validator image exists in our account as:
4+
5+
```
6+
906394416424.dkr.ecr.us-west-2.amazonaws.com/s3-integ-validator:latest
7+
```
8+
9+
If we need to perform a change or dependency update, build the image and push it to the account with that name.
10+
11+
The image is set as an env var `S3_INTEG_VALIDATOR_IMAGE` in:
12+
- Linux: buildspec_integ.yml
13+
- Windows: integ/run-integ.ps1
14+
15+
The env var is used in the `docker-compose.validate-and-clean.yml` files for firehose, kinesis, and S3 tests.

integ/test_cloudwatch/docker-compose.validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "2"
22

33
services:
44
cloudwatch_validator:
5-
build: ${PROJECT_ROOT}/integ/validate_cloudwatch
5+
image: ${CW_INTEG_VALIDATOR_IMAGE}
66
environment:
77
- "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"
88
- "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}"

integ/test_firehose/docker-compose.validate-and-clean-s3.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ version: "2"
22

33
services:
44
validate-s3:
5-
build:
6-
context: ${PROJECT_ROOT}/integ/s3
7-
dockerfile: ${ValidateS3Dockerfile}
5+
image: ${S3_INTEG_VALIDATOR_IMAGE}
86
environment:
97
- "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"
108
- "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}"

integ/test_kinesis/docker-compose.validate-and-clean-s3.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ version: "2"
22

33
services:
44
validate-s3:
5-
build:
6-
context: ${PROJECT_ROOT}/integ/s3
7-
dockerfile: ${ValidateS3Dockerfile}
5+
image: ${S3_INTEG_VALIDATOR_IMAGE}
86
environment:
97
- "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"
108
- "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}"

integ/test_s3/docker-compose.validate-s3-multipart.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ version: "2"
22

33
services:
44
validate-s3-multipart:
5-
build:
6-
context: ${PROJECT_ROOT}/integ/s3
7-
dockerfile: ${ValidateS3Dockerfile}
5+
image: ${S3_INTEG_VALIDATOR_IMAGE}
86
environment:
97
- "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"
108
- "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}"

integ/test_s3/docker-compose.validate-s3-putobject.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ version: "2"
22

33
services:
44
validate-s3-put-object:
5-
build:
6-
context: ${PROJECT_ROOT}/integ/s3
7-
dockerfile: ${ValidateS3Dockerfile}
5+
image: ${S3_INTEG_VALIDATOR_IMAGE}
86
environment:
97
- "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"
108
- "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}"

0 commit comments

Comments
 (0)