-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Lower build requirement from Java 14+ to Java 11+ #636
Conversation
✅ DCO Check Passed 89478ea |
✅ Gradle Wrapper Validation success 89478ea |
✅ Gradle Wrapper Validation success bc72cd3 |
✅ DCO Check Passed bc72cd3 |
✅ Gradle Precommit success bc72cd3 |
I like this, thanks! We also need to lower the Java version in CI, I am not sure where that is. |
@dblock Just to be clear this doesn't change how the test suite runs or what is packaged. E.G. if you use java 11 to build, it still downloads java 15 into your gradle caches and uses that java 15 jvm to run unit tests, and it still creates packages in So it really only impacts gradle and javac, but I think it makes life easier for developers, packagers, etc. But yes, agree it would be nice for CI to use the minimum required build version to ensure that you can build with java 11. |
I think I'm saying the same thing. If we don't include building with Java 11 in CI, we will keep breaking this "minimum" version. I just don't know where that change needs to be. |
Yeah, I'm not sure either. Maybe it is just whatever happens to be in |
@bbarani @peterzhuamazon do you guys know where to change this as part of this PR? |
DEVELOPER_GUIDE.md
Outdated
@@ -50,7 +50,7 @@ sdk install java 14.0.2-open | |||
sdk use java 14.0.2-open |
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.
should these be updated as well?
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.
yep
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'm not familiar with this sdk
tool, so I wasn't sure what to do here. By only requiring the LTS java 11, the user could probably just avoid this tool and use their normal system package manager?
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.
It's here as just an example, swap 14 -> 11 and we're good to go?
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'd prefer to remove it. I have no idea how to test my instructions. Sorry if it comes across as rude, but I'm seriously not gonna run any curl | bash
stuff.
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.
deleting the block makes more sense to me
there are other ways to manage different versions of java locally
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.
FWIW I added this because I was trying to make it super simple for someone to start contributing and the sdk tool is super popular in my world, along with the equivalents of nvm
for node or rvm
for ruby. I am always puzzled why people hand-install SDKs when this is so much easier. Obviously | sh
anything can be replaced by a download or a brew install
for Mac or whatever.
No strong feelings if you want to just remove this as part of this PR.
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.
ok, ill nuke it. I think telling the user how to install java is helpful when you're asking someone to install a specific EOL/unsupported version of java such as 14: it is indeed obscure to locate and install it, it's been unsupported since september 2020.
But, now that problem goes away if the build works with LTS 11+: really things will just work. I don't install any software outside of package manager for a large number of reasons (it will be maintained and patched, stay compatible across upgrades, get security fixes, get catalogued properly in the local package registry, dependencies will be taken care of, ...).
I really have no idea what this sdkman.io is going to do to my computer (even looking at the script it runs, which seems to download more code and then run that).
java 11 is widely available via any standard package manager, whether that's ancient centos 7 yum or bleeding edge arch's pacman. And if you want to install java manually, its easy to get from adoptopenjdk too. So java 11 is a way simpler ask on any user and I don't think we need to instruct users on how to get it.
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.
just as a side, as far as this specific tool piping curl through bash, I am also super suspicious about stuff like that, and don't think we should suggest it to users. I know there are some defenders of the curl | bash
, yet we still problems from this stuff such as https://thenewstack.io/not-your-usual-supply-chain-hack-the-codecov-bash-uploader-blunder/
at my job at least, given recent supply chain attacks in the news, there is a lot of tightening of controls around this kind of stuff.
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.
Thanks for calling this out.
start gradle check |
I am not sure we should merge this without lowering the CI Java version, @nknize |
The failure there is unrelated to this PR. It is the typical flaky failure caused by assertBusy() stuff in those integration tests. This assert is very confusing, does multiple invocations with arbitrary sleep() calls, and then assertions fail because tasks happen to not complete within some timeframe.
|
Thanks @rmuir. You're right about those tests. Let's leave this open for now and I'll try to chase what's going on for builds. I don't want to be saying use Java 11 and not be running it in CI, but we'll get to it sooner than later. |
✅ DCO Check Passed 4f0b498 |
✅ Gradle Wrapper Validation success 4f0b498 |
✅ Gradle Precommit success 4f0b498 |
10 days old since last auto update so labeling this as blocked by CI before it goes stale and forgotten |
yeah i've already given up. there's nothing wrong with the PR, you can merge it. And there's nothing i can do about your CI system not testing everything you want, its not transparent and should be solved separately. |
start gradle check |
I agree. Two weeks of no CI movement shouldn't prevent a valid PR from being merged. |
+1, this will make the
Hmm, where is that CI Java version configured? Is that configuration open-source? Someone could make a quick PR to fix the CI too? |
Unfortunately not yet, cc: @bbarani. |
OK I see, that's too bad -- is there a process to track that internal fix? Maybe we should open a dedicated GitHub issue to switch the internal CI build to JDK 11, and mark it as a blocker for this PR? And maybe we should also open a separate issue to improve the CI configuration/build to be visible to the full community? |
Great idea. And done here Marking this as stalled. |
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.
Unfortunate that this has stalled for two months. Opened a blocker issue on the devops repo to try and move this forward.
Well, if we don't both build and run tests on Java 11 we don't know if it works. |
you can be damn sure it doesn't work on Java 11 right now! And from the looks of things, never will. You can be part of the solution instead of part of the problem. Just let go, let this be a community project instead of an amazon one. |
You're right. Let me try. We got a Jenkins instance with configuration that is not open-source, that is hard-coding JAVA 14. I believe nobody opened an issue on this in https://github.com/opensearch-project/opensearch-build until @nknize did, so this just wasn't seen. My bad too. That CI is owned by @bbarani, I'll make sure he sees it this time. I really dislike the non-open-source CI - we should be able to modify which version of Java we're building with in this repo. I opened #881 to track that. The long version is that we had built out a Jenkins cluster for CI that uses very large amounts of hardware to get fast builds and run integration tests. That's what is kicked off when you see those |
Hi @rmuir could you fix the conflicts of the PR? |
✅ Gradle Wrapper Validation success 4f0b498 |
✅ DCO Check Passed 4f0b498 |
✅ Gradle Precommit success 4f0b498 |
c068057
to
a428e6f
Compare
❌ Gradle Wrapper Validation failure c0680575c1d4d9daa3fcf254b8596aee10d489e3 :alert: Gradle Wrapper integrity has been altered |
❌ DCO Check Failed c0680575c1d4d9daa3fcf254b8596aee10d489e3 |
❌ Gradle Precommit failure c0680575c1d4d9daa3fcf254b8596aee10d489e3 |
I messed up and accidentally force pushed a rewinded branch on rmuir:java_11_build_support. My sincere apologies. I reflog-ed back to it. @rmuir - GitHub won't let me re-force push up to your fork because I suppose the PR is closed. Maybe if you want to force push your local version back up if you have a chance. I'm finishing this in #940. Thanks for the hard work on this PR and apologies for taking so long (I went offline for a week which didn't help). |
#940 was merged. I'm tracking down opensearch-project/opensearch-build#74 now. |
FYI we still haven't switched infra, despite claims of such earlier, I reopened opensearch-project/opensearch-build#74 |
…opensearch-project#636) * Bump org.apache.httpcomponents.core5:httpcore5-h2 from 5.2.2 to 5.2.3 Bumps [org.apache.httpcomponents.core5:httpcore5-h2](https://github.com/apache/httpcomponents-core) from 5.2.2 to 5.2.3. - [Changelog](https://github.com/apache/httpcomponents-core/blob/master/RELEASE_NOTES.txt) - [Commits](apache/httpcomponents-core@rel/v5.2.2...rel/v5.2.3) --- updated-dependencies: - dependency-name: org.apache.httpcomponents.core5:httpcore5-h2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Update changelog Signed-off-by: dependabot[bot] <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Currently java14+ is required to use the gradle build. Requiring only java11 makes the source packages easier to consume, because the most recent LTS java release will work fine.
Avoid use of
-Werror -Xlint:all
, which may change significantly across java releases (new warnings could be added). Instead, just list the warnings individually.Workaround JDK 11 compiler bug (JDK-8209058) that only impacts test fixture code in the build itself.
Signed-off-by: Robert Muir [email protected]