[fix] EXPERIMENT: Switch docker base image to avoid mixing musl & glibc libraries at runtime#23366
Closed
lhotari wants to merge 1 commit intoapache:masterfrom
Closed
[fix] EXPERIMENT: Switch docker base image to avoid mixing musl & glibc libraries at runtime#23366lhotari wants to merge 1 commit intoapache:masterfrom
lhotari wants to merge 1 commit intoapache:masterfrom
Conversation
nodece
reviewed
Sep 28, 2024
15 tasks
Member
Author
|
It looks like test image building fails due to missing supervisor package. It is available also with pip install: http://supervisord.org/installing.html |
8cc60d3 to
a42afb9
Compare
Member
Author
supervisor has been installed, but there is some remaining issue. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23366 +/- ##
============================================
+ Coverage 73.57% 74.57% +0.99%
- Complexity 32624 33962 +1338
============================================
Files 1877 1934 +57
Lines 139502 145132 +5630
Branches 15299 15870 +571
============================================
+ Hits 102638 108231 +5593
+ Misses 28908 28604 -304
- Partials 7956 8297 +341
Flags with carried forward coverage won't be shown. Click here to find out more. |
… at runtime Mixing musl & glibc libraries at runtime will result in compatibility issues. We need a solution with real glibc because of compatibility reasons. The previous solution with the Alpine base image has a critical issue since it mixes musl compiled and glibc compiled libraries at runtime while using real glibc. This is why the switch is needed. For example, snappy-java and Conscrypt show that this problem occurs.
f6498f5 to
6599366
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
While testing Pulsar 4.0.0-preview.1, some compatibility issues with the Alpine base image have shown up.
It appears that the solution in the base image is something that will cause further compatibility issues. Mixing musl and glibc at runtime is known to cause compatibility and stability issues.
https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24647#note_176723 states it clearly:
"Combining glibc and musl runtimes is basically all but guaranteed to create an unstable environment, unless the system is appropriately configured (glibc side uses glibc binaries only, and vice versa)."
https://github.com/sgerrand/alpine-pkg-glibc/issues/194#issuecomment-1510140972 mentions:
"You really need everything pure musl, or everything musl (but works with gcompat or libc6-compat shim-like tools...) or everything glibc using this package)"
In our case, we are mixing pure musl libraries and glibc compiled libraries with our Alpine base image configuration which should be avoided.
Another reason to switch to a base image that is optimized for running Java JVM applications. The current Alpine image crashes the JVM in unexpected ways. #23348/#23361 is an example of this.
There's also one more release blocker which could be due to the mixed musl & glibc environment: #23306
Why mixing musl & glibc at runtime should be avoided
Modifications
Use https://hub.docker.com/r/bellsoft/liberica-runtime-container as the base image. (Apache NiFi uses a bellsoft/liberica-openjdk-debian, so Liberica is already used in ASF.)
It's the Liberica OpenJDK's official base image provided by BellSoft. It uses Alpaquita Linux as the OS, which is similar to Alpine and uses
apkas the package manager. Alpaquita Linux is optimized for running JVM applications.The image size is very similar as before.
Documentation
docdoc-requireddoc-not-neededdoc-complete