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

Run CI on JDK 8, 11, and 14. #130

Merged
merged 4 commits into from
Mar 5, 2022

Conversation

dblock
Copy link
Member

@dblock dblock commented Mar 1, 2022

Signed-off-by: dblock dblock@dblock.org

Description

Copy-paste from opensearch-project/common-utils#121.

Issues Resolved

Closes #103.

Check List

  • New functionality includes testing.
    • All tests pass
  • 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.

@dblock dblock requested a review from a team March 1, 2022 17:19
Signed-off-by: dblock <dblock@dblock.org>
@dblock
Copy link
Member Author

dblock commented Mar 1, 2022

17

Failing with

A problem occurred evaluating root project 'opensearch-job-scheduler'.
> Failed to apply plugin class 'de.thetaphi.forbiddenapis.gradle.ForbiddenApisPlugin'.
   > Could not create plugin of type 'ForbiddenApisPlugin'.
      > Could not initialize class de.thetaphi.forbiddenapis.gradle.ForbiddenApisPlugin

8

Failing with

A problem occurred evaluating root project 'opensearch-job-scheduler'.
> Failed to apply plugin 'opensearch.opensearchplugin'.
   > Could not create plugin of type 'PluginBuildPlugin'.
      > Could not generate a decorated class for type PluginBuildPlugin.
         > org/opensearch/gradle/plugin/PluginPropertiesExtension has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0

@reta Any ideas here? Seems like for 8 it means having to go and build OpenSearch gradle extensions with JDK 8, and for 17 I am not sure.

@reta
Copy link
Contributor

reta commented Mar 1, 2022

@reta Any ideas here? Seems like for 8 it means having to go and build OpenSearch gradle extensions with JDK 8, and for 17 I am not sure.

@dblock this is interesting, looking now

@reta
Copy link
Contributor

reta commented Mar 1, 2022

@dblock ahhh ... here we are, Gradle 6.x does not support JDK-17 .... (in core we use JDK-11 to run Gradle but then JDK-17 is "injected" to run tests)

and indeed, build-tools are requiring JDK-10 at least

  allprojects {
    targetCompatibility = 10
    sourceCompatibility = 10
  }

so artifacts are not consumable by JDK-8

@dblock
Copy link
Member Author

dblock commented Mar 1, 2022

@dblock ahhh ... here we are, Gradle 6.x does not support JDK-17 .... (in core we use JDK-11 to run Gradle but then JDK-17 is "injected" to run tests)

Do you know how or have any ideas how to solve this for a plugin?

and indeed, build-tools are requiring JDK-10 at least

  allprojects {
    targetCompatibility = 10
    sourceCompatibility = 10
  }

so artifacts are not consumable by JDK-8

I could change that to 8, would that make sense/work?

@reta
Copy link
Contributor

reta commented Mar 1, 2022

Do you know how or have any ideas how to solve this for a plugin?

We need Gradle 7+ but it won't work for 1.3 :( since the build-tools are not compatible). We could branch off 1.x for the plugin and move main to 2.0, that would unblock JDK-17

I could change that to 8, would that make sense/work?

We could try, yeah, I don't know the prehistory of JDK-10 compatibility sadly

@dblock
Copy link
Member Author

dblock commented Mar 1, 2022

@reta would you give up on using JDK17 at runtime for 1.3.0?

Note that we also found opensearch-project/security#1653

@reta
Copy link
Contributor

reta commented Mar 1, 2022

@dblock Gradle 7 is a major blocker here, going with 11 for 1.3 looks acceptable, moreover we know right now that some plugins are not compatible with JDK-17 (and not sure about JDK-16 since the reflective access started to tighten there).

@dblock
Copy link
Member Author

dblock commented Mar 1, 2022

@dblock Gradle 7 is a major blocker here, going with 11 for 1.3 looks acceptable, moreover we know right now that some plugins are not compatible with JDK-17 (and not sure about JDK-16 since the reflective access started to tighten there).

Yep :(

I've edited opensearch-project/opensearch-plugins#64 to reflect what we think we want in 1.3.0.

Signed-off-by: dblock <dblock@dblock.org>
@dblock
Copy link
Member Author

dblock commented Mar 4, 2022

I tried this again now that we have 1.8 binaries, and for the life of me I cannot figure out where this --release flag is appended (something thinks we're JDK 9+, --release is not supported in 8).

export JAVA_HOME=$JAVA8_HOME
./gradlew build

Execution failed for task ':opensearch-job-scheduler-spi:compileJava'.
> invalid flag: --release

I also tried building 11 and running tests on 8, but can't get compilation for the spi package to be skipped as it keeps thinking it's not incremental.

@reta ideas?

@reta
Copy link
Contributor

reta commented Mar 4, 2022

dblock added 2 commits March 4, 2022 22:48
Signed-off-by: dblock <dblock@dblock.org>
Signed-off-by: dblock <dblock@dblock.org>
@dblock dblock changed the title Run CI on JDK 8, 11, 14 and 17. Run CI on JDK 8, 11, and 14. Mar 4, 2022
@dblock
Copy link
Member Author

dblock commented Mar 4, 2022

Updated this PR to build on 8, 11 and 14. Punting 17 for post 1.3.0 when we upgrade to Gradle 7 and drop JDK8.

@reta
Copy link
Contributor

reta commented Mar 4, 2022

@dblock JDK-8 is green, but for JDK-17 we may need a stretch with Gradle 7 ... I could submit the change but we need to branch off 2.0 or/and 1.x

@dblock
Copy link
Member Author

dblock commented Mar 4, 2022

@dblock JDK-8 is green, but for JDK-17 we may need a stretch with Gradle 7 ... I could submit the change but we need to branch off 2.0 or/and 1.x

We'll do this part of 2.0.

@saratvemulapalli saratvemulapalli merged commit fca5093 into opensearch-project:main Mar 5, 2022
wuychn pushed a commit to ochprince/job-scheduler that referenced this pull request Mar 16, 2023
* Run CI on JDK 8, 11, 14 and 17.

Signed-off-by: dblock <dblock@dblock.org>

* Build with 11 and test on 8.

Signed-off-by: dblock <dblock@dblock.org>

* Build and test using JDK 8.

Signed-off-by: dblock <dblock@dblock.org>

* Remove JDK17, requires Gradle 7.

Signed-off-by: dblock <dblock@dblock.org>
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.

Default CI Java Version to Java 11, run tests on 8, 14 and 17
4 participants