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

lh remove glibc compat #196

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a956da6
Remove glibc-package since it causes issues on Alpine musl
lhotari Dec 17, 2024
a7afe44
More changes
lhotari Dec 17, 2024
9bc1d7c
Update
lhotari Dec 17, 2024
90c9904
Debug
lhotari Dec 17, 2024
7459479
Optimize
lhotari Dec 17, 2024
da0fe53
Update
lhotari Dec 17, 2024
8142a14
Debug
lhotari Dec 17, 2024
9978073
Update
lhotari Dec 17, 2024
402eb46
Fix lib dir
lhotari Dec 17, 2024
59a0948
Update
lhotari Dec 17, 2024
ee7c826
Add symlink
lhotari Dec 17, 2024
e0cf079
Add patch
lhotari Dec 17, 2024
22770b5
Update patch
lhotari Dec 18, 2024
12cb04e
Support running multiple times
lhotari Dec 18, 2024
07f1b82
Improve patch for alpine support to eliminate need for libexecinfo
lhotari Dec 18, 2024
5e31293
Add final stage
lhotari Dec 18, 2024
41a1c93
Add nativeExecutable config to KinesisSinkConfig and support setting …
lhotari Dec 19, 2024
3f6179f
Capture version information about the build
lhotari Dec 19, 2024
1679e45
Copy kinesis_producer to pulsar-all image
lhotari Dec 19, 2024
9474b37
Improve README
lhotari Dec 19, 2024
63b94ea
Support passing the PULSAR_IO_KINESIS_KPL_IMAGE as argument to suppor…
lhotari Dec 19, 2024
3819fe1
Install required dependencies
lhotari Dec 19, 2024
214470e
Fix image order
lhotari Dec 19, 2024
4cfde49
Improve dockerfiles
lhotari Dec 19, 2024
0c37153
Install as root
lhotari Dec 19, 2024
7621d86
upgrade docker-maven.version
lhotari Dec 19, 2024
a611690
Fix issue
lhotari Dec 19, 2024
a6aa2cb
Copy needed files
lhotari Dec 19, 2024
dee7b79
Fix licenses
lhotari Dec 19, 2024
f11f068
Add support for STS in tests Since KPL version 0.15+ implementation u…
lhotari Dec 19, 2024
6204bcb
Test the pulsar-all image
lhotari Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 0 additions & 80 deletions docker/glibc-package/Dockerfile

This file was deleted.

53 changes: 0 additions & 53 deletions docker/glibc-package/scripts/APKBUILD

This file was deleted.

21 changes: 0 additions & 21 deletions docker/glibc-package/scripts/glibc-bin.trigger

This file was deleted.

23 changes: 0 additions & 23 deletions docker/glibc-package/scripts/ld.so.conf

This file was deleted.

90 changes: 90 additions & 0 deletions docker/kinesis-producer-alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

ARG ALPINE_VERSION=3.20

# Builds an Alpine image with kinesis_producer compiled for Alpine Linux / musl

# Build stage
FROM alpine:$ALPINE_VERSION AS kinesis-producer-build
ENV KINESIS_PRODUCER_LIB_VERSION=0.15.12

# Install build dependencies
RUN apk update && apk add --no-cache \
git \
binutils \
coreutils \
alpine-sdk \
util-linux \
cmake \
autoconf \
automake \
libtool \
curl \
bash \
tar \
libuuid \
linux-headers \
zlib \
zlib-dev \
perl \
wget \
boost-dev \
openssl-dev \
curl-dev \
build-base \
util-linux-dev \
g++ \
make \
upx

ENV LANG=C.UTF-8

RUN mkdir /build
COPY kinesis_producer_alpine.patch /build/

# Clone KPL and copy build script
RUN cd /build && \
git clone --depth 1 --single-branch --branch v${KINESIS_PRODUCER_LIB_VERSION} https://github.com/awslabs/amazon-kinesis-producer && \
cd amazon-kinesis-producer && \
git apply ../kinesis_producer_alpine.patch

# Copy and execute build script
COPY build-alpine.sh /build/
RUN chmod +x /build/build-alpine.sh
RUN /build/build-alpine.sh

# Final stage
FROM alpine:$ALPINE_VERSION
COPY --from=kinesis-producer-build /opt/amazon-kinesis-producer /opt/amazon-kinesis-producer
RUN apk update && apk add --no-cache \
brotli-libs \
c-ares \
libcrypto3 \
libcurl \
libgcc \
libidn2 \
libpsl \
libssl3 \
libunistring \
nghttp2-libs \
zlib \
zstd-libs \
libuuid
WORKDIR /opt/amazon-kinesis-producer/bin
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,19 @@

-->

# GLibc compatibility package
# Alpine image with kinesis_producer compiled for Alpine Linux / musl

This directory includes the Docker scripts to build an image with GLibc compiled for Alpine Linux.
This directory includes the Docker scripts to build an image with `kinesis_producer` for Alpine Linux.
`kinesis_producer` is a native executable that is required by [Amazon Kinesis Producer library (KPL)](https://github.com/awslabs/amazon-kinesis-producer) which is used by the Pulsar IO Kinesis Sink connector. The default `kinesis_producer` binary is compiled for glibc, and it does not work on Alpine Linux which uses musl.

This is used to ensure plugins that are going to be used in the Pulsar image and that are depeding on GLibc, will
still be working correctly in the Alpine Image. (eg: Netty Tc-Native and Kinesis Producer Library).

This image only needs to be re-created when we want to upgrade to a newer version of GLibc.
This image only needs to be re-created when we want to upgrade to a newer version of `kinesis_producer`.

# Steps

1. Change the version in the Dockerfile for this directory.
2. Rebuild the image and push it to Docker Hub:
```
docker buildx build --platform=linux/amd64,linux/arm64 -t apachepulsar/glibc-base:2.38 . --push
docker buildx build --platform=linux/amd64,linux/arm64 -t apachepulsar/pulsar-io-kinesis-sink-kinesis_producer:0.15.12 . --push
```

The image tag is then used in `docker/pulsar/Dockerfile`.
The image tag is then used in `docker/pulsar-all/Dockerfile`. The `kinesis_producer` binary is copied from the image to the `pulsar-all` image that is used by Pulsar Functions to run the Pulsar IO Kinesis Sink connector. The environment variable `PULSAR_IO_KINESIS_KPL_PATH` is set to `/opt/amazon-kinesis-producer/bin/kinesis_producer` and this is how the Kinesis Sink connector knows where to find the `kinesis_producer` binary.
Loading
Loading