-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Enable envoy images build on Arm CI environments #11813
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0629816
Enable envoy images build on Arm CI environments
0d668ef
Update building script and dockerfile for arm64
a3f1a65
Fix artifactName name in docker build job
aadb8aa
Remove "server_only" wrong label in pipeline file
87774ec
Remove the extra line.
10bdf32
Add comments in current release notes
54aa26a
Modify order of new items
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
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
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
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
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 |
---|---|---|
|
@@ -4,18 +4,62 @@ | |
# CI logs. | ||
set -e | ||
|
||
# Setting environments for buildx tools | ||
config_env(){ | ||
# Qemu configurations | ||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
|
||
# Remove older build instance | ||
docker buildx rm multi-builder | true | ||
docker buildx create --use --name multi-builder --platform linux/arm64,linux/amd64 | ||
} | ||
|
||
build_images(){ | ||
TYPE=$1 | ||
BUILD_TAG=$2 | ||
|
||
# Only build/push envoyproxy/envoy multi-arch images since others still do not support. | ||
if [ -z "${TYPE}" ]; then | ||
docker buildx build --platform linux/arm64 -f ci/Dockerfile-envoy"${TYPE}" -t ${BUILD_TAG} . | ||
# Export envoyproxy/envoy amd64 image which will be used for building envoyproxy/envoy-google-vrp | ||
docker buildx build --platform linux/amd64 -f ci/Dockerfile-envoy"${TYPE}" -o type=docker -t ${BUILD_TAG} . | ||
elif [ "${TYPE}" == "-google-vrp" ]; then | ||
# The envoyproxy/envoy-google-vrp is based on envoyproxy/envoy image. So it is built from cache envoyproxy/envoy:local | ||
docker build -f ci/Dockerfile-envoy"${TYPE}" --cache-from "${DOCKER_IMAGE_PREFIX}:local" -t ${BUILD_TAG} . | ||
else | ||
docker build -f ci/Dockerfile-envoy"${TYPE}" -t ${BUILD_TAG} . | ||
fi | ||
} | ||
|
||
push_images(){ | ||
TYPE=$1 | ||
BUILD_TAG=$2 | ||
|
||
if [ -z "${TYPE}" ]; then | ||
# Only push envoyproxy/envoy multi-arch images since others still do not support. | ||
docker buildx build --platform linux/arm64,linux/amd64 --push -f ci/Dockerfile-envoy"${TYPE}" -t ${BUILD_TAG} . | ||
else | ||
docker tag "${DOCKER_IMAGE_PREFIX}${TYPE}:local" ${BUILD_TAG} | ||
docker push ${BUILD_TAG} | ||
fi | ||
} | ||
|
||
# This prefix is altered for the private security images on setec builds. | ||
DOCKER_IMAGE_PREFIX="${DOCKER_IMAGE_PREFIX:-envoyproxy/envoy}" | ||
|
||
# "-google-vrp" must come afer "" to ensure we rebuild the local base image dependency. | ||
BUILD_TYPES=("" "-alpine" "-alpine-debug" "-google-vrp") | ||
|
||
# Configure docker-buildx tools | ||
config_env | ||
|
||
# Test the docker build in all cases, but use a local tag that we will overwrite before push in the | ||
# cases where we do push. | ||
for BUILD_TYPE in "${BUILD_TYPES[@]}"; do | ||
docker build -f ci/Dockerfile-envoy"${BUILD_TYPE}" -t "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}:local" . | ||
build_images "${BUILD_TYPE}" "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}:local" | ||
done | ||
|
||
|
||
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. nit: remove this extra line. |
||
MASTER_BRANCH="refs/heads/master" | ||
RELEASE_BRANCH_REGEX="^refs/heads/release/v.*" | ||
RELEASE_TAG_REGEX="^refs/tags/v.*" | ||
|
@@ -42,21 +86,16 @@ fi | |
docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_PASSWORD" | ||
|
||
for BUILD_TYPE in "${BUILD_TYPES[@]}"; do | ||
docker tag "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}:local" "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}${IMAGE_POSTFIX}:${IMAGE_NAME}" | ||
docker push "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}${IMAGE_POSTFIX}:${IMAGE_NAME}" | ||
push_images "${BUILD_TYPE}" "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}${IMAGE_POSTFIX}:${IMAGE_NAME}" | ||
|
||
# Only push latest on master builds. | ||
if [[ "${AZP_BRANCH}" == "${MASTER_BRANCH}" ]]; then | ||
docker tag "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}:local" "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}${IMAGE_POSTFIX}:latest" | ||
docker push "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}${IMAGE_POSTFIX}:latest" | ||
push_images "${BUILD_TYPE}" "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}${IMAGE_POSTFIX}:latest" | ||
fi | ||
|
||
# Push vX.Y-latest to tag the latest image in a release line | ||
if [[ "${AZP_BRANCH}" =~ ${RELEASE_TAG_REGEX} ]]; then | ||
RELEASE_LINE=$(echo "$IMAGE_NAME" | sed -E 's/(v[0-9]+\.[0-9]+)\.[0-9]+/\1-latest/') | ||
docker tag "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}:local" "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}${IMAGE_POSTFIX}:${RELEASE_LINE}" | ||
docker push "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}${IMAGE_POSTFIX}:${RELEASE_LINE}" | ||
push_images "${BUILD_TYPE}" "${DOCKER_IMAGE_PREFIX}${BUILD_TYPE}${IMAGE_POSTFIX}:${RELEASE_LINE}" | ||
fi | ||
done | ||
|
||
|
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.
bazel.release
instead ofbazel.release.server_only
.