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
MINOR: Update to Gradle 6.3 #7677
Conversation
8d35848
to
1d6c9c0
|
Currently blocked by https://issues.apache.org/jira/browse/INFRA-19418 |
|
retest this please |
|
retest this please |
|
retest this please |
|
retest this please |
|
@ijuma I am getting errors when I try "all" targets. not sure if this is due to gradle 6 or my env issue. |
|
@omkreddy Thanks for testing. It looks like that issue happens with trunk too. Is that the case for you too? |
|
@ijuma It happened once. But after killing Gradle Daemon process, it never happened on trunk (ran multiple times). some related links: |
The major improvements are: - Improved incremental compilation for Scala - Support for Java 13 (although some Gradle plugins like spotBugs need to be updated or disabled and Scala inlining needs to be disabled, will do them in a separate change) - Improved scalac reporting, warnings are clearly marked as such, which is very helpful.
|
@omkreddy Given that the Gradle issue doesn't seem to be resolved anytime soon, I moved the logic to run a gradle command with multiple Scala versions to a |
| ./gradlew releaseTarGzAll | ||
| ./gradlewAll test | ||
| ./gradlewAll jar | ||
| ./gradlewAll releaseTarGz |
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.
We also need to update ./gradlew uploadArchivesAll, ./gradlew installAll references below
| cmd("Copying artifacts", "cp %s/core/build/distributions/* %s" % (kafka_dir, artifacts_dir), shell=True) | ||
| cmd("Copying artifacts", "cp -R %s/build/docs/javadoc %s" % (kafka_dir, artifacts_dir)) | ||
| cmd("Building docs", "./gradlew aggregatedJavadoc", cwd=kafka_dir, env=jdk8_env) | ||
| cmd("Copying docs", "cp -R %s/build/docs/javadoc %s" % (kafka_dir, artifacts_dir)) | ||
|
|
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.
need to update ./gradlew uploadArchivesAll at line no: 644
|
The scala compilation get slower after applying this PR ( 3m50.56s -> 4m49.70s). The build command is related issue: gradle/gradle#12591 |
|
@chia7712 That's because you have |
|
One job passed and the other failed with a flaky test failure:
|
thanks for the explanation. My comment was not clear. The question was the clean + build get slower after updating gradle to 6.x (unrelated to this PR. the only change is gradle version). According to the gradle profile report, the duration of compiling scala module become higher ( core: 1m38.90s -> 2m11.35s, streams:streams-scala: 4.525s -> 23.316s). By contrast, the duration of compiling java modules are almost same. loop 5 times and it seems the duration is consistently higher on gradle 6.x |
|
@chia7712 I understood. :) Incremental compilation tracking has a cost. The new version of Gradle uses a new version of Zinc which trades full compilation speed for incremental compilation speed. I think that's fine given that incremental compilation is what developers care most about. |
I wanted to get some feedback on the approach, so I had just sanity checked it. I will do more thorough verification before merging. |
|
@ijuma, would you be so kind to provide a link on that zinc changes if you have it somewhere near you? Upd: got an answer from Guillaume Martres on https://gitter.im/sbt/zinc-contrib they say it is not how zinc behaves, and most probably is bug in Gradle. |
|
@lure In the past, sbt with incremental compiler vs ant has shown similar behavior where the former was faster under incremental compilation while ant was faster under clean builds. The comment in that chat says the build time doubled, but that's not what was reported here ( |
|
That's right, my case shows nearly x2, i.e. 6mins become 11. In my case the problem is reproducible just by replacing Gradle version from 5.6.2 to 6.3. @chia7712 located particular change that introduced regress, I believe? Will check my project module by module, may be it is something else. |
|
It would be great if this is just a regress. :) The issue I observe is reproducible on 6.2 too so it could be the case. |
|
I tested
I think that's OK given the incremental compilation improvements. |
|
@omkreddy I've done a bunch of testing and this seems to work as expected generally. One part that I wasn't completely sure about is the behavior of So, I have decided to go ahead and merge this PR. |
…invocation of `gradle` See apache/kafka#7677 for more details with regards to the former and apache/kafka#6031 with regards to the latter.
* apache-github/trunk: MINOR: Fix grammar in error message for InvalidRecordException (apache#8465) KAFKA-9868: Reduce number of transaction log partitions for embed broker (apache#8522) MINOR: Adding github whitelist (apache#8523) MINOR: Upgrade gradle plugins and test libraries for Java 14 support (apache#8519) MINOR: Further reduce runtime for metrics integration tests (apache#8514) MINOR: Use .asf.yaml to direct github notifications to JIRA and mailing lists (apache#8521) MINOR: Update to Gradle 6.3 (apache#7677) HOTFIX: fix checkstyle error of RocksDBStoreTest and flaky RocksDBTimestampedStoreTest.shouldOpenExistingStoreInRegularMode (apache#8515) MINOR: cleanup RocksDBStore tests (apache#8510) KAFKA-9818: Fix flaky test in RecordCollectorTest (apache#8507) MINOR: reduce impact of trace logging in replica hot path (apache#8468) KAFKA-6145: KIP-441: Add test scenarios to ensure rebalance convergence (apache#8475) KAFKA-9881: Convert integration test to verify measurements from RocksDB to unit test (apache#8501) MINOR: improve test coverage for dynamic LogConfig(s) (apache#7616) MINOR: Switch order of sections on tumbling and hopping windows in streams doc. Tumbling windows are defined as "special case of hopping time windows" - but hopping windows currently only explained later in the docs. (apache#8505) KAFKA-9819: Fix flaky test in StoreChangelogReaderTest (apache#8488)
…invocation of `gradle` (#329) See apache/kafka#7677 for more details with regards to the former and apache/kafka#6031 with regards to the latter.
Gradle 6.5 includes a fix for gradle/gradle#12866, which affects the performance of Scala compilation. I profiled the scalac build with async profiler and 54% of the time was on GC even after the Gradle upgrade (it was more than 60% before), so I switched to the throughput GC (GC latency is less important for batch builds) and it was reduced to 38%. I also centralized the jvm configuration in `build.gradle` and simplified it a bit by removing the minHeapSize configuration from the test tasks. On my desktop, the time to execute clean builds with no cached Gradle daemon was reduced from 127 seconds to 97 seconds. With a cached daemon, it was reduced from 120 seconds to 88 seconds. The performance regression when we upgraded to Gradle 6.x was 27 seconds with a cached daemon (#7677 (comment)), so it should be fixed now. Gradle 6.4 with no cached daemon: ``` BUILD SUCCESSFUL in 2m 7s 115 actionable tasks: 112 executed, 3 up-to-date ./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.15s user 0.12s system 0% cpu 2:08.06 total ``` Gradle 6.4 with cached daemon: ``` BUILD SUCCESSFUL in 2m 0s 115 actionable tasks: 111 executed, 4 up-to-date ./gradlew clean compileScala compileJava compileTestScala compileTestJava 0.95s user 0.10s system 0% cpu 2:01.42 total ``` Gradle 6.5 with no cached daemon: ``` BUILD SUCCESSFUL in 1m 46s 115 actionable tasks: 111 executed, 4 up-to-date ./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.12s system 1% cpu 1:47.71 total ``` Gradle 6.5 with cached daemon: ``` BUILD SUCCESSFUL in 1m 37s 115 actionable tasks: 111 executed, 4 up-to-date ./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:38.31 total ``` This PR with no cached Gradle daemon: ``` BUILD SUCCESSFUL in 1m 37s 115 actionable tasks: 81 executed, 34 up-to-date ./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.10s system 1% cpu 1:38.70 total ``` This PR with cached Gradle daemon: ``` BUILD SUCCESSFUL in 1m 28s 115 actionable tasks: 111 executed, 4 up-to-date ./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:29.35 total ``` Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
Gradle 6.5 includes a fix for gradle/gradle#12866, which affects the performance of Scala compilation. I profiled the scalac build with async profiler and 54% of the time was on GC even after the Gradle upgrade (it was more than 60% before), so I switched to the throughput GC (GC latency is less important for batch builds) and it was reduced to 38%. I also centralized the jvm configuration in `build.gradle` and simplified it a bit by removing the minHeapSize configuration from the test tasks. On my desktop, the time to execute clean builds with no cached Gradle daemon was reduced from 127 seconds to 97 seconds. With a cached daemon, it was reduced from 120 seconds to 88 seconds. The performance regression when we upgraded to Gradle 6.x was 27 seconds with a cached daemon (#7677 (comment)), so it should be fixed now. Gradle 6.4 with no cached daemon: ``` BUILD SUCCESSFUL in 2m 7s 115 actionable tasks: 112 executed, 3 up-to-date ./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.15s user 0.12s system 0% cpu 2:08.06 total ``` Gradle 6.4 with cached daemon: ``` BUILD SUCCESSFUL in 2m 0s 115 actionable tasks: 111 executed, 4 up-to-date ./gradlew clean compileScala compileJava compileTestScala compileTestJava 0.95s user 0.10s system 0% cpu 2:01.42 total ``` Gradle 6.5 with no cached daemon: ``` BUILD SUCCESSFUL in 1m 46s 115 actionable tasks: 111 executed, 4 up-to-date ./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.12s system 1% cpu 1:47.71 total ``` Gradle 6.5 with cached daemon: ``` BUILD SUCCESSFUL in 1m 37s 115 actionable tasks: 111 executed, 4 up-to-date ./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:38.31 total ``` This PR with no cached Gradle daemon: ``` BUILD SUCCESSFUL in 1m 37s 115 actionable tasks: 81 executed, 34 up-to-date ./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.10s system 1% cpu 1:38.70 total ``` This PR with cached Gradle daemon: ``` BUILD SUCCESSFUL in 1m 28s 115 actionable tasks: 111 executed, 4 up-to-date ./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:29.35 total ``` Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>


gradlewAllscript to replace*Alltasks since the approachused by the latter doesn't work since Gradle 6.0 and it's unclear when,
if ever, it will work again ( see gradle/gradle#11301).
The major improvements in Gradle 6.0 to 6.3 are:
like spotBugs may need to be updated or disabled,
will do that separately)
marked as such, which is very helpful.
Tested
gradlewAllmanually for the commands listed in the READMEand release script. For
uploadArchive, I tested it with a local Mavenrepository.
Committer Checklist (excluded from commit message)
The text was updated successfully, but these errors were encountered: