Skip to content
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 7 commits into from
Jul 30, 2020

Conversation

Jingzhao123
Copy link
Contributor

@Jingzhao123 Jingzhao123 commented Jun 30, 2020

In this patch, it will enable the envoyproxy/envoy arm image to build
in community arm CI environments.

  1. Do some modifications in docker_ci.sh script for building arm images by buildx. It will firstly set up environments. Then use the
    buildx tool to build the envoyproxy/envoy arm images on x86 platform.
  2. Modify the docker build job for building multi-arch images. It will firstly download the arm64 and amd64 envoy binaries. Then
    invoke the docker_ci.sh scripts to generate images.

Signed-off-by: Jingzhao Jingzhao.Ni@arm.com

For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
In this PR, we enable the envoyproxy/envoy arm64 image on Envoy CI system.

  1. For envoyproxy/envoy arm64 images, envoy-alpine, envoy-alpine-debug and envoy-google-vrp still do not support on Arm64 platform since some technical reasons. Only the envoyproxy/envoy is enabled on CI system.
  2. In this PR, the buildx tool was used for building multi-arch images on x86 platform.
  3. In addition, the display name of building images job is modified from "Linux-x64 docker" to "Linux multi-arch docker".

[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]

ci/docker_ci.sh Outdated Show resolved Hide resolved
displayName: "Linux-arm64 docker"
dependsOn: ["release_arm64"]
condition: and(succeeded(), eq(variables['PostSubmit'], 'true'), ne(variables['Build.Reason'], 'PullRequest'))
pool: "arm-large"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this in existing docker job with multiarch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, lizan
Yes, we can. And the buildx tool could make code more clean. But, the build image by qemu may be a little bit slow, i don't know whether there is enough time to do this. So I choose to build it on the arm environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is your opinion about it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm leaning to do it with buildx, I don't think you'll face any issue, we just do base image + putting binary in it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sound good! I will cancel this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I update this patch by buildx tool.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Could you please give some comments @lizan

@lizan lizan added the waiting label Jun 30, 2020
@Jingzhao123 Jingzhao123 force-pushed the EnableArmImageBuild branch 6 times, most recently from d8442d8 to 00dc595 Compare July 13, 2020 08:57
@@ -31,9 +31,16 @@ RUN adduser --group --system envoy

RUN mkdir -p /etc/envoy

ADD build_release_stripped/envoy /usr/local/bin/envoy
ADD arm64/build_release_stripped/envoy /usr/local/bin/envoy-arm64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effectively you put everything in the image here, i.e. making the image big, doing rm later doesn't remove the binary form docker layers. Can this actually just be a build-arg?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has updated. Please check it.

@@ -1,4 +1,41 @@
FROM envoyproxy/envoy:local
ARG BUILD_FROM=ubuntu:18.04
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this change? you don't really need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Lizan
The envoy-google-vrp is based on envoyproxy/envoy:local image. But when building envoy-google-vrp by buildx, I found that the buildx can not find the envoyproxy/envoy:local image which was just built by buildx. The envoyproxy/envoy:local image does not exist in docker images list.
If we export envoyproxy/envoy:local by command "docker buildx build -o type=docker ", buildx still can not access that image. Although "docker build" could access envoyproxy/envoy:local image.
So, I think, if we replace based image by source dockerfile, the build script may be simpler than before. At same time, for envoy-google-vrp image, it could be more dependent. And it also does not extend the building time since it will use the image cache which was built before.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will defer this part to @htuch

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seem plausible. FWIW, I don't think we need VRP for ARM, but if you'd like to cleanup the build flow while retaining the same semantics (i.e. have the equivalent of envoyproxy/envoy latest state based on the current tree as the base) then that's great.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lizan Have updated. Please check it.

Jingzhao added 2 commits July 24, 2020 06:10
In this patch, it will enable the envoyproxy/envoy arm image to build
in community arm CI environments.
1. Do some modifications in docker_ci.sh script for building arm images
   by buildx. It will firstly set up environments. Then use the buildx
   tool to build the envoyproxy/envoy arm images on x86 platform.
2. Modify the docker build job for building multi-arch images.
   It will firstly download the arm64 and amd64 envoy binaries. Then
   invoke the docker_ci.sh scripts to generate images.

Signed-off-by: Jingzhao <Jingzhao.Ni@arm.com>
1. Update building scripts
2. Update dockerfiles for building arm64 images

Signed-off-by: Jingzhao.Ni <Jingzhao.Ni@arm.com>
.azure-pipelines/pipelines.yml Outdated Show resolved Hide resolved
Signed-off-by: Jingzhao.Ni <Jingzhao.Ni@arm.com>
- bash: |
set -e
tar zxf $(Build.StagingDirectory)/bazel.release/envoy_binary.tar.gz
mkdir -p linux/amd64 && tar zxf $(Build.StagingDirectory)/bazel.release/envoy_binary.tar.gz -C ./linux/amd64
mkdir -p linux/arm64 && tar zxf $(Build.StagingDirectory)/bazel.release.server_only.arm64/envoy_binary.tar.gz -C ./linux/arm64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bazel.release instead of bazel.release.server_only.

