[Gradle/BWC] Patch bundled OpenJdk17 with Adoptium Jdk17 for older ES Distros#135300
Merged
breskeby merged 3 commits intoelastic:mainfrom Sep 24, 2025
Merged
[Gradle/BWC] Patch bundled OpenJdk17 with Adoptium Jdk17 for older ES Distros#135300breskeby merged 3 commits intoelastic:mainfrom
breskeby merged 3 commits intoelastic:mainfrom
Conversation
Collaborator
|
Pinging @elastic/es-delivery (Team:Delivery) |
rjernst
reviewed
Sep 23, 2025
| @@ -1 +1 @@ | |||
| security_stats_endpoint,9168000 | |||
| inference_api_openai_embeddings_headers,9169000 | |||
Member
There was a problem hiding this comment.
note: this was changed due to a bug in transport version generation, but it is innocuous. Upstream main already contains this change, so the final squash merge won't show this change.
| spec.getLanguageVersion().set(JavaLanguageVersion.of(17)); | ||
| }); | ||
| task.environment( | ||
| "ES_FALLBACK_JAVA_HOME", |
Member
There was a problem hiding this comment.
what is the env var? I don't see it used anywhere else and it's not something ES knows about
breskeby
commented
Sep 23, 2025
|
|
||
| private Map<String, String> getEnvironmentVariables() { | ||
| Map<String, String> environment = new HashMap<>(spec.resolveEnvironment()); | ||
| String esFallbackJavaHome = System.getenv("ES_FALLBACK_JAVA_HOME"); |
Contributor
Author
There was a problem hiding this comment.
@rjernst this is where the variable is used.
jozala
reviewed
Sep 24, 2025
Comment on lines
+759
to
+800
| private boolean isUbuntu2404OrLater() { | ||
| try { | ||
| if (OS.current() != OS.LINUX) { | ||
| return false; | ||
| } | ||
|
|
||
| // Read /etc/os-release file to get distribution info | ||
| Path osRelease = Path.of("/etc/os-release"); | ||
| if (!Files.exists(osRelease)) { | ||
| return false; | ||
| } | ||
|
|
||
| String content = Files.readString(osRelease); | ||
| boolean isUbuntu = content.contains("ID=ubuntu"); | ||
|
|
||
| if (!isUbuntu) { | ||
| return false; | ||
| } | ||
|
|
||
| // Extract version | ||
| String versionLine = content.lines().filter(line -> line.startsWith("VERSION_ID=")).findFirst().orElse(""); | ||
|
|
||
| if (versionLine.isEmpty()) { | ||
| return false; | ||
| } | ||
|
|
||
| String version = versionLine.substring("VERSION_ID=".length()).replace("\"", ""); | ||
| String[] parts = version.split("\\."); | ||
|
|
||
| if (parts.length >= 2) { | ||
| int major = Integer.parseInt(parts[0]); | ||
| int minor = Integer.parseInt(parts[1]); | ||
| return major > 24 || (major == 24 && minor >= 4); | ||
| } | ||
|
|
||
| return false; | ||
| } catch (Exception e) { | ||
| LOGGER.debug("Failed to detect Ubuntu version", e); | ||
| return false; | ||
| } | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
I think this has been moved to OsUtils.isUbuntu2404OrLater() and is not needed here any more.
… Distros Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x). We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is older than 21 which is not affected.
acc05df to
cab7c41
Compare
breskeby
added a commit
to breskeby/elasticsearch
that referenced
this pull request
Sep 24, 2025
… Distros (elastic#135300) Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x). We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is older than 21 which is not affected.
breskeby
added a commit
to breskeby/elasticsearch
that referenced
this pull request
Sep 24, 2025
… Distros (elastic#135300) Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x). We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is older than 21 which is not affected.
breskeby
added a commit
to breskeby/elasticsearch
that referenced
this pull request
Sep 24, 2025
… Distros (elastic#135300) Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x). We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is older than 21 which is not affected.
breskeby
added a commit
to breskeby/elasticsearch
that referenced
this pull request
Sep 24, 2025
… Distros (elastic#135300) Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x). We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is older than 21 which is not affected.
Collaborator
breskeby
added a commit
to breskeby/elasticsearch
that referenced
this pull request
Sep 25, 2025
…fallback In elastic#135300 we introduced a fallback to use adoptopenjdk17 when running bwc tests with older distributions. This fix handles the calculation of overriding requirement by taken 0.0.0 version into account which is used to represent versions representing git snapshots.
breskeby
added a commit
to breskeby/elasticsearch
that referenced
this pull request
Sep 25, 2025
…fallback (elastic#135399) In elastic#135300 we introduced a fallback to use adoptopenjdk17 when running bwc tests with older distributions. This fix handles the calculation of overriding requirement by taken 0.0.0 version into account which is used to represent versions representing git snapshots.
breskeby
added a commit
to breskeby/elasticsearch
that referenced
this pull request
Sep 25, 2025
…fallback (elastic#135399) In elastic#135300 we introduced a fallback to use adoptopenjdk17 when running bwc tests with older distributions. This fix handles the calculation of overriding requirement by taken 0.0.0 version into account which is used to represent versions representing git snapshots. (cherry picked from commit 6047a74) # Conflicts: # test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/AbstractLocalClusterFactory.java
breskeby
added a commit
to breskeby/elasticsearch
that referenced
this pull request
Sep 25, 2025
…fallback (elastic#135399) In elastic#135300 we introduced a fallback to use adoptopenjdk17 when running bwc tests with older distributions. This fix handles the calculation of overriding requirement by taken 0.0.0 version into account which is used to represent versions representing git snapshots. (cherry picked from commit 6047a74) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java
breskeby
added a commit
to breskeby/elasticsearch
that referenced
this pull request
Sep 25, 2025
…fallback (elastic#135399) In elastic#135300 we introduced a fallback to use adoptopenjdk17 when running bwc tests with older distributions. This fix handles the calculation of overriding requirement by taken 0.0.0 version into account which is used to represent versions representing git snapshots. (cherry picked from commit 6047a74) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java # test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/AbstractLocalClusterFactory.java
elasticsearchmachine
pushed a commit
that referenced
this pull request
Sep 25, 2025
…g jdk fallback (#135399) (#135404) * [CI] Handle git snapshot BWC versions correctly when calculating jdk fallback (#135399) In #135300 we introduced a fallback to use adoptopenjdk17 when running bwc tests with older distributions. This fix handles the calculation of overriding requirement by taken 0.0.0 version into account which is used to represent versions representing git snapshots. * fix typo
breskeby
added a commit
that referenced
this pull request
Sep 25, 2025
…g jdk fallback (#135399) (#135410) * [CI] Handle git snapshot BWC versions correctly when calculating jdk fallback (#135399) In #135300 we introduced a fallback to use adoptopenjdk17 when running bwc tests with older distributions. This fix handles the calculation of overriding requirement by taken 0.0.0 version into account which is used to represent versions representing git snapshots. (cherry picked from commit 6047a74) # Conflicts: # test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/AbstractLocalClusterFactory.java * Fix typo
breskeby
added a commit
that referenced
this pull request
Sep 25, 2025
…ng jdk fallback (#135399) (#135411) * [CI] Handle git snapshot BWC versions correctly when calculating jdk fallback (#135399) In #135300 we introduced a fallback to use adoptopenjdk17 when running bwc tests with older distributions. This fix handles the calculation of overriding requirement by taken 0.0.0 version into account which is used to represent versions representing git snapshots. (cherry picked from commit 6047a74) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java * Fix typo
breskeby
added a commit
that referenced
this pull request
Sep 25, 2025
…ng jdk fallback (#135399) (#135412) * [CI] Handle git snapshot BWC versions correctly when calculating jdk fallback (#135399) In #135300 we introduced a fallback to use adoptopenjdk17 when running bwc tests with older distributions. This fix handles the calculation of overriding requirement by taken 0.0.0 version into account which is used to represent versions representing git snapshots. (cherry picked from commit 6047a74) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java # test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/AbstractLocalClusterFactory.java * [CI] Auto commit changes from spotless * Fix typo --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
jozala
pushed a commit
to jozala/elasticsearch
that referenced
this pull request
Dec 5, 2025
… Distros (elastic#135300) (elastic#135363) Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x). We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is older than 21 which is not affected. (cherry picked from commit fec83ac) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestBasePlugin.java # build-tools/src/integTest/groovy/org/elasticsearch/gradle/TestClustersPluginFuncTest.groovy # build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java # build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java # build-tools/src/main/java/org/elasticsearch/gradle/testclusters/TestClustersPlugin.java # test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/AbstractLocalClusterFactory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x).
We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is
older than 21 which is not affected.