-
Notifications
You must be signed in to change notification settings - Fork 25.5k
[Gradle/BWC] Patch bundled OpenJdk17 with Adoptium Jdk17 for older ES Distros #135300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Gradle/BWC] Patch bundled OpenJdk17 with Adoptium Jdk17 for older ES Distros #135300
Conversation
Pinging @elastic/es-delivery (Team:Delivery) |
@@ -1 +1 @@ | |||
security_stats_endpoint,9168000 | |||
inference_api_openai_embeddings_headers,9169000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the env var? I don't see it used anywhere else and it's not something ES knows about
|
||
private Map<String, String> getEnvironmentVariables() { | ||
Map<String, String> environment = new HashMap<>(spec.resolveEnvironment()); | ||
String esFallbackJavaHome = System.getenv("ES_FALLBACK_JAVA_HOME"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rjernst this is where the variable is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this has been moved to OsUtils.isUbuntu2404OrLater()
and is not needed here any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
… 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
… 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.
… 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.
… 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.
… 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.
…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.
…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.
…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
…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
…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
…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
…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
…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
…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>
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.