chia7712 commented on code in PR #17625:
URL: https://github.com/apache/kafka/pull/17625#discussion_r1822556763


##########
tests/docker/Dockerfile:
##########
@@ -13,10 +13,36 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# The base image of openjdk:17 is typically oraclelinux:8-slim, which doesn't 
include apt-get. 
-# Therefore, use openjdk:17-buster instead.
-ARG jdk_version=openjdk:17-buster
-FROM $jdk_version AS build-native-image
+# We need to build the differnet versions of Java in same image, because the
+# zookeeper client 3.4.x can't run under JDK 17, so we need to use JDK 11 in 
2.1 ~ 2.3 
+# kafka versions, see KAFKA-17888
+ARG os_version=debian:buster-20240423

Review Comment:
   Maybe we can use ubuntu as our CI?



##########
tests/docker/Dockerfile:
##########
@@ -13,10 +13,36 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# The base image of openjdk:17 is typically oraclelinux:8-slim, which doesn't 
include apt-get. 
-# Therefore, use openjdk:17-buster instead.
-ARG jdk_version=openjdk:17-buster
-FROM $jdk_version AS build-native-image
+# We need to build the differnet versions of Java in same image, because the
+# zookeeper client 3.4.x can't run under JDK 17, so we need to use JDK 11 in 
2.1 ~ 2.3 
+# kafka versions, see KAFKA-17888
+ARG os_version=debian:buster-20240423
+FROM $os_version AS build-native-image
+
+ARG java_base_dir=/opt/jdk

Review Comment:
   this is used by e2e, so it should not be configurable. 



##########
tests/docker/Dockerfile:
##########
@@ -13,10 +13,36 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# The base image of openjdk:17 is typically oraclelinux:8-slim, which doesn't 
include apt-get. 
-# Therefore, use openjdk:17-buster instead.
-ARG jdk_version=openjdk:17-buster
-FROM $jdk_version AS build-native-image
+# We need to build the differnet versions of Java in same image, because the
+# zookeeper client 3.4.x can't run under JDK 17, so we need to use JDK 11 in 
2.1 ~ 2.3 
+# kafka versions, see KAFKA-17888
+ARG os_version=debian:buster-20240423
+FROM $os_version AS build-native-image
+
+ARG java_base_dir=/opt/jdk
+ARG jdk_version_1=openjdk-11-jdk
+ARG jdk_version_2=openjdk-17-jdk
+
+RUN apt-get update && \
+    apt-get install -y curl \
+    && rm -rf /var/lib/apt/lists/* 
+
+WORKDIR /opt
+
+RUN curl -L -o ${jdk_version_1}.tar.gz 
https://builds.openlogic.com/downloadJDK/openlogic-openjdk/11.0.25+9/openlogic-openjdk-11.0.25+9-linux-x64.tar.gz
 && \

Review Comment:
   Could you please use `https://s3-us-west-2.amazonaws.com/kafka-packages` 
like vagrant?



##########
tests/kafkatest/services/kafka/util.py:
##########
@@ -37,6 +37,11 @@ def fix_opts_for_new_jvm(node):
         if node.version == LATEST_0_8_2 or node.version == LATEST_0_9 or 
node.version == LATEST_0_10_0 or node.version == LATEST_0_10_1 or node.version 
== LATEST_0_10_2 or node.version == LATEST_0_11_0 or node.version == LATEST_1_0:
             cmd += "export 
KAFKA_GC_LOG_OPTS=\"-Xlog:gc*:file=kafka-gc.log:time,tags:filecount=10,filesize=102400\";
 "
             cmd += "export KAFKA_JVM_PERFORMANCE_OPTS=\"-server -XX:+UseG1GC 
-XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 
-XX:+ExplicitGCInvokesConcurrent -XX:MaxInlineLevel=15 
-Djava.awt.headless=true\"; "
+        # zookeeper client 3.4.x can't run under JDK 17, so we need to use JDK 
11 in 2.1 ~ 2.3 kafka versions see KAFKA-17888
+        if node.version == V_2_1_0 or node.version == V_2_1_1 or node.version 
== V_2_2_0 or node.version == V_2_2_1 or node.version == V_2_2_2 or 
node.version == V_2_3_0 or node.version == V_2_3_1:
+            cmd += "export JAVA_HOME=/opt/jdk/openjdk-11-jdk; 
PATH=$JAVA_HOME/bin:$PATH; "

Review Comment:
   the folder path should be `/opt/jdk/11` and `/opt/jdk/17`



##########
tests/docker/Dockerfile:
##########
@@ -13,10 +13,36 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# The base image of openjdk:17 is typically oraclelinux:8-slim, which doesn't 
include apt-get. 
-# Therefore, use openjdk:17-buster instead.
-ARG jdk_version=openjdk:17-buster
-FROM $jdk_version AS build-native-image
+# We need to build the differnet versions of Java in same image, because the
+# zookeeper client 3.4.x can't run under JDK 17, so we need to use JDK 11 in 
2.1 ~ 2.3 
+# kafka versions, see KAFKA-17888
+ARG os_version=debian:buster-20240423
+FROM $os_version AS build-native-image
+
+ARG java_base_dir=/opt/jdk
+ARG jdk_version_1=openjdk-11-jdk

Review Comment:
   Could you please use `jdk_11_url` and `jdk_17_url` instead? It allows 
developers to test different JDK distributions easily.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to