-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix] Fix issues with Pulsar Alpine docker image stability: remove glibc-compat #23762
Conversation
…t custom docker images
…ses STS tokens - it's necessary to enable STS service in Localstack and configure it
...ntegration/src/test/java/org/apache/pulsar/tests/integration/io/sinks/KinesisSinkTester.java
Show resolved
Hide resolved
I think it would be hard to maintain this build script in this pulsar repo. nit: are we planning to export those IO connectors from the repo and maintain them separately? |
@heesung-sn sure, it's possible to say that. The Amazon Kinesis Producer library doesn't provide Alpine support and there aren't other feasible options. I have contributed changes to the AWS repository so hopefully support would be added later and we could remove our custom solution. Please continue the review.
Yes, that was decided already in 2020. 😀 |
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.
LGTM.
nit: please provide more reference links(like dependency location list ) as comments in the build scripts for future updates. |
Fixes #23717 #23306
Motivation
The Pulsar Alpine docker image has stability issues due to including glibc-package solution which includes glibc library into the Alpine docker image.
The stability issue causes JVM crashes. This happens mainly in Netty native library loading and usage. It's also a problem in other native libraries such as Conscrypt (#23364 (comment)) and Snappy (#22804). There are also Netty stability issues causing JVM crashes which could be caused by problems in native code (#23612 (comment)).
Alpine maintainers don't recommend adding glibc to Alpine since mixing real glibc in Alpine will result in an unstable environment. In Alpine maintainer Ariadne Conill's words: "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)."
The reason why the glibc solution was initially added was to support Pulsar IO Kinesis connector. The Amazon Kinesis Producer Library isn't fully Java. The Java API calls a native executable which is built for glibc. Amazon doesn't provide a binary for Alpine, however the native executable source code is provided. In order to use Amazon Kinesis Producer Library on Alpine, the stable solution is to compile this binary specifically for Alpine.
Additional context
Mailing list thread
Modifications
This PR includes changes to:
remove the glibc-package solution
provide a Amazon Kinesis Producer Library (KPL) executable compiled for Alpine
apachepulsar/pulsar-io-kinesis-sink-kinesis_producer:0.15.12
.The
kinesis_producer
executable is copied fromapachepulsar/pulsar-io-kinesis-sink-kinesis_producer:0.15.12
image to theapachepulsar/pulsar-all
image and an environment variablePULSAR_IO_KINESIS_KPL_PATH
is set to the executable path.Amazon Kinesis Producer Library has been upgraded from 0.14.13 version to 0.15.12.
The Pulsar IO Kinesis Sink connector has been modified to support the AWS Kinesis Producer Library parameter
nativeExecutable
. When thePULSAR_IO_KINESIS_KPL_PATH
env var is set, it will be set to thenativeExecutable
parameter as the default value. This is how the Pulsar IO Kinesis Sink connector will use thekinesis_producer
binary compiled for Alpine when using thepulsar-all
image.In the Pulsar docker image,
LD_PRELOAD=/lib/libgcompat.so.0
is set. This is required to support loading Netty native libraries in Alpine unless the JVM already loads thegcompat
library which provides aglibc
compatibility layer for Alpine. The Alpinegcompat
library is the recommended option for Netty native libraries on Alpine.Documentation
doc
doc-required
doc-not-needed
doc-complete