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

Setup Java 21 container #28833

Merged
merged 6 commits into from
Oct 12, 2023
Merged

Setup Java 21 container #28833

merged 6 commits into from
Oct 12, 2023

Conversation

Abacn
Copy link
Contributor

@Abacn Abacn commented Oct 4, 2023

Part of #28120

After this PR, beam will start publishing java21 dev sdk container. A wordcount compiled with Java21 locally and run on Dataflow v2 with this container has passed.

Please add a meaningful description for your change here


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Merging #28833 (95a06c6) into master (104c10b) will increase coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #28833      +/-   ##
==========================================
+ Coverage   72.16%   72.19%   +0.02%     
==========================================
  Files         686      686              
  Lines      101560   101590      +30     
==========================================
+ Hits        73287    73338      +51     
+ Misses      26695    26671      -24     
- Partials     1578     1581       +3     
Flag Coverage Δ
go 53.49% <ø> (+0.07%) ⬆️
python 82.61% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 19 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Abacn Abacn force-pushed the java21container branch 4 times, most recently from 2552df3 to ca9ad81 Compare October 5, 2023 22:07
@Abacn
Copy link
Contributor Author

Abacn commented Oct 6, 2023

Example wordcount job (maven project) on Dataflow: https://console.cloud.google.com/dataflow/jobs/us-central1/2023-10-05_17_20_31-16427189156223040319?project=google.com%3Aclouddfe

image

However not able to setup Java21 test within beam repo yet as gradle not yet support Java 21. Currently Java invocation fails with

Unrecognized option: --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

but if not providing these args, it fails with

warning: The Checker Framework is tested with JDK 8, 11, 17, and 18. You are using version 21.
error: warnings found and -Werror specified
/Users/yathu/beam/sdks/java/testing/jpms-tests/src/main/java/org/apache/beam/sdk/jpmstests/WordCount.java:38: error: [type.checking.not.run] NullnessChecker did not run because of a previous error issued by javac
public class WordCount {

@@ -95,7 +95,7 @@ jobs:
-PloadTest.mainClass=org.apache.beam.sdk.loadtests.GroupByKeyLoadTest \
-Prunner=:runners:google-cloud-dataflow-java \
-Prunner.version=V2 \
-PcompileAndRunTestsWithJava11 \
-PtestJavaVersion=11 \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this flag change is to address #28726 (comment) (later planned as part of Java21 support: #28120 (comment))

@Abacn Abacn changed the title [Draft] Setup Java 21 container Setup Java 21 container Oct 6, 2023
@@ -0,0 +1,10 @@
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

although same options are added as java17, it seems jamm still not working on Java21:

JVM prevents jamm from accessing subgraph - cache sizes may be underestimated

support left as next task

@Abacn Abacn marked this pull request as ready for review October 6, 2023 02:25
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2023

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

ARG java_version
FROM eclipse-temurin:${java_version}
FROM ${base_image}:${java_version}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we switched from openjdk to temurin in #25402 due to that openjdk image for java8 and 11 was deprecated. For now we still use temurin for 8,11,17; openjdk for 21 temporarily until upstream https://adoptium.net/blog/2023/09/temurin21-delay/ resolved

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2023

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @kennknowles for label java.
R: @damccorm for label build.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@Abacn Abacn changed the title Setup Java 21 container [Do not merge until 2.51 released] Setup Java 21 container Oct 9, 2023
@Abacn
Copy link
Contributor Author

Abacn commented Oct 9, 2023

Because this PR changed test parameters (Jenkins, GHA), should be merged after 2.51.0 release finalized

@Abacn Abacn mentioned this pull request Oct 10, 2023
3 tasks
@Abacn
Copy link
Contributor Author

Abacn commented Oct 10, 2023

Note that temurin java21 has released in Oct 10th: https://adoptium.net/temurin/releases/

@Abacn
Copy link
Contributor Author

Abacn commented Oct 11, 2023

Run Java PreCommit

@Abacn
Copy link
Contributor Author

Abacn commented Oct 11, 2023

Run PythonDocker PreCommit

@Abacn
Copy link
Contributor Author

Abacn commented Oct 11, 2023

Run Python_PVR_Flink PreCommit

@Abacn
Copy link
Contributor Author

Abacn commented Oct 11, 2023

Run Portable_Python PreCommit

@Abacn
Copy link
Contributor Author

Abacn commented Oct 11, 2023

Run Java_PVR_Flink_Docker PreCommit

@Abacn Abacn changed the title [Do not merge until 2.51 released] Setup Java 21 container Setup Java 21 container Oct 12, 2023
@Abacn
Copy link
Contributor Author

Abacn commented Oct 12, 2023

tests either passed on GHA or Jenkins, merging

@Abacn Abacn merged commit e8e3814 into apache:master Oct 12, 2023
40 of 43 checks passed
@Abacn Abacn deleted the java21container branch October 12, 2023 01:16
damccorm added a commit that referenced this pull request Oct 12, 2023
Abacn pushed a commit that referenced this pull request Oct 13, 2023
damondouglas pushed a commit to damondouglas/beam that referenced this pull request Oct 16, 2023
* Add Java21 container

* fix spotless

* Update website

* Fix jamm

* align configs in recent change
damondouglas pushed a commit to damondouglas/beam that referenced this pull request Oct 16, 2023
Abacn added a commit to Abacn/beam that referenced this pull request Oct 17, 2023
* Add Java21 container

* fix spotless

* Update website

* Fix jamm

* align configs in recent change
Abacn added a commit that referenced this pull request Oct 20, 2023
* Setup Java 21 container (#28833)

* Add Java21 container

* fix spotless

* Update website

* Fix jamm

* align configs in recent change

* incremental fixes

* add more comments for when jpms test enabled
kkdoon pushed a commit to twitter-forks/beam that referenced this pull request Oct 21, 2023
* Setup Java 21 container (apache#28833)

* Add Java21 container

* fix spotless

* Update website

* Fix jamm

* align configs in recent change

* incremental fixes

* add more comments for when jpms test enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants