-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release init images WITH stable tag #395
Open
Galaoaoa
wants to merge
1
commit into
aws:mainline
Choose a base branch
from
Galaoaoa:ygloa-pipeline-with-stable
base: mainline
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,6 +122,17 @@ publish_to_docker_hub() { | |
if [ "$IMAGE_SHA_MATCHED" = "FALSE" ]; then | ||
create_manifest_list ${1} "stable" ${AWS_FOR_FLUENT_BIT_STABLE_VERSION} | ||
fi | ||
|
||
docker pull ${1}:"$init"-stable || echo "0" | ||
sha1_init=$(docker inspect --format='{{index .RepoDigests 0}}' ${1}:"$init"-stable || echo "0") | ||
docker pull ${1}:"$init"-${AWS_FOR_FLUENT_BIT_STABLE_VERSION} | ||
sha2_init=$(docker inspect --format='{{index .RepoDigests 0}}' ${1}:"$init"-${AWS_FOR_FLUENT_BIT_STABLE_VERSION}) | ||
|
||
match_two_sha $sha1_init $sha2_init | ||
|
||
if [ "$IMAGE_SHA_MATCHED" = "FALSE" ]; then | ||
create_manifest_list_init ${1} ""$init"-stable" ${AWS_FOR_FLUENT_BIT_STABLE_VERSION} | ||
fi | ||
else | ||
for arch in "${ARCHITECTURES[@]}" | ||
do | ||
|
@@ -155,6 +166,18 @@ publish_to_public_ecr() { | |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/aws-observability | ||
create_manifest_list public.ecr.aws/aws-observability/aws-for-fluent-bit "stable" ${AWS_FOR_FLUENT_BIT_STABLE_VERSION} | ||
fi | ||
|
||
docker pull public.ecr.aws/aws-observability/aws-for-fluent-bit:"$init"-stable || echo "0" | ||
sha1_init=$(docker inspect --format='{{index .RepoDigests 0}}' public.ecr.aws/aws-observability/aws-for-fluent-bit:"$init"-stable || echo "0") | ||
docker pull public.ecr.aws/aws-observability/aws-for-fluent-bit:"$init"-${AWS_FOR_FLUENT_BIT_STABLE_VERSION} | ||
sha2_init=$(docker inspect --format='{{index .RepoDigests 0}}' public.ecr.aws/aws-observability/aws-for-fluent-bit:"$init"-${AWS_FOR_FLUENT_BIT_STABLE_VERSION}) | ||
|
||
match_two_sha $sha1_init $sha2_init | ||
|
||
if [ "$IMAGE_SHA_MATCHED" = "FALSE" ]; then | ||
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/aws-observability | ||
create_manifest_list_init public.ecr.aws/aws-observability/aws-for-fluent-bit "$init"-"stable" ${AWS_FOR_FLUENT_BIT_STABLE_VERSION} | ||
fi | ||
else | ||
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/aws-observability | ||
|
||
|
@@ -197,6 +220,10 @@ publish_stable_ssm() { | |
aws ssm put-parameter --name /aws/service/aws-for-fluent-bit/stable --overwrite \ | ||
--description 'Regional Amazon ECR Image URI for the latest stable AWS for Fluent Bit Docker Image' \ | ||
--type String --region ${1} --value ${2}:${3} | ||
|
||
aws ssm put-parameter --name /aws/service/aws-for-fluent-bit/"$init"stable --overwrite \ | ||
--description 'Regional Amazon ECR Image URI for the latest stable AWS for Fluent Bit Docker Image with Init Process' \ | ||
--type String --region ${1} --value ${2}:${3} | ||
} | ||
|
||
rollback_ssm() { | ||
|
@@ -217,18 +244,16 @@ check_parameter() { | |
repo_uri=$(sed -e 's/^"//' -e 's/"$//' <<<"$repo_uri") | ||
docker pull $repo_uri | ||
|
||
if [ "${2}" != "stable"]; then | ||
repo_uri_init=$(aws ssm get-parameter --name /aws/service/aws-for-fluent-bit/"$init"-${2} --region ${1} --query 'Parameter.Value') | ||
IFS='.' read -r -a array <<<"$repo_uri_init" | ||
region="${array[3]}" | ||
if [ "${1}" != "${region}" ]; then | ||
echo "${1}: Region found in repo URI does not match SSM Parameter region: ${repo_uri}" | ||
exit 1 | ||
fi | ||
# remove leading and trailing quotes from repo_uri | ||
repo_uri_init=$(sed -e 's/^"//' -e 's/"$//' <<<"$repo_uri") | ||
docker pull $repo_uri_init | ||
repo_uri_init=$(aws ssm get-parameter --name /aws/service/aws-for-fluent-bit/"$init"-${2} --region ${1} --query 'Parameter.Value') | ||
IFS='.' read -r -a array <<<"$repo_uri_init" | ||
region="${array[3]}" | ||
if [ "${1}" != "${region}" ]; then | ||
echo "${1}: Region found in repo URI does not match SSM Parameter region: ${repo_uri}" | ||
exit 1 | ||
fi | ||
# remove leading and trailing quotes from repo_uri | ||
repo_uri_init=$(sed -e 's/^"//' -e 's/"$//' <<<"$repo_uri") | ||
docker pull $repo_uri_init | ||
} | ||
|
||
sync_latest_image() { | ||
|
@@ -302,6 +327,8 @@ sync_latest_image() { | |
fi | ||
create_manifest_list ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit "stable" ${AWS_FOR_FLUENT_BIT_STABLE_VERSION} || echo "0" | ||
|
||
create_manifest_list_init ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit "init-stable" ${AWS_FOR_FLUENT_BIT_STABLE_VERSION} || echo "0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code has changed: #571 (comment) |
||
|
||
make_repo_public ${region} | ||
|
||
ssm_parameters=$(aws ssm get-parameters --names "/aws/service/aws-for-fluent-bit/${AWS_FOR_FLUENT_BIT_VERSION_DOCKERHUB}" --region ${region}) | ||
|
@@ -437,6 +464,14 @@ verify_ecr() { | |
docker pull ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:${AWS_FOR_FLUENT_BIT_VERSION_DOCKERHUB} | ||
sha1=$(docker inspect --format='{{index .RepoDigests 0}}' ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:${AWS_FOR_FLUENT_BIT_VERSION_DOCKERHUB}) | ||
|
||
|
||
docker pull ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:"$init"-stable || echo "0" | ||
stableSha1_init=$(docker inspect --format='{{index .RepoDigests 0}}' ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:"$init"-stable || echo "0") | ||
docker pull ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:"$init"-${AWS_FOR_FLUENT_BIT_STABLE_VERSION} || echo "0" | ||
stableSha2_init=$(docker inspect --format='{{index .RepoDigests 0}}' ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:"$init"-${AWS_FOR_FLUENT_BIT_STABLE_VERSION} || echo "0") | ||
|
||
verify_sha $stableSha1_init $stableSha2_init | ||
|
||
docker pull ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:"$init"-${AWS_FOR_FLUENT_BIT_VERSION_DOCKERHUB} | ||
sha1_init=$(docker inspect --format='{{index .RepoDigests 0}}' ${account_id}.dkr.ecr.${region}.${endpoint}/aws-for-fluent-bit:"$init"-${AWS_FOR_FLUENT_BIT_VERSION_DOCKERHUB}) | ||
else | ||
|
@@ -503,6 +538,13 @@ verify_dockerhub() { | |
sha2=$(docker inspect --format='{{index .RepoDigests 0}}' amazon/aws-for-fluent-bit:${AWS_FOR_FLUENT_BIT_STABLE_VERSION}) | ||
|
||
verify_sha $sha1 $sha2 | ||
|
||
docker pull amazon/aws-for-fluent-bit:"$init"-stable | ||
sha1_init=$(docker inspect --format='{{index .RepoDigests 0}}' amazon/aws-for-fluent-bit:"$init"-stable) | ||
docker pull amazon/aws-for-fluent-bit:"$init"-${AWS_FOR_FLUENT_BIT_STABLE_VERSION} | ||
sha2_init=$(docker inspect --format='{{index .RepoDigests 0}}' amazon/aws-for-fluent-bit:"$init"-${AWS_FOR_FLUENT_BIT_STABLE_VERSION}) | ||
|
||
verify_sha $sha1_init $sha2_init | ||
else | ||
# Get the image SHA's | ||
docker pull amazon/aws-for-fluent-bit:latest | ||
|
@@ -532,6 +574,13 @@ verify_public_ecr() { | |
sha2=$(docker inspect --format='{{index .RepoDigests 0}}' public.ecr.aws/aws-observability/aws-for-fluent-bit:${AWS_FOR_FLUENT_BIT_STABLE_VERSION}) | ||
|
||
verify_sha $sha1 $sha2 | ||
|
||
docker pull public.ecr.aws/aws-observability/aws-for-fluent-bit:"$init"-stable | ||
sha1_init=$(docker inspect --format='{{index .RepoDigests 0}}' public.ecr.aws/aws-observability/aws-for-fluent-bit:"$init"-stable) | ||
docker pull public.ecr.aws/aws-observability/aws-for-fluent-bit:"$init"-${AWS_FOR_FLUENT_BIT_STABLE_VERSION} | ||
sha2_init=$(docker inspect --format='{{index .RepoDigests 0}}' public.ecr.aws/aws-observability/aws-for-fluent-bit:"$init"-${AWS_FOR_FLUENT_BIT_STABLE_VERSION}) | ||
|
||
verify_sha $sha1_init $sha2_init | ||
else | ||
# Get the image SHA's | ||
docker pull public.ecr.aws/aws-observability/aws-for-fluent-bit:latest | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm either I didn't notice this before or I no longer remember why its
:"$init"-stable
shouldn't it just beinit-stable
...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, let me recall...
I think I did this because we need to put different suffixes after "init" other than "stable".
Like here and here.
And sometimes we need to use "init stable" rather than "init-stable" like here.
Due to the different code styles and parameter passing way in this file so I chose not to hard code "init".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Galaoaoa for showing strong ownership and continuing to track this PR :)
Hmm but I don't understand why we need the
"$init"
... theinit
part never changes right? Its the bit afterwards. So I'd expect to see:init-${var}
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we can use init instead of "$init". From the current perspective, I think we could indeed just use the init, this would be the better way :)