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 developer guide reference to download JDK 14 #1452

Merged
merged 3 commits into from
Nov 11, 2021

Conversation

andrross
Copy link
Member

@andrross andrross commented Oct 27, 2021

Description

Update developer guide reference to download JDK 14

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

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.

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Wrapper Validation success 6cf9112

@opensearch-ci-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 6cf9112

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Precommit success 6cf9112

@@ -65,7 +65,7 @@ Download Java 11 from [here](https://adoptium.net/releases.html?variant=openjdk1

#### JDK 8 and 17

To run the full suite of tests, download and install [JDK 8](https://adoptium.net/releases.html?variant=openjdk8) and [17](https://adoptium.net/releases.html?variant=openjdk17) and set `JAVA8_HOME`, `JAVA11_HOME`, and `JAVA14_HOME`. They are required by the [backwards compatibility test](./TESTING.md#testing-backwards-compatibility).
To run the full suite of tests, download and install [JDK 8](https://adoptium.net/releases.html?variant=openjdk8) and [17](https://adoptium.net/releases.html?variant=openjdk17) and set `JAVA8_HOME`, `JAVA11_HOME`, and `JAVA17_HOME`. They are required by the [backwards compatibility test](./TESTING.md#testing-backwards-compatibility).
Copy link
Collaborator

@tlfeng tlfeng Oct 27, 2021

Choose a reason for hiding this comment

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

Hi @andrross, I think the environment variable JAVA14_HOME is used to build the artifact from 1.0 branch, for fully compatibility with Elasticsearch 7.10.2. (https://github.com/opensearch-project/OpenSearch/blob/1.0/DEVELOPER_GUIDE.md#jdk-14)

Copy link
Member Author

Choose a reason for hiding this comment

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

On the main branch it seems that JAVA17_HOME is required and JAVA14_HOME is unused, so my update here is correct. Am I wrong about that?

Copy link
Collaborator

Choose a reason for hiding this comment

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

According to the doc: https://github.com/opensearch-project/OpenSearch/blob/1.1.0/TESTING.md#testing-backwards-compatibility

When running ./gradlew check, minimal bwc checks are also run against compatible versions that are not yet released.

Even run ./gradlew check on main branch, it will build artifact from 1.x, 1.1, 1.0 branches to run BWC tests 😁, I can double check this by running ./gradlew check after unset JAVA14_HOME.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is the console output:

> Task :distribution:bwc:bugfix:checkoutBwcBranch
Performing checkout of opensearch-project/1.0...
Checkout hash for :distribution:bwc:bugfix is a70cc74cbfe0690cf3b082147dccaef880425934

> Task :distribution:bwc:bugfix:buildBwcLinuxTar FAILED

...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':distribution:bwc:bugfix:buildBwcLinuxTar'.
> JAVA14_HOME required

😐 It's a bit cumbersome to keep the same build requirement for version 1.0 with Elasticsearch.

Copy link
Member

Choose a reason for hiding this comment

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

I think we need both :(

Copy link
Member Author

Choose a reason for hiding this comment

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

@dblock Should we change anything here? It is indeed true that JAVA14_HOME is required to run ./gradlew check (I even tried setting that env variable to a Java 17 JDK but there's a check that explicitly fails in that case). It seems not great to require contributors to install an end-of-life JDK.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@andrross sadly we cannot drop JAVA14_HOME, @dblock is correct, it is needed for BWC checks

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm suggesting that we change the older branches to allow them to build against Java 11 or 17 instead of requiring Java 14. I admit that I don't fully understand the implications of backporting such a change, though the benefit is that contributors would not be required to install an end-of-life and unsupported JDK.

Copy link
Member

Choose a reason for hiding this comment

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

Changing what we have released feels wrong to me. Running bcw tests means using the JDK used for that release, and that's unfortunately 14.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated the document to specify a location to download JDK 14. Please let me know if there's a better place to link to. I've also removed reference to JDK17 and setting JAVA17_HOME because in my testing it is not required in order to get ./gradlew check to pass (I may be missing something, but the only time I see JDK 17 being used is if I explicitly specify -Druntime.java=17)

@andrross andrross changed the title Fix documentation reference from Java 14 to 17 Update developer guide reference to download JDK 14 Nov 10, 2021
@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Wrapper Validation success 862b366

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Precommit success 862b366

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success 862b366
Log 1029

Reports 1029

@dblock dblock merged commit c437b34 into opensearch-project:main Nov 11, 2021
@andrross andrross deleted the java-version-doc branch November 12, 2021 17:41
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.

5 participants