Skip to content

Commit e568423

Browse files
Revert "Support for ARM64 build"
This reverts commit 28b23f6.
1 parent 28b23f6 commit e568423

File tree

10 files changed

+44
-132
lines changed

10 files changed

+44
-132
lines changed

buildspec.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,9 @@ phases:
1414
# List the docker images
1515
- docker images
1616

17-
# Push the image to ECR with corresponding architecture as the tag.
18-
- aws ecr get-login-password --region ${AWS_REGION}| docker login --username AWS --password-stdin ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com
19-
- aws ecr create-repository --repository-name amazon/aws-for-fluent-bit-test --image-scanning-configuration scanOnPush=true --region ${AWS_REGION} || true
20-
- architecture=$(docker inspect --format='{{.Architecture}}' amazon/aws-for-fluent-bit)
21-
- docker tag amazon/aws-for-fluent-bit:latest ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:$architecture
22-
- docker push ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:$architecture
23-
24-
# Create manifest list
25-
- export DOCKER_CLI_EXPERIMENTAL=enabled
26-
- docker manifest create ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:latest ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:arm64 ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:amd64 || true
27-
- docker manifest annotate --arch arm64 ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:latest ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:arm64 || true
28-
- docker manifest annotate --arch amd64 ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:latest ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:amd64 || true
29-
30-
# Sanity check for the debug log
31-
- docker manifest inspect ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:latest || true
32-
33-
# Push manifest list
34-
- docker manifest push ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:latest || true
17+
# Push the image to ECR in the same account and same region the pipeline is hosted.
18+
- docker tag amazon/aws-for-fluent-bit:latest amazon/aws-for-fluent-bit-test:latest
19+
- ecs-cli push amazon/aws-for-fluent-bit-test:latest
3520
artifacts:
3621
files:
37-
- '**/*'
22+
- '**/*'

buildspec_integ.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ phases:
1515
- 'export AWS_SESSION_TOKEN=`echo $CREDS | jq -r .Token`'
1616

1717
# Pull the image that we built and pushed in the `Build` stage
18-
- aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com
19-
- docker pull ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:latest
20-
- docker tag ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test amazon/aws-for-fluent-bit:latest
21-
22-
# List the images to do a double check
23-
- docker images
18+
- 'ecs-cli pull amazon/aws-for-fluent-bit-test:latest'
19+
- 'docker tag ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:latest amazon/aws-for-fluent-bit:latest'
2420

25-
# Command to run the integration test
26-
- make integ
21+
# List the images to do a double check
22+
- 'docker images'
23+
24+
# Command to run the integration test
25+
- 'make integ'
2726
artifacts:
2827
files:
2928
- '**/*'

buildspec_publish_dockerhub.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ phases:
99
build:
1010
commands:
1111
# Pull the image that we built and pushed in the `Build` stage
12-
- aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com
13-
- docker pull ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:"amd64"
14-
- docker pull ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:"arm64"
15-
- docker tag ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:amd64 amazon/aws-for-fluent-bit:amd64
16-
- docker tag ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:arm64 amazon/aws-for-fluent-bit:arm64
12+
- 'ecs-cli pull amazon/aws-for-fluent-bit-test:latest'
13+
- 'docker tag ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:latest amazon/aws-for-fluent-bit:latest'
1714

1815
# List the docker images
1916
- docker images

buildspec_publish_ecr.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ phases:
99
build:
1010
commands:
1111
# Pull the image that we built and pushed in the `Build` stage
12-
- aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com
13-
- docker pull ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:"amd64"
14-
- docker pull ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:"arm64"
15-
12+
- 'ecs-cli pull amazon/aws-for-fluent-bit-test:latest'
13+
- 'docker tag ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:latest amazon/aws-for-fluent-bit:latest'
14+
1615
# List the docker images
1716
- docker images
1817

integ/integ.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ export AWS_REGION="us-west-2"
33
export PROJECT_ROOT="$(pwd)"
44

55
test_cloudwatch() {
6-
export ARCHITECTURE=$(uname -m)
7-
export LOG_GROUP_NAME="fluent-bit-integ-test-${ARCHITECTURE}"
6+
export LOG_GROUP_NAME="fluent-bit-integ-test"
87
# Tag is used to name the log stream; each test run has a unique (random) log stream name
98
export TAG=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 10)
109
docker-compose --file ./integ/test_cloudwatch/docker-compose.test.yml build
1110
docker-compose --file ./integ/test_cloudwatch/docker-compose.test.yml up --abort-on-container-exit
12-
sleep 120
11+
sleep 10
1312

1413
# Creates a file as a flag for the validation failure
1514
mkdir -p ./integ/out
@@ -21,7 +20,7 @@ test_cloudwatch() {
2120
}
2221

2322
clean_cloudwatch() {
24-
export LOG_GROUP_NAME="fluent-bit-integ-test-${ARCHITECTURE}"
23+
export LOG_GROUP_NAME="fluent-bit-integ-test"
2524
# Clean up resources that were created in the test
2625
docker-compose --file ./integ/test_cloudwatch/docker-compose.clean.yml build
2726
docker-compose --file ./integ/test_cloudwatch/docker-compose.clean.yml up --abort-on-container-exit
@@ -82,6 +81,7 @@ test_firehose() {
8281
clean_s3() {
8382
validate_or_clean_s3 clean
8483
}
84+
8585
if [ "${1}" = "cloudwatch" ]; then
8686
export PLUGIN_UNDER_TEST="cloudwatch"
8787
test_cloudwatch
@@ -163,4 +163,4 @@ fi
163163

164164
if [ "${1}" = "delete" ]; then
165165
source ./integ/resources/delete_test_resources.sh
166-
fi
166+
fi
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#!/bin/bash
22

33
# Deploys the CloudFormation template to create the stack and necessary resources- kinesis data stream, s3 bucket, and kinesis firehose delivery stream
4-
# Resource (stream, s3, delivery stream) names will start with the stack name followed by the corresponding architecture. "integ-test-fluent-bit-architecture"
5-
ARCHITECTURE=$(uname -m)
6-
if [ ARCHITECTURE=="x86_64" ]
7-
then
8-
ARCHITECTURE="x86-64"
9-
fi
10-
aws cloudformation deploy --template-file ./integ/resources/cfn-kinesis-s3-firehose.yml --stack-name integ-test-fluent-bit-${ARCHITECTURE} --region us-west-2 --capabilities CAPABILITY_NAMED_IAM
4+
# Resource (stream, s3, delivery stream) names will start with the stack name "integ-test-fluent-bit"
5+
aws cloudformation deploy --template-file ./integ/resources/cfn-kinesis-s3-firehose.yml --stack-name integ-test-fluent-bit --region us-west-2 --capabilities CAPABILITY_NAMED_IAM
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
# Delete the CloudFormation stack which created all the resources for running the integration test
2-
ARCHITECTURE=$(uname -m)
3-
if [ ARCHITECTURE=="x86_64" ]
4-
then
5-
ARCHITECTURE="x86-64"
6-
fi
7-
aws cloudformation delete-stack --stack-name integ-test-fluent-bit-${ARCHITECTURE}
2+
aws cloudformation delete-stack --stack-name integ-test-fluent-bit

integ/resources/setup_test_environment.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
#!/bin/bash
22

33
# Using CloudFormation describe-stacks extracts the output values for kinesis stream and s3 bucket name, and sets them as environment variables
4-
ARCHITECTURE=$(uname -m)
5-
if [ ARCHITECTURE=="x86_64" ]
6-
then
7-
ARCHITECTURE="x86-64"
8-
fi
9-
stackOutputs=$(aws cloudformation describe-stacks --stack-name integ-test-fluent-bit-${ARCHITECTURE} --output text --query 'Stacks[0].Outputs[*].OutputValue')
4+
stackOutputs=$(aws cloudformation describe-stacks --stack-name integ-test-fluent-bit --output text --query 'Stacks[0].Outputs[*].OutputValue')
105
read -r -a outputArray <<< "$stackOutputs"
116
export FIREHOSE_STREAM="${outputArray[0]}"
127
export KINESIS_STREAM="${outputArray[1]}"

integ/validate_cloudwatch/validator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
client = boto3.client('logs', region_name=os.environ.get('AWS_REGION'))
1010
metrics_client = boto3.client("cloudwatch", region_name=os.environ["AWS_REGION"])
11-
start_time = datetime.utcnow() - timedelta(seconds=600)
11+
start_time = datetime.utcnow() - timedelta(seconds=60)
1212
end_time = datetime.utcnow()
1313

1414
LOG_GROUP_NAME = os.environ.get('LOG_GROUP_NAME')
@@ -55,7 +55,7 @@ def validate_metric(test_name, metric_namespace, dim_key, dim_value, expected_sa
5555
return True
5656
attempts += 1
5757
print(f"No metrics yet. Sleeping before trying again. Attempt # {attempts}")
58-
time.sleep(10)
58+
time.sleep(2)
5959

6060
sys.exit('TEST_FAILURE: failed to validate metric existence in CloudWatch')
6161

@@ -102,4 +102,4 @@ def get_expected_metric_name():
102102

103103
if success_case_1 and success_case_2 and success_case_emf:
104104
# if this file is still present, integ script will mark the test as a failure
105-
os.remove("/out/cloudwatch-test")
105+
os.remove("/out/cloudwatch-test")

scripts/publish.sh

Lines changed: 16 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,8 @@ gamma_account_id="626332813196"
7373

7474
DOCKER_HUB_SECRET="com.amazonaws.dockerhub.aws-for-fluent-bit.credentials"
7575

76-
ARCHITECTURES=("amd64" "arm64")
77-
7876
publish_to_docker_hub() {
7977
DRY_RUN="${DRY_RUN:-true}"
80-
export DOCKER_CLI_EXPERIMENTAL=enabled
8178

8279
username="$(aws secretsmanager get-secret-value --secret-id $DOCKER_HUB_SECRET --region us-west-2 | jq -r '.SecretString | fromjson.username')"
8380
password="$(aws secretsmanager get-secret-value --secret-id $DOCKER_HUB_SECRET --region us-west-2 | jq -r '.SecretString | fromjson.password')"
@@ -93,23 +90,13 @@ publish_to_docker_hub() {
9390

9491
# Publish to DockerHub only if $DRY_RUN is set to false
9592
if [[ "${DRY_RUN}" == "false" ]]; then
96-
for arch in "${ARCHITECTURES[@]}"
97-
do
98-
docker tag ${1}:"$arch" ${1}:"${arch}"-${AWS_FOR_FLUENT_BIT_VERSION}
99-
docker push ${1}:"$arch"-${AWS_FOR_FLUENT_BIT_VERSION}
100-
done
101-
102-
create_manifest_list ${1} "latest"
103-
create_manifest_list ${1} ${AWS_FOR_FLUENT_BIT_VERSION}
104-
93+
docker tag ${1} ${2}
94+
docker push ${1}
95+
docker push ${2}
10596
else
106-
for arch in "${ARCHITECTURES[@]}"
107-
do
108-
echo "DRY_RUN: docker tag ${1}:${arch} ${1}:${arch}-${AWS_FOR_FLUENT_BIT_VERSION}"
109-
echo "DRY_RUN: docker push ${1}:${arch}-${AWS_FOR_FLUENT_BIT_VERSION}"
110-
done
111-
echo "DRY_RUN: create manifest list ${1}:latest"
112-
echo "DRY_RUN: create manifest list ${1}:${AWS_FOR_FLUENT_BIT_VERSION}"
97+
echo "DRY_RUN: docker tag ${1} ${2}"
98+
echo "DRY_RUN: docker push ${1}"
99+
echo "DRY_RUN: docker push ${2}"
113100
echo "DRY_RUN is NOT set to 'false', skipping DockerHub update. Exiting..."
114101
fi
115102

@@ -186,41 +173,11 @@ verify_ssm() {
186173
fi
187174
}
188175

189-
create_manifest_list() {
190-
191-
export DOCKER_CLI_EXPERIMENTAL=enabled
192-
tag=${2}
193-
194-
# TODO: Add a way to automatically generate arch images in manifest
195-
docker manifest create ${1}:${tag} \
196-
${1}:arm64-${AWS_FOR_FLUENT_BIT_VERSION} \
197-
${1}:amd64-${AWS_FOR_FLUENT_BIT_VERSION}
198-
199-
for arch in "${ARCHITECTURES[@]}"
200-
do
201-
docker manifest annotate --arch "$arch" \
202-
${1}:${tag} \
203-
${1}:"$arch"-${AWS_FOR_FLUENT_BIT_VERSION}
204-
done
205-
206-
# sanity check on the debug log.
207-
docker manifest inspect ${1}:${tag}
208-
docker manifest push ${1}:${tag}
209-
}
210-
211-
push_image_ecr() {
212-
account_id=${1}
213-
region=${2}
214-
215-
for arch in "${ARCHITECTURES[@]}"
216-
do
217-
docker tag ${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/amazon/aws-for-fluent-bit-test:"$arch" \
218-
${account_id}.dkr.ecr.${region}.amazonaws.com/aws-for-fluent-bit:"$arch"-${AWS_FOR_FLUENT_BIT_VERSION}
219-
docker push ${account_id}.dkr.ecr.${region}.amazonaws.com/aws-for-fluent-bit:"$arch"-${AWS_FOR_FLUENT_BIT_VERSION}
220-
done
176+
push_to_ecr() {
177+
docker tag ${1} ${2}
178+
ecs-cli push ${2} --region ${3} --registry-id ${4}
221179
}
222180

223-
# TODO: remove dependency on ecs-cli
224181
pull_ecr() {
225182
ecs-cli pull ${1} --region ${2}
226183
}
@@ -232,17 +189,8 @@ make_repo_public() {
232189
publish_ecr() {
233190
region=${1}
234191
account_id=${2}
235-
echo $region
236-
echo $account_id
237-
238-
aws ecr get-login-password --region ${region}| docker login --username AWS --password-stdin ${account_id}.dkr.ecr.${region}.amazonaws.com
239-
aws ecr create-repository --repository-name aws-for-fluent-bit --image-scanning-configuration scanOnPush=true --region ${region} || true
240-
241-
push_image_ecr ${account_id} ${region}
242-
243-
create_manifest_list ${account_id}.dkr.ecr.${region}.amazonaws.com/aws-for-fluent-bit ${AWS_FOR_FLUENT_BIT_VERSION}
244-
create_manifest_list ${account_id}.dkr.ecr.${region}.amazonaws.com/aws-for-fluent-bit "latest"
245-
192+
push_to_ecr amazon/aws-for-fluent-bit:latest aws-for-fluent-bit:latest ${region} ${account_id}
193+
push_to_ecr amazon/aws-for-fluent-bit:latest "aws-for-fluent-bit:${AWS_FOR_FLUENT_BIT_VERSION}" ${region} ${account_id}
246194
make_repo_public ${region}
247195
}
248196

@@ -256,15 +204,14 @@ verify_ecr() {
256204
endpoint=${endpoint}.cn
257205
fi
258206

259-
aws ecr get-login-password --region ${region} | docker login --username AWS --password-stdin ${account_id}.dkr.ecr.${region}.amazonaws.com
260-
docker pull ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:latest
207+
pull_ecr ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:latest ${region}
261208
sha1=$(docker inspect --format='{{index .RepoDigests 0}}' ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:latest)
262209

263210
if [ "${is_sync_task}" = "true" ]; then
264211
pull_ecr ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:${AWS_FOR_FLUENT_BIT_VERSION_DOCKERHUB} ${region}
265212
sha2=$(docker inspect --format='{{index .RepoDigests 0}}' ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:${AWS_FOR_FLUENT_BIT_VERSION_DOCKERHUB})
266213
else
267-
docker pull ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:${AWS_FOR_FLUENT_BIT_VERSION}
214+
pull_ecr ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:${AWS_FOR_FLUENT_BIT_VERSION} ${region}
268215
sha2=$(docker inspect --format='{{index .RepoDigests 0}}' ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:${AWS_FOR_FLUENT_BIT_VERSION})
269216
fi
270217

@@ -312,7 +259,7 @@ match_two_sha() {
312259

313260
if [ "${1}" = "publish" ]; then
314261
if [ "${2}" = "dockerhub" ]; then
315-
publish_to_docker_hub amazon/aws-for-fluent-bit
262+
publish_to_docker_hub amazon/aws-for-fluent-bit:latest amazon/aws-for-fluent-bit:${AWS_FOR_FLUENT_BIT_VERSION}
316263
fi
317264

318265
if [ "${2}" = "aws" ]; then
@@ -470,7 +417,7 @@ fi
470417
# Following scripts will be called only from the CI/CD pipeline
471418
if [ "${1}" = "cicd-publish" ]; then
472419
if [ "${2}" = "dockerhub" ]; then
473-
publish_to_docker_hub amazon/aws-for-fluent-bit
420+
publish_to_docker_hub amazon/aws-for-fluent-bit:latest amazon/aws-for-fluent-bit:${AWS_FOR_FLUENT_BIT_VERSION}
474421
elif [ "${2}" = "us-gov-east-1" ] || [ "${2}" = "us-gov-west-1" ]; then
475422
for region in ${gov_regions}; do
476423
sync_latest_image ${region} ${gov_regions_account_id}
@@ -549,4 +496,4 @@ if [ "${1}" = "cicd-verify-ssm" ]; then
549496
verify_ssm ${region}
550497
done
551498
fi
552-
fi
499+
fi

0 commit comments

Comments
 (0)