This is an automated email from the ASF dual-hosted git repository.
fanng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 137abc4c74 [#7823] feat(server): upgrade Gravitino server mini JDK
version to 17 (#7913)
137abc4c74 is described below
commit 137abc4c74483a159d5e5c9dcc9b71dd576ce7f7
Author: Yuhui <[email protected]>
AuthorDate: Mon Aug 4 16:41:42 2025 +0800
[#7823] feat(server): upgrade Gravitino server mini JDK version to 17
(#7913)
### What changes were proposed in this pull request?
1. Upgrade Gravitino server server minimal JDK version to 17
2. Remove other version of JDK in CI pipe lines.
### Why are the changes needed?
We could upgrade the Iceberg version only if we upgrade the IRC and
Gravitino server
Fix: #7823
### Does this PR introduce _any_ user-facing change?
Yes, the server couldn't run under JDK8, JDK11
### How was this patch tested?
UTs and ITs
---
.github/workflows/backend-integration-test.yml | 2 +-
.github/workflows/build.yml | 6 +++---
.github/workflows/cron-integration-test.yml | 2 +-
.github/workflows/flink-integration-test.yml | 2 +-
.github/workflows/spark-integration-test.yml | 2 +-
build.gradle.kts | 2 --
.../integration/test/HadoopUserAuthenticationIT.java | 3 +--
gradle.properties | 4 ++--
.../test/IcebergRestKerberosHiveCatalogIT.java | 19 ++++++++++++++++++-
9 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/backend-integration-test.yml
b/.github/workflows/backend-integration-test.yml
index dbbdb0eeb9..1334bf1892 100644
--- a/.github/workflows/backend-integration-test.yml
+++ b/.github/workflows/backend-integration-test.yml
@@ -54,7 +54,7 @@ jobs:
strategy:
matrix:
architecture: [linux/amd64]
- java-version: [ 8, 11, 17 ]
+ java-version: [ 17 ]
backend: [ h2, mysql, postgresql ]
test-mode: [ embedded, deploy ]
exclude:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 12e1336ccb..2a0c68e483 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -58,7 +58,7 @@ jobs:
- uses: actions/setup-java@v4
with:
- java-version: 8
+ java-version: 17
distribution: 'temurin'
cache: 'gradle'
@@ -76,7 +76,7 @@ jobs:
- uses: actions/setup-java@v4
with:
- java-version: 8
+ java-version: 17
distribution: 'temurin'
cache: 'gradle'
@@ -103,7 +103,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- java-version: [ 8, 11, 17 ]
+ java-version: [ 17 ]
timeout-minutes: 60
needs: changes
if: needs.changes.outputs.source_changes == 'true'
diff --git a/.github/workflows/cron-integration-test.yml
b/.github/workflows/cron-integration-test.yml
index 00750057bb..ddd541d514 100644
--- a/.github/workflows/cron-integration-test.yml
+++ b/.github/workflows/cron-integration-test.yml
@@ -55,7 +55,7 @@ jobs:
strategy:
matrix:
architecture: [linux/amd64]
- java-version: [ 8, 11, 17 ]
+ java-version: [ 17 ]
test-mode: [ embedded, deploy ]
env:
DOCKER_RUN_NAME: hive-amd64
diff --git a/.github/workflows/flink-integration-test.yml
b/.github/workflows/flink-integration-test.yml
index b07e4865b3..ee4749c292 100644
--- a/.github/workflows/flink-integration-test.yml
+++ b/.github/workflows/flink-integration-test.yml
@@ -53,7 +53,7 @@ jobs:
strategy:
matrix:
architecture: [linux/amd64]
- java-version: [ 8, 11, 17 ]
+ java-version: [ 17 ]
uses: ./.github/workflows/flink-integration-test-action.yml
with:
architecture: ${{ matrix.architecture }}
diff --git a/.github/workflows/spark-integration-test.yml
b/.github/workflows/spark-integration-test.yml
index 8d93b10756..0d1b53634f 100644
--- a/.github/workflows/spark-integration-test.yml
+++ b/.github/workflows/spark-integration-test.yml
@@ -53,7 +53,7 @@ jobs:
matrix:
# Integration test for AMD64 architecture
architecture: [linux/amd64]
- java-version: [ 8, 11, 17 ]
+ java-version: [ 17 ]
scala-version: [ 2.12 ]
test-mode: [ embedded, deploy ]
uses: ./.github/workflows/spark-integration-test-action.yml
diff --git a/build.gradle.kts b/build.gradle.kts
index 6f3a334b93..2d49287b37 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -286,8 +286,6 @@ subprojects {
languageVersion.set(JavaLanguageVersion.of(17))
} else {
languageVersion.set(JavaLanguageVersion.of(extra["jdkVersion"].toString().toInt()))
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
}
}
}
diff --git
a/catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/integration/test/HadoopUserAuthenticationIT.java
b/catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/integration/test/HadoopUserAuthenticationIT.java
index 18951584e7..e218561e7c 100644
---
a/catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/integration/test/HadoopUserAuthenticationIT.java
+++
b/catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/integration/test/HadoopUserAuthenticationIT.java
@@ -57,7 +57,6 @@ import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.utility.MountableFile;
-import sun.security.krb5.KrbException;
@Tag("gravitino-docker-test")
public class HadoopUserAuthenticationIT extends BaseIT {
@@ -135,7 +134,7 @@ public class HadoopUserAuthenticationIT extends BaseIT {
System.clearProperty("sun.security.krb5.debug");
}
- private static void prepareKerberosConfig() throws IOException, KrbException
{
+ private static void prepareKerberosConfig() throws IOException {
// Keytab of the Gravitino SDK client
kerberosHiveContainer
.getContainer()
diff --git a/gradle.properties b/gradle.properties
index cf3547fb42..69052f0c96 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -30,8 +30,8 @@ SONATYPE_USER = admin
SONATYPE_PASSWORD = password
# jdkVersion is used to specify the version of JDK to build and test
Gravitino, current
-# supported version is 8, 11, and 17.
-jdkVersion = 8
+# supported version is 17.
+jdkVersion = 17
# defaultScalaVersion is used to specify the version of Scala to build and
test Gravitino
defaultScalaVersion = 2.12
diff --git
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRestKerberosHiveCatalogIT.java
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRestKerberosHiveCatalogIT.java
index cea5ced31b..7ab4be49a7 100644
---
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRestKerberosHiveCatalogIT.java
+++
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRestKerberosHiveCatalogIT.java
@@ -19,6 +19,7 @@
package org.apache.gravitino.iceberg.integration.test;
import java.io.File;
+import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.HashMap;
@@ -81,7 +82,7 @@ public class IcebergRestKerberosHiveCatalogIT extends
IcebergRESTHiveCatalogIT {
System.setProperty("java.security.krb5.realm", "HADOOPKRB");
System.setProperty("java.security.krb5.kdc", ip);
- sun.security.krb5.Config.refresh();
+ refreshKerberosConfig();
resetDefaultRealm();
// Give cli@HADOOPKRB permission to access the hdfs
@@ -157,4 +158,20 @@ public class IcebergRestKerberosHiveCatalogIT extends
IcebergRESTHiveCatalogIT {
return Objects.equals(mode, ITUtils.EMBEDDED_TEST_MODE);
}
+
+ private static void refreshKerberosConfig() {
+ Class<?> classRef;
+ try {
+ if (System.getProperty("java.vendor").contains("IBM")) {
+ classRef = Class.forName("com.ibm.security.krb5.internal.Config");
+ } else {
+ classRef = Class.forName("sun.security.krb5.Config");
+ }
+
+ Method refershMethod = classRef.getMethod("refresh");
+ refershMethod.invoke(null);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
}