fix: script and dockerfile for centos#154
Conversation
- gn has to be compiled to satisfy centos glibc requirements and to mitigate problems with the version of envoy's wasm/v8 dependency (ref: envoyproxy/envoy#15119) - prependend PATH env var in centos' dockerfile by /usr/local/bin which was missing before and which is path where bazel is present (ref: envoyproxy/envoy/#12535) - added installation of glibc-static and libstdc++-static ref: envoyproxy/envoy#18365 Signed-off-by: Bart Smykla <bartek@smykla.com>
b4a3623 to
93364f1
Compare
|
apologies for force-push, but I just removed the whitespace changes introduced by my IDE |
as it expects to have llvm+clang installed to compile Signed-off-by: Bart Smykla <bartek@smykla.com>
|
It looks like building ubuntu container failed but I haven't touched the code related this so I assume it's flake or it may be related with the expired let's encrypt ca root cert (It have bitten me yesterday) |
Signed-off-by: Bart Smykla <bartek@smykla.com>
it's actually unnecessary as it's already included and the problem was not with the order, but with PATH not being preserved, when run `run_envoy_docker.sh` script from envoyproxy/envoy/ci Signed-off-by: Bart Smykla <bartek@smykla.com>
As the PATH is not preserved from environment in some of the CI scripts, we have to use it like in ubuntu scripts, which means to just move the PATH wrom dockerfile to the script Signed-off-by: Bart Smykla <bartek@smykla.com>
|
|
||
| set -e | ||
|
|
||
| export PATH="/opt/rh/rh-git218/root/usr/bin:/opt/rh/devtoolset-7/root/usr/bin:/opt/llvm/bin:/usr/local/sbin:/usr/local/bin:${PATH}" |
There was a problem hiding this comment.
k, so i think i see the first problem - centos doesnt include /usr/local/... in its PATH
im wondering if its worth adding that in /etc/profile.d
There was a problem hiding this comment.
im not sure adding in build_container_centos.sh would resolve the problem as this script is only run when the image is created, not when the container is run
There was a problem hiding this comment.
that's why there is /usr/local/sbin:/usr/local/bin in this line
we can add it to /etc/profile.d I think
There was a problem hiding this comment.
I pushed the change and am testing it right now locally too
There was a problem hiding this comment.
ok, one moment as it's still building
There was a problem hiding this comment.
ive created a ~throwaway acc that we can use for further test runs
are you on envoy slack ?
There was a problem hiding this comment.
@phlax yes also bartsmykla, sorry for the delay, but had problems with my docker and it's still building...
There was a problem hiding this comment.
hmm, so the /etc/profile.d plan didnt quite work, im guessing its because the user is created with --no-create-home and /etc/profile doesnt get sourced - not sure exactly - will dig further tomorrow
There was a problem hiding this comment.
We had a similar issue on a build server, with RVM. The solution, because jenkins runs as a service, and not a login shell, was to add the call to ". /etc/profile.d/rvm.sh" ("." is an alias of "source") to the user's ".bash_profile". A similar fix might work here.
This reverts commit 46d091c. Signed-off-by: Bart Smykla <bartek@smykla.com>
Signed-off-by: Bart Smykla <bartek@smykla.com>
dbb5efe to
974f996
Compare
As when building container we also need updated PATH, I'm sourcing /etc/profile.d/profile_centos.sh at the beginning of the script Signed-off-by: Bart Smykla <bartek@smykla.com>
Signed-off-by: Bart Smykla <bartek@smykla.com>
Signed-off-by: Bart Smykla <bartek@smykla.com>
|
It might help to re-title/description this PR about CentOS 7 because I think the issue is about that (vs CentOS 8), right? |
|
FWIW I rebased this branch to Thanks for the fix! |
|
Many thanks for the work on this PR, we appreciate it - @acarlson0000 and myself have been able to take it, and have successfully built up to version 1.20.1 of envoy from source, with a few caveats, one being that we’re no way near experts in C and C++. We have been able to build it with When attempting to build with However, when moving to v1.21.0 with For info: Centos 7 uses the following header libraries (which provides the We have seen that there was a separate pull request in the main envoy project to use a relative import of the header, rather than explicitly from Can you let us know what the status of this PR is, whether it’s going to be merged and should we raise a separate issue for compiling v1.21 onwards? |
|
hi @robejfarr using the centos build image is not really supported or maintained, and is not tested in CI i had a look at this some time ago with @bartsmykla - it may be that this PR resolves some issues but afaict there is a lot that does not work with this build image, so im reluctant to put too much time into fixing it, or maintaining it moving forward. Im also not convinced that there is a need for a redhat build image at all - i dont think its needed for building redhat binaries or docker images etc. I believe at least, that the main build image should be usable to build for any linux distro - lib versions aside. |
|
Hi @phlax, thanks for the quick response. Think however this PR progresses and is then maintained it is much better to have the build information available with the relevant health warnings in the Envoy repositories so people can find the latest detail there, rather than searching the Internet. They could also see the plan for supported operating systems and understand how it is/is not being supported going forward. Perhaps you could then have core builds of Envoy and best endeavors from the community? Unless there is a fundamental problem and Envoy cannot run on CentOS 7 (can someone explain the detail if it cannot) we’re keen to keep this working until the end of its maintenance window in 2024 (or a bit earlier) and enable Envoy to assist with any OS migrations, rather than it being a complicated blocker for companies that run CentOS 7 and would like to use Envoy. Have also seen @howardjohn envoyproxy/envoy#19535, which indicates it might be able to resolve some of these build problems and standardise; was that what you were thinking about when you mentioned the above or something else? As you say post RHEL 7 variants hopefully this should all be simpler for a while... We’re happy to help out with our limited knowledge and update documentation etc. on where Envoy is with CentOS 7 and keep the docker build images available in some form. The last thing is that there is a problem with version 1.21 of Envoy (as noted above) and it will not currently compile on CentOS 7. We’d like to find a solution to that if possible. Understanding what is the best way to progress forward with that would be useful - am thinking of opening a different issue for that and keeping it separate from this PR? As noted in the comment above there seem some related movements to assist. |
|
i think my point is more this - we shouldnt need to maintain a build image for every distro we want to build for - we are currently putting together a build pipeline that uses bazel - so for the most part it is agnostic to the host platform (theoretically anyway) overall my thought is that this image is not just not working properly now, but has been in that state for some time, needs quite a bit of work to be useful (and not a maintainer headache), isnt tested anywhere and represents a large maintenance cost going forward. i also think it confuses users because they think - i want to use redhat so i need to use this image, so im not really clear what the benefits to keeping it are and only see the downsides |
|
My 2c on this, without much context: You don't really need a build script for every OS, you should get the same artifacts regardless of the underlying host. Except glibc. The host's glibc impacts the version require. So if I build on Ubuntu 20.04, I definitely cannot run the result on CentOS 7 since the glibc version is way too new. So there are two ways around this I know of:
|
|
Think everyone would be happier to be using a more modern and maintained build toolchain if we could. We want the latest Envoy to be able to be run on CentOS 7 until the end of its maintenance window if we can (yes it is old). If the build is replaced with something more bleeding edge, we're fine with that as hopefully it's easier to get changes and updates to it. The only problem we have (there may be others) with the current build is that it doesn't seem to work for Envoy version 1.21 onwards as noted above (the tcp.h issue). @howardjohn I see some of the tests are still failing in the zig cc PR. Did you manage to compile Envoy version 1.21 upwards for glibc 2.17 and run it on CentOS 7? If not we're happy to have a run at it over the next couple of weeks as it seems to have the necessary header details here https://github.com/ziglang/zig/blob/master/lib/libc/include/any-linux-any/linux/tcp.h and put any findings on that PR. |
|
i understand the (legacy) problem re glibc - not sure about the more recent issue, and not sure about the best way forward if the consensus is to land this on the basis that it is better than what we have now im happy to land, just concerned about the difficulty of effectively testing changes |
|
@phlax understand about the testing difficulty. From our side we think it's worth landing as you can still use the build container with this change. I'm happy to make a separate PR to add a readme around the centos container and the caveats that you can only use it up to specific Envoy builds currently. For the recent glibc issue 1.21 onwards am thinking we'll have a look at zig cc to see if it works and then probably raise another issue to see if anyone has some ideas on what we could do to fix it and then we could have a look at those. Similarly am open to other suggestions on how to resolve. |
phlax
left a comment
There was a problem hiding this comment.
ok, on the basis that the consensus pretty clearly is to land this, lgtm
thanks @bartsmykla - apologies for stalling on this
@robejfarr if you were able to provide more info on what does/not work that would defo be helpful
I would just encourage anyone commenting or lurking this thread to review any subsequent updates to the centos image, because i feel like we are climbing without ropes having no ci or end use cases to test against
[skip ci] fix: script and dockerfile for centos (#154) * fix: script and dockerfile for centos - gn has to be compiled to satisfy centos glibc requirements and to mitigate problems with the version of envoy's wasm/v8 dependency (ref: envoyproxy/envoy#15119) - prependend PATH env var in centos' dockerfile by /usr/local/bin which was missing before and which is path where bazel is present (ref: envoyproxy/envoy/#12535) - added installation of glibc-static and libstdc++-static ref: envoyproxy/envoy#18365 Signed-off-by: Bart Smykla <bartek@smykla.com> * boringssl/fips: move gn building down as it expects to have llvm+clang installed to compile Signed-off-by: Bart Smykla <bartek@smykla.com> * remove unnecessary whitespace changes Signed-off-by: Bart Smykla <bartek@smykla.com> * centos: remove unnecessary PATH alteration it's actually unnecessary as it's already included and the problem was not with the order, but with PATH not being preserved, when run `run_envoy_docker.sh` script from envoyproxy/envoy/ci Signed-off-by: Bart Smykla <bartek@smykla.com> * move PATH from container to build_container_centos As the PATH is not preserved from environment in some of the CI scripts, we have to use it like in ubuntu scripts, which means to just move the PATH wrom dockerfile to the script Signed-off-by: Bart Smykla <bartek@smykla.com> * Revert "move PATH from container to build_container_centos" This reverts commit 46d091c. Signed-off-by: Bart Smykla <bartek@smykla.com> * move centos PATH to /etc/profile.d file Signed-off-by: Bart Smykla <bartek@smykla.com> * source profile in build_container_centos.sh As when building container we also need updated PATH, I'm sourcing /etc/profile.d/profile_centos.sh at the beginning of the script Signed-off-by: Bart Smykla <bartek@smykla.com> * modify path in sudoers Signed-off-by: Bart Smykla <bartek@smykla.com> * remove duplication Signed-off-by: Bart Smykla <bartek@smykla.com>
[skip ci] Regenerate linux toolchains from 3f6b1b0 [skip ci] fix: script and dockerfile for centos (#154) * fix: script and dockerfile for centos - gn has to be compiled to satisfy centos glibc requirements and to mitigate problems with the version of envoy's wasm/v8 dependency (ref: envoyproxy/envoy#15119) - prependend PATH env var in centos' dockerfile by /usr/local/bin which was missing before and which is path where bazel is present (ref: envoyproxy/envoy/#12535) - added installation of glibc-static and libstdc++-static ref: envoyproxy/envoy#18365 Signed-off-by: Bart Smykla <bartek@smykla.com> * boringssl/fips: move gn building down as it expects to have llvm+clang installed to compile Signed-off-by: Bart Smykla <bartek@smykla.com> * remove unnecessary whitespace changes Signed-off-by: Bart Smykla <bartek@smykla.com> * centos: remove unnecessary PATH alteration it's actually unnecessary as it's already included and the problem was not with the order, but with PATH not being preserved, when run `run_envoy_docker.sh` script from envoyproxy/envoy/ci Signed-off-by: Bart Smykla <bartek@smykla.com> * move PATH from container to build_container_centos As the PATH is not preserved from environment in some of the CI scripts, we have to use it like in ubuntu scripts, which means to just move the PATH wrom dockerfile to the script Signed-off-by: Bart Smykla <bartek@smykla.com> * Revert "move PATH from container to build_container_centos" This reverts commit 46d091c. Signed-off-by: Bart Smykla <bartek@smykla.com> * move centos PATH to /etc/profile.d file Signed-off-by: Bart Smykla <bartek@smykla.com> * source profile in build_container_centos.sh As when building container we also need updated PATH, I'm sourcing /etc/profile.d/profile_centos.sh at the beginning of the script Signed-off-by: Bart Smykla <bartek@smykla.com> * modify path in sudoers Signed-off-by: Bart Smykla <bartek@smykla.com> * remove duplication Signed-off-by: Bart Smykla <bartek@smykla.com>
|
Is it possible to run envoy in Centos 7 after updates above? Any specific envoy version I can try? When I try to run latest envoy version I am still getting GLIBC_2.18 issue. |
Hi @tmiroslav - as an unofficial answer, Note: I work in the same team as @robejfarr, we've been trying to get a later version running with different build formats but haven't got anywhere sadly (but we're novices, and working things out as we go). |
to mitigate problems with the version of envoy's wasm/v8
dependency (ref: Got `GLIBC_2.18' not found error when using envoyproxy/envoy-build-centos envoy#15119)
ref: envoyproxy/envoy#18365