Skip to content

[build] Bazel build for su-exec - #15204

Merged
htuch merged 1 commit into
envoyproxy:mainfrom
arkodg:bazel-su-exec
Mar 5, 2021
Merged

htuch merged 1 commit into
envoyproxy:mainfrom
arkodg:bazel-su-exec

Conversation

@arkodg

@arkodg arkodg commented Feb 26, 2021

Copy link
Copy Markdown
Contributor

Relates to #14454

Signed-off-by: Arko Dasgupta [email protected]

Risk Level: Medium
Testing: Manual + CI

@repokitteh-read-only

Copy link
Copy Markdown

Hi @arkodg, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #15204 was opened by arkodg.

see: more, trace.

@repokitteh-read-only repokitteh-read-only Bot added the deps Approval required for changes to Envoy's external dependencies label Feb 26, 2021
@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).

🐱

Caused by: #15204 was opened by arkodg.

see: more, trace.

@arkodg

arkodg commented Feb 26, 2021

Copy link
Copy Markdown
Contributor Author

ptal @lizan @htuch
new to Bazel, unsure what's the best way & place to trigger the su-exec build, explicitly calling a bazel build do_ci.sh for now

@htuch

htuch commented Feb 26, 2021

Copy link
Copy Markdown
Member

@htuch

htuch commented Mar 2, 2021

Copy link
Copy Markdown
Member

@arkodg as pointed out to me by @alyssawilk this isn't actually a new dep, it's already in the Docker image. I'm not sure what advantage we gain by building it under Bazel though, since its only relevance is for use inside the Docker image?

@lizan

lizan commented Mar 2, 2021

Copy link
Copy Markdown
Member

@htuch The flakiness comes from wget in the Dockerfile which executed multiple times in multiarch build and not cached. So this address that by building and caching it with Bazel.

Comment thread ci/Dockerfile-envoy-alpine Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

dont we want to continue using the apk version for the alpine build ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

my bad, I forgot to add

ADD ${TARGETPLATFORM}/build_release/su-exec /usr/local/bin/

to this file to keep things consistent, let me do that right away

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

or do you prefer that I just let this be the way it was ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

personally - i think better the way it was.

we only added it in the other container image because it wasnt available in the distro

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sg, will revert this portion

@moderation moderation left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question re: bumping alpine image version to resolve CVE

Comment thread ci/Dockerfile-envoy-alpine Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

While we are modifying this file, would you be open to bumping the Alpine version to FROM hfrolvlad/alpine-glibc/alpine-3.13_glibc-2.32 to close out #14869. /cc @sagarkal. Or would you rather I raise a separate PR @htuch

@htuch htuch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm still a little uncomfortable adding general tooling into repository_locations.bzl. Can we split this into some other file and still build under Bazel? If we keep it where it is, at the very least please add a detailed comment explaining that this is not a part of the Envoy binary or tests, but is just used as part of our Docker image builds.

@arkodg

arkodg commented Mar 2, 2021

Copy link
Copy Markdown
Contributor Author

@htuch sure will add comments stating why the bazel rules were added for su-exec
also, is there a cleaner way to trigger the build for su-exec, rather than explicitly doing it
in the do_ci.sh script

@htuch

htuch commented Mar 2, 2021

Copy link
Copy Markdown
Member

I don't see anything cleaner than what you have right now. SG.

htuch
htuch previously approved these changes Mar 3, 2021

@htuch htuch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm deps

@repokitteh-read-only repokitteh-read-only Bot removed the deps Approval required for changes to Envoy's external dependencies label Mar 3, 2021
@htuch

htuch commented Mar 3, 2021

Copy link
Copy Markdown
Member

@arkodg can you fix format?

@repokitteh-read-only repokitteh-read-only Bot added the deps Approval required for changes to Envoy's external dependencies label Mar 3, 2021
@arkodg

arkodg commented Mar 3, 2021 •

Copy link
Copy Markdown
Contributor Author

see a bunch of failures /test/extensions/quic_listeners/quiche/integration:quic_protocol_integration_test FAILED in 8 out of 10 in 30.5 probably unrelated to this change

@htuch

htuch commented Mar 4, 2021

Copy link
Copy Markdown
Member

@arkodg I reran the tests and still failing, can you merge main?

@arkodg

arkodg commented Mar 4, 2021

Copy link
Copy Markdown
Contributor Author

hit another unrelated issue which I don't see on my local Mac machine

