Skip to content
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

update to JDK 21 for integ tests #737

Merged
merged 1 commit into from
Jan 29, 2025
Merged

Conversation

OVI3D0
Copy link
Member

@OVI3D0 OVI3D0 commented Jan 23, 2025

Description

Integration tests were failing due to recent changes in OpenSearch that require Java 21 for gradle builds:

* What went wrong:
	A problem occurred evaluating project ':buildSrc'.
	> At least Java 21 is required to build opensearch gradle tools

(reference to the failing tests).

Reference to the OpenSearch PR that updates the JDK version.

To fix this, I added a JDK 21 installation to the integ tests for the gradle builds. However, a JDK version between 11 and 17 is still needed for the integration tests. So, I also modified the build.sh file to just use JDK 21 if necessary for the gradle operations, otherwise using JDK 17.

I'm open to alternatives if there is a more elegant solution.

Testing

  • New functionality includes testing

make it


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@OVI3D0 OVI3D0 marked this pull request as ready for review January 23, 2025 22:46
@@ -45,7 +45,20 @@ jobs:
with:
distribution: 'adopt'
java-version: '17'
- run: echo "JAVA17_HOME=$JAVA_HOME" >> $GITHUB_ENV
- run: |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should document in a comment in both files why there are two JDK versions being used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some small comments

@IanHoang
Copy link
Collaborator

IanHoang commented Jan 24, 2025

Approved but will wait before merging because @gkamat wanted check this out

Copy link
Collaborator

@gkamat gkamat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change may fix the integration tests as run via GitHub actions. However, integ tests can be run directly when OSB is installed in development mode, with make it, and this change will not be applicable in that case. Also, switching the JDK back and forth makes this a bit harder to understand.

The better option would probably be to add JDK 21 to the provision_config resources:

# major version of the JDK that is used to build OpenSearch
build.jdk = 17
# list of JDK major versions that are used to run OpenSearch
runtime.jdk = 17,16,15,14,13,12,11,8

@OVI3D0 OVI3D0 force-pushed the main branch 15 times, most recently from f321275 to 0c45d20 Compare January 28, 2025 01:47
@OVI3D0 OVI3D0 requested a review from gkamat January 28, 2025 23:30
@OVI3D0
Copy link
Member Author

OVI3D0 commented Jan 29, 2025

This change may fix the integration tests as run via GitHub actions. However, integ tests can be run directly when OSB is installed in development mode, with make it, and this change will not be applicable in that case. Also, switching the JDK back and forth makes this a bit harder to understand.

The better option would probably be to add JDK 21 to the provision_config resources:

# major version of the JDK that is used to build OpenSearch
build.jdk = 17
# list of JDK major versions that are used to run OpenSearch
runtime.jdk = 17,16,15,14,13,12,11,8

Discussed offline:
The current solution in this PR is a short term workaround while we come up with a more elegant solution. Adding JDK 21 to the provision_config resources and adding a JDK 21 installation caused other failures, which we are assuming was caused by the newer JDK version.

In the meantime, integration tests run with Github Actions will work, but running these tests locally with make it will not. An issue was opened here with more details.

Copy link
Collaborator

@gkamat gkamat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be an interim solution to get the GHA integ tests working. Still need to fix the actual integ tests when run via command line.

@OVI3D0 OVI3D0 merged commit af60c87 into opensearch-project:main Jan 29, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants