Commit Graph

25 Commits

Author SHA1 Message Date
Ismael Juma 99e6f12dd0
KAFKA-15485: Support Java 21 (3/3) (#14433)
* Update CI to build with Java 21 instead of Java 20
* Disable spotbugs when building with Java 21 as it doesn't support it yet (filed KAFKA-15492 for
   addressing this)
* Disable SslTransportLayerTest.testValidEndpointIdentificationCN with Java 21 (same as Java 20)

Reviewers: Divij Vaidya <diviv@amazon.com>
2023-09-25 05:17:08 -07:00
Chris Egerton d91c9bd2b5
KAFKA-14682: Report Mockito unused stubbings during Jenkins build (#14186)
* KAFKA-14682: Report Mockito unused stubbings during Jenkins build

* DO NOT MERGE: Add test case that should fail during Jenkins build

* Revert "DO NOT MERGE: Add test case that should fail during Jenkins build"

This reverts commit 8418b835ec.
2023-08-12 16:52:49 -04:00
Ismael Juma 1f4cbc5d53
MINOR: Add JDK 20 CI build and remove some branch builds (#12948)
It's good for us to add support for Java 20 in preparation for Java 21 - the next LTS.

Given that Scala 2.12 support has been deprecated, a Scala 2.12 variant is not included.

Also remove some branch builds that add load to the CI, but have
low value: JDK 8 & Scala 2.13 (JDK 8 support has been deprecated),
JDK 11 & Scala 2.12 (Scala 2.12 support has been deprecated) and
JDK 17 & Scala 2.12 (Scala 2.12 support has been deprecated).

A newer version of Mockito (4.9.0 -> 4.11.0) is required for Java 20 support, but we
only use it with Scala 2.13+ since it causes compilation errors with Scala 2.12. Similarly,
we upgrade easymock when the Java version is 16 or newer as it's incompatible
with powermock (which doesn't support Java 16 or newer).

Filed KAFKA-15117 for a test that fails with Java 20 (SslTransportLayerTest.testValidEndpointIdentificationCN).

Finally, fixed some lossy conversions that were added after #13582 was submitted.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2023-06-30 01:12:00 -07:00
Ismael Juma 4441a01bb0
MINOR: Enable spotless for streams-scala when Java 11+ is used (#13311)
Also re-enable it in CI. We do this by adjusting the `Jenkinsfile`
to use a more general task (`./gradlew check -x test`).

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Dejan Stojadinović <dejan2609@users.noreply.github.com>
2023-02-27 00:28:19 -08:00
Dejan Stojadinović 97efdc65f0
KAFKA-14728: Don't run 'spotlessScalaCheck' in CI (#13263)
Blocks #13205.

Rationale:
- build works fine in trunk with Gradle 7.6 and spotless gradle plugin 6.13.0 for all currently used JDK versions (that is: JDK 8 / JDK 11 / JDK 17)
- however, recent spotless gradle plugin versions (6.14.+) support only JDK 11+ versions: https://github.com/diffplug/spotless/blob/main/plugin-gradle/CHANGES.md#6140---2023-01-26
- given a fact that Kafka still needs to support JDK 8 builds (until Kafka version 4.0) it is reasonable to simply remove spotless checks out of Jenkinsfile (and re-introduce them when the time comes).

For even more details see GitHub discussion here: https://github.com/apache/kafka/pull/13205#issuecomment-1431575644

Reviewers: Ismael Juma <ismael@juma.me.uk>
2023-02-23 05:46:53 -08:00
David Jacot 2d6357f6fc
MINOR; Avoid unnecessarily requesting node for post step in Jenkinsfile (#12939)
Pull requests' builds are often waiting unnecessarily on getting an ubuntu node in the post step. The post step sends out an email to the dev mailing list but it does so only for regular branches. For pull requests, it does nothing. However, the check to verify if the build is for a pull request is executed when the node is allocated so the build has to wait for it.

![Screenshot 2022-12-05 at 13 42 58](https://user-images.githubusercontent.com/157182/205639994-afc09ffa-475e-41ae-9e33-86e0dfe4d998.png)

With this change, the check is executed before requesting the node so it does not unnecessarily request a node if one is not needed.

![Screenshot 2022-12-05 at 13 43 21](https://user-images.githubusercontent.com/157182/205640048-57264a1c-3fa4-4c71-9b3d-12fb43490d68.png)

Note that I have verified that sending the email still works with this change (see fc74c8375a).

Reviewers: Mickael Maison <mickael.maison@gmail.com>
2022-12-05 16:42:07 +01:00
Ismael Juma 52bb677bbe
MINOR: Reuse gradle daemon for scala compilation by default (#12280)
The time time to compile was reduced from 5.3 seconds to 0.9 seconds by
changing the keep alive mode from `SESSION` to `DAEMON`. We change the
default to the latter and allow the former to be set via a `keepAliveMode`
property.

Also update the Jenkins build to use `keepAliveMode="session"` instead of
`--no-daemon`.

./gradlew compileTestScala -PkeepAliveMode="daemon" --info:

> Task :streams:streams-scala:compileTestScala
> Watching 928 directories to track changes
> Caching disabled for task ':streams:streams-scala:compileTestScala' because:
>   Build cache is disabled
> Task ':streams:streams-scala:compileTestScala' is not up-to-date because:
>   Input property 'source' file /home/ijuma/src/kafka/streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/JoinedTest.scala has changed.
> Watching 920 directories to track changes
> Watching 919 directories to track changes
> Compiling with Zinc Scala compiler.
> Prepared Zinc Scala inputs: 0.004 secs
> compiling 16 Scala sources to /home/ijuma/src/kafka/streams/streams-scala/build/classes/scala/test ...
> done compiling
> Completed Scala compilation: 0.925 secs

./gradlew compileTestScala -PkeepAliveMode="session" --info

> Task :streams:streams-scala:compileTestScala
> Watching 928 directories to track changes
> Caching disabled for task ':streams:streams-scala:compileTestScala' because:
>   Build cache is disabled
> Task ':streams:streams-scala:compileTestScala' is not up-to-date because:
>   Input property 'source' file /home/ijuma/src/kafka/streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/JoinedTest.scala has changed.
> Watching 920 directories to track changes
> Watching 919 directories to track changes
> Starting process 'Gradle Worker Daemon 3'. Working directory: /home/ijuma/.gradle/workers Command: /usr/java/jdk-17.0.4.1+1/bin/java -Xss4m -XX:+UseParallelGC --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.file=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.util.stream=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED @/home/ijuma/.gradle/.tmp/gradle-worker-classpath3305983246500958050txt -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Worker Daemon 3'
> Successfully started process 'Gradle Worker Daemon 3'
> Started Gradle worker daemon (0.244 secs) with fork options DaemonForkOptions{executable=/usr/java/jdk-17.0.4.1+1/bin/java, minHeapSize=null, maxHeapSize=2048m, jvmArgs=[-Xss4m, -XX:+UseParallelGC, --add-opens=java.base/java.io=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/java.nio.file=ALL-UNNAMED, --add-opens=java.base/java.util=ALL-UNNAMED, --add-opens=java.base/java.util.concurrent=ALL-UNNAMED, --add-opens=java.base/java.util.regex=ALL-UNNAMED, --add-opens=java.base/java.util.stream=ALL-UNNAMED, --add-opens=java.base/java.text=ALL-UNNAMED, --add-opens=java.base/java.time=ALL-UNNAMED, --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED], keepAliveMode=SESSION}.
> Compiling with Zinc Scala compiler.
> Prepared Zinc Scala inputs: 0.187 secs
> compiling 16 Scala sources to /home/ijuma/src/kafka/streams/streams-scala/build/classes/scala/test ...
> done compiling
> Completed Scala compilation: 5.307 secs

See https://github.com/gradle/gradle/issues/20579 for more details.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2022-12-01 05:33:43 -08:00
Ismael Juma 9237c47d3f
MINOR; Retry on test failure for branch builds and increase max test retry to 10 (#12601)
Originally, we only enabled retries for PR builds to avoid hiding timing
related issues. In practice, however, the results are too noisy without
any retry due to various environmental issues.

Enable 1 retry for all builds and increase the max test retry to 10.

Reviewers: José Armando García Sancio <jsancio@users.noreply.github.com>
2022-09-08 08:00:16 -07:00
Ismael Juma 30decbe3ef
MINOR: Enable "abort previous builds" for PRs (#12588)
When a new commit is pushed to a PR, we should abort the build
and start a new one instead of queuing one build per commit.
This reduces wasted resources and provides the desired feedback
faster (since we only care about the build results for the last
commit in the PR).

Reviewers: Luke Chen <showuon@gmail.com>
2022-09-06 20:20:22 -07:00
Jason Gustafson 3d9a5f6ae3
KAFKA-14163; Retry compilation after zinc compile cache error (#12507)
We have been seeing builds fail due to errors such as the following:
```
Timeout waiting to lock zinc-1.6.1_2.13.8_17 compiler cache (/home/jenkins/.gradle/caches/7.5.1/zinc-1.6.1_2.13.8_17). It is currently in use by another Gradle instance.
```
This patch includes a workaround: if the compilation fails due to this zinc compile cache error, then we retry it.

Reviewers: Ismael Juma <ismael@juma.me.uk>

Co-authored-by: Lucas Bradstreet <lucasbradstreet@gmail.com>
2022-08-11 14:00:06 -07:00
Jason Gustafson 64c72c2eff
MINOR: Remove ARM/PowerPC builds from Jenkinsfile (#12380)
Reviewers: Colin P. McCabe <cmccabe@apache.org>, Ismael Juma <ismael@juma.me.uk>
2022-08-03 15:34:31 -07:00
Jason Gustafson 24261b93bc
KAFKA-13941; Reenable ARM in Jenkinsfile (#12221)
This patch reenables the ARM build in Jenkins since https://issues.apache.org/jira/browse/INFRA-23305 has been resolved.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2022-05-27 13:22:07 -07:00
David Arthur 8fe73648e3
MINOR: Disable ARM builds (#12220)
Also add an additional stage to ARM and PowerPC builds which will fail-fast if the agent is not available.

Reviewers: Jason Gustafson <jason@confluent.io>
2022-05-26 16:09:39 -04:00
Mickael Maison bbb2dc54a0
KAFKA-13671: Add ppc64le build stage (#11833)
Reviewers: David Arthur <mumrah@gmail.com>
2022-03-07 10:18:54 +01:00
Ismael Juma 0118330103
KAFKA-13273: Add support for Java 17 (#11296)
Java 17 is at release candidate stage and it will be a LTS release once
it's out (previous LTS release was Java 11).

Details:
* Replace Java 16 with Java 17 in Jenkins and Readme.
* Replace `--illegal-access=permit` (which was removed from Java 17)
   with  `--add-opens` for the packages we require internal access to.
   Filed KAFKA-13275 for updating the tests not to require `--add-opens`
   (where possible).
* Update `release.py` to use JDK8. and JDK 17 (instead of JDK 8 and JDK 15).
* Removed all but one Streams test from `testsToExclude`. The
   Connect test exclusion list remains the same.
* Add notable change to upgrade.html
* Upgrade to Gradle 7.2 as it's required for proper Java 17 support.
* Upgrade mockito to 3.12.4 for better Java 17 support.
* Adjusted `KafkaRaftClientTest` and `QuorumStateTest` not to require
   private access to `jdk.internal.util.random`.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2021-09-06 08:55:52 -07:00
Ismael Juma 855011f92a
MINOR: Upgrade Gradle to 7.1.1 and remove JDK 15 build (#10968)
Gradle 7.1 improves Java incremental compilation:
https://docs.gradle.org/7.1.1/release-notes.html

We previously kept the JDK 15 build because some
tests didn't work with JDK 16. Since then, a number
of PRs were submitted to fix this so it's best
to remove the JDK 15 build before we create the
3.0 release branch.

Finally bump `test-retry` gradle plugin version too.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Luke Chen <showuon@gmail.com>
2021-07-04 10:55:16 -07:00
Ismael Juma 530224e4fe
KAFKA-12940: Enable JDK 16 builds in Jenkins (#10702)
JDK 15 no longer receives updates, so we want to switch from JDK 15 to JDK 16.
However, we have a number of tests that don't yet pass with JDK 16.

Instead of replacing JDK 15 with JDK 16, we have both for now and we either
disable (via annotations) or exclude (via gradle) the tests that don't pass with
JDK 16 yet. The annotations approach is better, but it doesn't work for tests
that rely on the PowerMock JUnit 4 runner.

Also add `--illegal-access=permit` when building with JDK 16 to make MiniKdc
work for now. This has been removed in JDK 17, so we'll have to figure out
another solution when we migrate to that.

Relevant JIRAs for the disabled tests: KAFKA-12790, KAFKA-12941, KAFKA-12942.

Moved some assertions from `testTlsDefaults` to `testUnsupportedTlsVersion`
since the former claims to test the success case while the former tests the failure case.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-06-13 08:14:37 -07:00
Ismael Juma 2899200c97
MINOR: Remove gradleSetup from Jenkinsfile (#10522)
We no longer need this since:

1. The PR and branch jobs are configured to `clean before checkout`.
2. The Gradle build outputs the gradle version on start-up.

The description of `clean before checkout` is:

> Clean up the workspace before every checkout by deleting all untracked files and directories, including those which are specified in .gitignore. It also resets all tracked files to their versioned state. This ensures that the workspace is in the same state as if you cloned and checked out in a brand-new empty directory, and ensures that your build is not affected by the files generated by the previous build.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-04-11 22:49:33 -07:00
Ismael Juma 0a8921517f
MINOR: Jenkinsfile's `post` needs `agent` to be set (#10479)
The `node` block achieves that.

Tested that an email was sent to the mailing list for:
592a0c31d5

Added back the condition not to send emails for PR builds after
such test.

Reviewers: Gwen Shapira <cshapi@gmail.com>
2021-04-05 22:20:23 -07:00
Ismael Juma 161c5638b8
KAFKA-12614: Use Jenkinsfile for trunk and release branch builds (#10473)
* Run all JDK/Scala version combinations for trunk/release branch builds.
* Only retry failures in PR builds for now (we can remove this distinction if/when
we report flaky failures as described in KAFKA-12216).
* Disable concurrent builds
* Send email to dev list on build failure
* Use triple double quotes in `doValidation` since we use string interpolation
for `SCALA_VERSION`.
* Update release.py to output new `Unit/integration tests` Jenkins link

Reviewers: Gwen Shapira <cshapi@gmail.com>, David Arthur <mumrah@gmail.com>
2021-04-05 08:42:04 -07:00
Ismael Juma 7a3ebbebbc
KAFKA-12415 Prepare for Gradle 7.0 and restrict transitive scope for non api dependencies (#10203)
Gradle 7.0 is required for Java 16 compatibility and it removes a number of
deprecated APIs. Fix most issues preventing the upgrade to Gradle 7.0.
The remaining ones are more complicated and should be handled
in a separate PR. Details of the changes:

* Release tarball no longer includes includes test, sources, javadoc and test sources jars (these
are still published to the Maven Central repository).
* Replace `compile` with `api` or `implementation` - note that `implementation`
dependencies appear with `runtime` scope in the pom file so this is a (positive)
change in behavior
* Add missing dependencies that were uncovered by the usage of `implementation`
* Replace `testCompile` with `testImplementation`
* Replace `runtime` with `runtimeOnly` and `testRuntime` with `testRuntimeOnly`
* Replace `configurations.runtime` with `configurations.runtimeClasspath`
* Replace `configurations.testRuntime` with `configurations.testRuntimeClasspath` (except for
the usage in the `streams` project as that causes a cyclic dependency error)
* Use `java-library` plugin instead of `java`
* Use `maven-publish` plugin instead of deprecated `maven` plugin - this changes the
commands used to publish and to install locally, but task aliases for `install` and
`uploadArchives` were added for backwards compatibility
* Removed `-x signArchives` line from the readme since it was wrong (it was a
no-op before and it fails now, however)
* Replaces `artifacts` block with an approach that works with the `maven-publish` plugin
* Don't publish `jmh-benchmark` module - the shadow jar is pretty large and not
particularly useful (before this PR, we would publish the non shadow jars)
* Replace `version` with `archiveVersion`, `baseName` with `archiveBaseName` and
`classifier` with `archiveClassifier`
* Update Gradle and plugins to the latest stable version (7.0 is not stable yet)
* Use `plugin` DSL to configure plugins
* Updated notable changes for 3.0

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Randall Hauch <rhauch@gmail.com>
2021-03-04 11:22:22 -08:00
David Arthur f40a82e054
KAFKA-10759 Add ARM build stage (#9992)
Only validation and unit test stages are enabled

Co-authored-by: Peng.Lei <73098678+xiao-penglei@users.noreply.github.com>
2021-03-03 15:57:27 -05:00
Ismael Juma 2db67db8e1
MINOR: Update jdk and maven names in Jenkinsfile (#9453) 2020-10-19 17:54:47 +01:00
David Arthur 12d98a3d7a
Fix streams quickstart in Jenkinsfile (#9285) 2020-09-14 20:23:58 -04:00
David Arthur 241e1447fa
KAFKA-10444: Configure PR builds via Jenkinsfile (#9238) 2020-09-01 18:12:10 -04:00