#17 33.84 Error while loading /usr/local/sbin/dpkg-deb: No such file or directory
#17 33.84 dpkg: error processing archive /var/cache/apt/archives/ca-certificates_20210119~18.04.1_all.deb (--unpack):
#17 33.84  dpkg-deb --control subprocess returned error exit status 1
#17 33.84 Errors were encountered while processing:
#17 33.85  /var/cache/apt/archives/libssl1.1_1.1.1-1ubuntu2.1~18.04.8_arm64.deb
#17 33.85  /var/cache/apt/archives/openssl_1.1.1-1ubuntu2.1~18.04.8_arm64.deb
#17 33.85  /var/cache/apt/archives/ca-certificates_20210119~18.04.1_all.deb
#17 33.93 E: Sub-process /usr/bin/dpkg returned an error code (1)
#17 ERROR: executor failed running [/dev/.buildkit_qemu_emulator /bin/sh -c apt-get update && apt-get upgrade -y     && apt-get install --no-install-recommends -y ca-certificates     && apt-get autoremove -y && apt-get clean     && rm -rf /tmp/* /var/tmp/*     && rm -rf /var/lib/apt/lists/*]: exit code: 100
------
 > [linux/arm64 2/8] RUN apt-get update && apt-get upgrade -y     && apt-get install --no-install-recommends -y ca-certificates     && apt-get autoremove -y && apt-get clean     && rm -rf /tmp/* /var/tmp/*     && rm -rf /var/lib/apt/lists/*:
------
Dockerfile-envoy:8
--------------------
   7 |     
   8 | >>> RUN apt-get update && apt-get upgrade -y \
   9 | >>>     && apt-get install --no-install-recommends -y ca-certificates \
  10 | >>>     && apt-get autoremove -y && apt-get clean \
  11 | >>>     && rm -rf /tmp/* /var/tmp/* \
  12 | >>>     && rm -rf /var/lib/apt/lists/*
  13 |     
--------------------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/dev/.buildkit_qemu_emulator /bin/sh -c apt-get update && apt-get upgrade -y     && apt-get install --no-install-recommends -y ca-certificates     && apt-get autoremove -y && apt-get clean     && rm -rf /tmp/* /var/tmp/*     && rm -rf /var/lib/apt/lists/*]: exit code: 100
##[error]Bash exited with code '1'.

@lizan is this a known issue w multi-arch/buildx ?

@phlax

phlax commented Mar 4, 2021

Copy link
Copy Markdown
Member

@arkodg i think its a flake - you also need to merge main to get rid of some other ci issues

(better merge and push rather than rebase and force push once there are reviewers)

Relates to envoyproxy#14454

Signed-off-by: Arko Dasgupta <[email protected]>
@arkodg

arkodg commented Mar 4, 2021

Copy link
Copy Markdown
Contributor Author

thanks @phlax, rebased to main, squashed and pushed

@arkodg
arkodg requested a review from htuch March 5, 2021 00:25
@htuch

htuch commented Mar 5, 2021

Copy link
Copy Markdown
Member

/lgtm deps

@repokitteh-read-only repokitteh-read-only Bot removed the deps Approval required for changes to Envoy's external dependencies label Mar 5, 2021
@htuch
htuch merged commit 975b294 into envoyproxy:main Mar 5, 2021
arkodg pushed a commit to arkodg/envoy that referenced this pull request Mar 10, 2021
Hit this multiarch build issue on a seperate PR
envoyproxy#15204 (comment)

Fixes envoyproxy#14971

Most likely relates to docker/buildx#542

https://github.com/docker/buildx#building-multi-platform-images
recommends running `docker run --privileged --rm tonistiigi/binfmt
--install all` before setting up `buildx`

Signed-off-by: Arko Dasgupta <[email protected]>
mattklein123 pushed a commit that referenced this pull request Mar 11, 2021
Hit this multiarch build issue on a seperate PR
#15204 (comment)

Fixes #14971

Most likely relates to docker/buildx#542

https://github.com/docker/buildx#building-multi-platform-images
recommends running `docker run --privileged --rm tonistiigi/binfmt
--install all` before setting up `buildx`

Signed-off-by: Arko Dasgupta <[email protected]>
aunu53 pushed a commit to aunu53/envoy that referenced this pull request Mar 19, 2021
Hit this multiarch build issue on a seperate PR
envoyproxy#15204 (comment)

Fixes envoyproxy#14971

Most likely relates to docker/buildx#542

https://github.com/docker/buildx#building-multi-platform-images
recommends running `docker run --privileged --rm tonistiigi/binfmt
--install all` before setting up `buildx`

Signed-off-by: Arko Dasgupta <[email protected]>
Signed-off-by: Auni Ahsan <[email protected]>
mum4k pushed a commit to envoyproxy/envoy-perf that referenced this pull request Aug 17, 2021
)

While testing Salvo with Envoy v1.19.0, the docker image failed to build.  Closer examination showed it failed due to the addition of su-exec as a dependency in this [Envoy PR](envoyproxy/envoy#15204).

This change updates the build process to execute the appropriate target and stage the su-exec binary for the docker image generation.

Signed-off-by: abaptiste <[email protected]>
rexengineering pushed a commit to rexengineering/istio-envoy that referenced this pull request Oct 15, 2021
Hit this multiarch build issue on a seperate PR
envoyproxy/envoy#15204 (comment)

Fixes envoyproxy/envoy#14971

Most likely relates to docker/buildx#542

https://github.com/docker/buildx#building-multi-platform-images
recommends running `docker run --privileged --rm tonistiigi/binfmt
--install all` before setting up `buildx`

Signed-off-by: Arko Dasgupta <[email protected]>
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.

5 participants