ranger icon indicating copy to clipboard operation
ranger copied to clipboard

RANGER-4076: Support Java 17 for build and runtime

Open RakeshGuptaDev opened this issue 1 year ago • 2 comments

What changes were proposed in this pull request?

Support for Java 17 has been added in both build and runtime environments, along with support for Java 8 and 11 in both environments.

How was this patch tested?

This patch has been successfully tested and verified on Java versions 8, 11, and 17. The verification process involved both manual testing and a Docker-based setup. We can now build and run the patch on the same JDK version.

Maven Build Verification

JDK 8: mvn clean compile package install

JDK 11: mvn clean compile package install

JDK 17: mvn clean compile package install -Pranger-all-modules-jdk17

Validated policy enforcement for below scenario :

Scenario 1: JDK 8 Build and Runtime Successfully validated Usersync, Tagsync, and Policy Enforcement (including policy conditions) for HDFS, HBase, and Hive services using Ranger with JDK 8 for both build and runtime environments.

Scenario 2: JDK 8 Build and JDK 17 Runtime Successfully validated Usersync, Tagsync, and Policy Enforcement (including policy conditions) for HDFS, HBase, and Hive services using Ranger with JDK 8 for the build and JDK 17 for the runtime environment.

Scenario 3: JDK 17 Build and Runtime Successfully validated Usersync, Tagsync, and Policy Enforcement (including policy conditions) for HDFS, HBase, and Hive services using Ranger with JDK 17 for both build and runtime environments.

RakeshGuptaDev avatar Dec 03 '24 09:12 RakeshGuptaDev

Good work @RakeshGuptaDev! One concern is that many Ranger plugins need to run in JDK version prior to 17 (JDK8 or JDK 11 or JDK15) - like HDFS, Hive, HBase. This wouldn't allow us to switch to Graal script engine, as it is only available in JDK17 onwards (https://www.graalvm.org/jdk17/docs/).

One option to consider building Ranger libraries used by plugins (agents-common, agents-audit, agents-cred, all plugins) with JDK8 and servers (admin, usersync, tagsync, KMS) with JDK17.

mneethiraj avatar Dec 03 '24 16:12 mneethiraj

Hi @mneethiraj,

Thank you for your feedback. I understand your concern that Ranger plugins need to support JDK versions prior to 17, including JDK 8, JDK 11, and JDK 15.

In the current patch, I have used GraalVM version 21.3.x, which is compatible with JDK 8 (https://www.graalvm.org/21.3/docs/introduction/index.html#available-distributions). I have also successfully validated plugins like HDFS, HBase, and Hive across JDK 8 and JDK 11.

For JDK 17 and later, I have used the latest available GraalVM version.

To address this compatibility challenge, we can consider the following approach:

Replace Nashorn:

  • Use GraalVM version 21.3.x for JDK 8.
  • Upgrade to the latest available GraalVM version for JDK 15 and later.

This approach aims to maintain compatibility across all supported JDK versions. Please share your thoughts or suggest any alternative solutions.

RakeshGuptaDev avatar Feb 26 '25 06:02 RakeshGuptaDev