Skip to content

Commit

Permalink
fix(ci): pin Kafka 4.0.0 version in build
Browse files Browse the repository at this point in the history
Long term Kafka 4.0.0 will be Kraft-only and won't support running in
ZooKeeper mode anymore. For now we can pin to a commit from the 4.0
branch just before KAFKA-17616 Remove KafkaServer started being
delivered. In the future we'll need to enhance our docker-compose.yml to
run KRaft brokers when KAFKA_VERSION >= 4.0.0

Signed-off-by: Dominic Evans <[email protected]>
  • Loading branch information
dnwe committed Jan 7, 2025
1 parent 3e3c21d commit 40117de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile.kafka
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ RUN --mount=type=bind,target=.,rw=true \
&& chmod a+rw "/opt/kafka-${KAFKA_VERSION}" \
&& if [ "$KAFKA_VERSION" = "4.0.0" ]; then \
microdnf install -y java-17-openjdk-devel \
&& git clone --depth=1 --single-branch -b 4.0 https://github.com/apache/kafka /usr/src/kafka \
&& git clone --depth=50 --single-branch -b 4.0 https://github.com/apache/kafka /usr/src/kafka \
&& cd /usr/src/kafka \
&& : PIN TO COMMIT BEFORE KAFKA-17616 ZOOKEEPER REMOVAL STARTED \
&& git reset --hard d1504649fb \
&& export JAVA_TOOL_OPTIONS=-XX:MaxRAMPercentage=80 \
&& cd /usr/src/kafka && sed -e '/version=/s/-SNAPSHOT//' -e '/org.gradle.jvmargs/d' -e '/org.gradle.parallel/s/true/false/' -i gradle.properties && ./gradlew -PmaxParallelForks=1 -PmaxScalacThreads=1 --no-daemon releaseTarGz -x siteDocsTar -x javadoc \
&& sed -e '/version=/s/-SNAPSHOT//' -e '/org.gradle.jvmargs/d' -e '/org.gradle.parallel/s/true/false/' -i gradle.properties && ./gradlew -PmaxParallelForks=1 -PmaxScalacThreads=1 --no-daemon releaseTarGz -x siteDocsTar -x javadoc \
&& tar xzf core/build/distributions/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz --strip-components=1 -C "/opt/kafka-${KAFKA_VERSION}" \
&& cp /tmp/server.properties "/opt/kafka-${KAFKA_VERSION}/config/" \
&& microdnf remove -y java-17-openjdk-devel \
Expand Down

0 comments on commit 40117de

Please sign in to comment.