Signed-off-by: Jingzhao.Ni <Jingzhao.Ni@arm.com>
Copy link
Member

@lizan lizan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this LGTM. I triggered a post-submit job based on this:
https://dev.azure.com/cncf/envoy/_build/results?buildId=46427&view=results

If this succeeds we can merge with fixing the nit. If no let's address it.

ci/docker_ci.sh Outdated
done


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove this extra line.

Signed-off-by: Jingzhao.Ni <Jingzhao.Ni@arm.com>
@lizan
Copy link
Member

lizan commented Jul 29, 2020

@Jingzhao123 one last thing, can you add a release note? Thanks.

@Jingzhao123
Copy link
Contributor Author

@Jingzhao123 one last thing, can you add a release note? Thanks.

Does the release note describe what does the PR do? Or others?

@Jingzhao123
Copy link
Contributor Author

@Jingzhao123 one last thing, can you add a release note? Thanks.

Does the release note describe what does the PR do? Or others?

Has updated. Please check it.

@lizan
Copy link
Member

lizan commented Jul 30, 2020

Jingzhao.Ni added 2 commits July 30, 2020 10:22
Signed-off-by: Jingzhao.Ni <Jingzhao.Ni@arm.com>
Signed-off-by: Jingzhao.Ni <Jingzhao.Ni@arm.com>
@lizan lizan merged commit 9d70da7 into envoyproxy:master Jul 30, 2020
@mattklein123
Copy link
Member

@Jingzhao123 @lizan would it be possible to document the ARM images that we offer here? https://www.envoyproxy.io/docs/envoy/latest/install/building#pre-built-binaries

It's not completely clear to me whether these show up in different repos, are a single multi-arch image, how a user consumes them, etc. Thank you!

@Jingzhao123 Jingzhao123 deleted the EnableArmImageBuild branch July 31, 2020 03:24
chaoqin-li1123 pushed a commit to chaoqin-li1123/envoy that referenced this pull request Aug 7, 2020
In this patch, it will enable the envoyproxy/envoy arm image to build
in community arm CI environments.
1. Do some modifications in docker_ci.sh script for building arm images
   by buildx. It will firstly set up environments. Then use the buildx
   tool to build the envoyproxy/envoy arm images on x86 platform.
2. Modify the docker build job for building multi-arch images.
   It will firstly download the arm64 and amd64 envoy binaries. Then
   invoke the docker_ci.sh scripts to generate images.

Risk Level: Medium (of breaking images)
Testing: CI
Docs Changes: N/A
Release Notes: Added
Fixes envoyproxy#1861 

Signed-off-by: Jingzhao.Ni <Jingzhao.Ni@arm.com>
chaoqin-li1123 pushed a commit to chaoqin-li1123/envoy that referenced this pull request Aug 7, 2020
In this patch, it will enable the envoyproxy/envoy arm image to build
in community arm CI environments.
1. Do some modifications in docker_ci.sh script for building arm images
   by buildx. It will firstly set up environments. Then use the buildx
   tool to build the envoyproxy/envoy arm images on x86 platform.
2. Modify the docker build job for building multi-arch images.
   It will firstly download the arm64 and amd64 envoy binaries. Then
   invoke the docker_ci.sh scripts to generate images.

Risk Level: Medium (of breaking images)
Testing: CI
Docs Changes: N/A
Release Notes: Added
Fixes envoyproxy#1861

Signed-off-by: Jingzhao.Ni <Jingzhao.Ni@arm.com>
Signed-off-by: chaoqinli <chaoqinli@google.com>
chaoqin-li1123 pushed a commit to chaoqin-li1123/envoy that referenced this pull request Aug 7, 2020
In this patch, it will enable the envoyproxy/envoy arm image to build
in community arm CI environments.
1. Do some modifications in docker_ci.sh script for building arm images
   by buildx. It will firstly set up environments. Then use the buildx
   tool to build the envoyproxy/envoy arm images on x86 platform.
2. Modify the docker build job for building multi-arch images.
   It will firstly download the arm64 and amd64 envoy binaries. Then
   invoke the docker_ci.sh scripts to generate images.

Risk Level: Medium (of breaking images)
Testing: CI
Docs Changes: N/A
Release Notes: Added
Fixes envoyproxy#1861

Signed-off-by: Jingzhao.Ni <Jingzhao.Ni@arm.com>
Signed-off-by: chaoqinli <chaoqinli@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants