From 8179233d0b4ccb0d7a4634e5209601ca26c083bc Mon Sep 17 00:00:00 2001 From: krasinski <8573352+krasinski@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:42:00 +0200 Subject: [PATCH] jdk21 (cherry picked from commit 1d4c0f778bab98ae4014b4a6f5bf460a5459b50a) --- docker/Jenkinsfile-build-docker | 5 +++-- docker/jenkins-images/Dockerfile-jdk-others | 3 ++- docker/scripts/java-21-vars.sh | 6 ++++++ h2o-core/src/main/java/water/JavaVersionSupport.java | 2 +- h2o-core/src/test/java/water/JavaVersionSupportTest.java | 4 ++-- h2o-docs/src/product/welcome.rst | 2 +- h2o-r/h2o-DESCRIPTION.template | 2 +- scripts/jenkins/Makefile.jenkins | 7 +++++++ 8 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 docker/scripts/java-21-vars.sh diff --git a/docker/Jenkinsfile-build-docker b/docker/Jenkinsfile-build-docker index c6ae3654059f..2d8d31ae316d 100644 --- a/docker/Jenkinsfile-build-docker +++ b/docker/Jenkinsfile-build-docker @@ -19,8 +19,8 @@ properties([ IMAGE_NAME_PREFIX = 'harbor.h2o.ai/opsh2oai/h2o-3' -JDK_VERSIONS = ['8', '10', '11', '12', '13', '14', '15', '16', '17'] -JDK_VERSIONS_PY_R = ['8', '11', '17'] // stable, last-supported, latest +JDK_VERSIONS = ['8', '10', '11', '12', '13', '14', '15', '16', '17', '21'] +JDK_VERSIONS_PY_R = ['8', '17', '21'] // stable, last-supported, latest PYTHON_VERSIONS = ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] R_VERSION = ['3.3.3', '3.4.1', '3.5.3', '3.6.2', '4.0.2'] @@ -60,6 +60,7 @@ ansiColor('xterm') { sh "s3cmd get s3://artifacts.h2o.ai/releases/oracle/jdk-15/x64-linux/jdk-15.0.2_linux-x64_bin.tar.gz" sh "s3cmd get s3://artifacts.h2o.ai/releases/oracle/jdk-16/x64-linux/jdk-16.0.2_linux-x64_bin.tar.gz" sh "s3cmd get s3://artifacts.h2o.ai/releases/oracle/jdk-17/x64-linux/jdk-17.0.0_linux-x64_bin.tar.gz" + sh "s3cmd get s3://artifacts.h2o.ai/releases/oracle/jdk-21/x64-linux/jdk-21_linux-x64_bin.tar.gz" } } stash name: 'docker-sources' diff --git a/docker/jenkins-images/Dockerfile-jdk-others b/docker/jenkins-images/Dockerfile-jdk-others index dcbe8af667ac..bea64576c221 100644 --- a/docker/jenkins-images/Dockerfile-jdk-others +++ b/docker/jenkins-images/Dockerfile-jdk-others @@ -15,7 +15,8 @@ RUN \ sync && \ if [ "${JAVA_VERSION}" = '8' ] || [ "${JAVA_VERSION}" = '10' ] || [ "${JAVA_VERSION}" = '11' ] || \ [ "${JAVA_VERSION}" = '12' ] || [ "${JAVA_VERSION}" = '13' ] || [ "${JAVA_VERSION}" = '14' ] || \ - [ "${JAVA_VERSION}" = '15' ] || [ "${JAVA_VERSION}" = '16' ] || [ "${JAVA_VERSION}" = '17' ]; then \ + [ "${JAVA_VERSION}" = '15' ] || [ "${JAVA_VERSION}" = '16' ] || [ "${JAVA_VERSION}" = '17' ] || \ + [ "${JAVA_VERSION}" = '21' ]; then \ /tmp/install_java_version_local ${JAVA_VERSION} /tmp/java-${JAVA_VERSION}-vars.sh; \ else \ /tmp/install_java_version ${JAVA_VERSION} /tmp/java-${JAVA_VERSION}-vars.sh; \ diff --git a/docker/scripts/java-21-vars.sh b/docker/scripts/java-21-vars.sh new file mode 100644 index 000000000000..4e1f567a0a55 --- /dev/null +++ b/docker/scripts/java-21-vars.sh @@ -0,0 +1,6 @@ +#! /bin/bash + +JAVA_INSTALL_VERSION_MAJOR='21' +JAVA_INSTALL_VERSION=0 +JAVA_INSTALL_PATH=/usr/opt/java-${JAVA_INSTALL_VERSION_MAJOR}-${JAVA_INSTALL_VERSION}/ +JDK_FILE=/tmp/jdk-21_linux-x64_bin.tar.gz diff --git a/h2o-core/src/main/java/water/JavaVersionSupport.java b/h2o-core/src/main/java/water/JavaVersionSupport.java index 3cbca90b4631..faad81fa94a7 100644 --- a/h2o-core/src/main/java/water/JavaVersionSupport.java +++ b/h2o-core/src/main/java/water/JavaVersionSupport.java @@ -8,7 +8,7 @@ public class JavaVersionSupport { // Make sure that the following is logically consistent with whitelist in R code - see function .h2o.check_java_version in connection.R. // Upgrade of the javassist library should be considered when adding support for a new java version. public static final int MIN_SUPPORTED_JAVA_VERSION = 8; - public static final int MAX_SUPPORTED_JAVA_VERSION = 17; + public static final int MAX_SUPPORTED_JAVA_VERSION = 21; /** * Checks for the version of Java this instance of H2O was ran with and compares it with supported versions. diff --git a/h2o-core/src/test/java/water/JavaVersionSupportTest.java b/h2o-core/src/test/java/water/JavaVersionSupportTest.java index bc868d78d47e..f291547d1add 100644 --- a/h2o-core/src/test/java/water/JavaVersionSupportTest.java +++ b/h2o-core/src/test/java/water/JavaVersionSupportTest.java @@ -37,7 +37,7 @@ public static void beforeClass() throws Exception { @Parameterized.Parameters public static Collection data() { return Arrays.asList(new Object[][]{ - {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17} + {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {20}, {21} }); } @@ -79,7 +79,7 @@ public static void beforeClass() throws Exception { @Parameterized.Parameters public static Collection data() { return Arrays.asList(new Object[][]{ - {7}, {18} + {7}, {22} }); } diff --git a/h2o-docs/src/product/welcome.rst b/h2o-docs/src/product/welcome.rst index 391b0cdbb6bf..bda0452ad102 100644 --- a/h2o-docs/src/product/welcome.rst +++ b/h2o-docs/src/product/welcome.rst @@ -37,7 +37,7 @@ H2O runs on Java. To build H2O or run H2O tests, the 64-bit JDK is required. To H2O supports the following versions of Java: -- Java SE 17, 16, 15, 14, 13, 12, 11, 10, 9, 8 +- Java SE 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8 Click `here `__ to download the latest supported version. diff --git a/h2o-r/h2o-DESCRIPTION.template b/h2o-r/h2o-DESCRIPTION.template index d4c56118bfa3..681a10b446ef 100644 --- a/h2o-r/h2o-DESCRIPTION.template +++ b/h2o-r/h2o-DESCRIPTION.template @@ -46,7 +46,7 @@ License: Apache License (== 2.0) URL: https://github.com/h2oai/h2o-3 BugReports: https://github.com/h2oai/h2o-3/issues NeedsCompilation: no -SystemRequirements: Java (>= 8, <= 17) +SystemRequirements: Java (>= 8, <= 21) Depends: R (>= 2.13.0), methods, stats diff --git a/scripts/jenkins/Makefile.jenkins b/scripts/jenkins/Makefile.jenkins index 2038ff1ace2f..f49cf7032fd9 100755 --- a/scripts/jenkins/Makefile.jenkins +++ b/scripts/jenkins/Makefile.jenkins @@ -480,6 +480,13 @@ test-junit-17-jenkins: test-junit-17: ADDITIONAL_TEST_JVM_OPTS="--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED" ./gradlew test -x h2o-ext-mojo-pipeline:test -x h2o-automl:test -x h2o-ext-xgboost:testMultiNode -x h2o-ext-target-encoder:testMultiNode -x h2o-clustering:test $$ADDITIONAL_GRADLE_OPTS +test-junit-21-jenkins: + $(call sed_test_scripts) + @$(MAKE) -f $(THIS_FILE) test-junit-21 + +test-junit-21: + ADDITIONAL_TEST_JVM_OPTS="--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED" ./gradlew test -x h2o-ext-mojo-pipeline:test -x h2o-automl:test -x h2o-ext-xgboost:testMultiNode -x h2o-ext-target-encoder:testMultiNode -x h2o-clustering:test $$ADDITIONAL_GRADLE_OPTS + test-junit-latest-jenkins: $(call sed_test_scripts) @$(MAKE) -f $(THIS_FILE) test-junit-latest