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

Actually test Gerrit on ubuntu1804_java11 #333

Merged
merged 3 commits into from
Jan 14, 2019
Merged

Actually test Gerrit on ubuntu1804_java11 #333

merged 3 commits into from
Jan 14, 2019

Conversation

davido
Copy link
Contributor

@davido davido commented Sep 25, 2018

Closes #325.

@davido
Copy link
Contributor Author

davido commented Sep 25, 2018

@philwo Can you take a look? I assume that the JAVA_HOME for JDK 10 is: /usr/lib/jvm/java-10-openjdk-amd64. Is that correct? The corresponding Gerrit change, that added support for Vanilla Java Toolchain that uses Vanilla Java Builder, was merged today morning: [1].

[1] https://gerrit-review.googlesource.com/c/gerrit/+/193832

@philwo
Copy link
Member

philwo commented Nov 5, 2018

Hi @davido,

sorry for the late reply. We're using Azul Zulu on the machines, so the correct path would be: /usr/lib/jvm/zulu-10-amd64.

For reference:

philwo@bk-worker-ubuntu1804-java10-bm37:~$ ls -l /usr/lib/jvm/
total 4
drwxr-xr-x 10 root root 4096 Oct 22 09:58 zulu-10-amd64

Otherwise LGTM!

@davido
Copy link
Contributor Author

davido commented Nov 5, 2018

We're using Azul Zulu on the machines, so the correct path would be: /usr/lib/jvm/zulu-10-amd64.

Done.

@davido
Copy link
Contributor Author

davido commented Nov 5, 2018

@philwo Note, that on Bazel 0.19.0, we could simplify the integration with recent Java versions, see: [1]. That's because absolute_javabase and toolchain_vanilla are part of Bazel's tools/jdk package now.

Also, do you have already Java 11 on Buildkite CI environment up and running? In that case we could jump directly to Java 11 and skip Java 10 altogether.

@philwo
Copy link
Member

philwo commented Jan 3, 2019

Hi @davido,

sorry for not getting back to this earlier. I just came back from parental leave and am catching up with stuff.

Is this fine to merge?

Also, do you have already Java 11 on Buildkite CI environment up and running? In that case we could jump directly to Java 11 and skip Java 10 altogether.

We still don't have support for Java 11 yet, but @meisterT might know what our plans are for that. Maybe Bazel already supports it and we just have to add it to our CI, in which case I'll happily do that.

@davido
Copy link
Contributor Author

davido commented Jan 3, 2019

We still don't have support for Java 11 yet, but @meisterT might know what our plans are for that.

Let's assume it will take quite some time (years?) to make Bazel natively support Java 11, see bazelbuild/bazel#6245. In that light, wouldn't it make sense to independently install Java 11 on Bazel CI environment and ensure that at least 2 projects: Gerrit and Bazel itself (or just Gerrit, if you don't care that Bazel can be built with Java 11, we do care, though) can be built with Java 11 using VanillaJavaBuilder on Bazel CI?

  $ bazel build \
    --define=ABSOLUTE_JAVABASE=/usr/lib64/jvm/java-11 \
    --host_javabase=@bazel_tools//tools/jdk:absolute_javabase \
    --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \
    --java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \
    :release

All I need from you to make it happen two inputs:

  1. Install Java 11 on Bazel CI
  2. Tell me the absolute path for it. For me it is: /usr/lib64/jvm/java-11.

@meisterT
Copy link
Member

meisterT commented Jan 7, 2019

I'll upgrade the embedded JDK to JDK11 soonish; and @iirina is trying to shape the general Java/JDK roadmap.

@davido
Copy link
Contributor Author

davido commented Jan 7, 2019

I'll upgrade the embedded JDK to JDK11 soonish

By this you mean on Bazel CI or in Bazel itself (native support for JDK 11, that is tracked in bazelbuild/bazel#6245)? If in Bazel itself, do you have time frame estimation for "soonish"?

@meisterT
Copy link
Member

meisterT commented Jan 7, 2019

I mean the embedded JDK in Bazel, see #6592

@philwo
Copy link
Member

philwo commented Jan 14, 2019

Install Java 11 on Bazel CI

I'll get that done ASAP.

@philwo
Copy link
Member

philwo commented Jan 14, 2019

Support for the ubuntu1804_java11 platform has been added: 9f9c189 and bc7ae6e

The absolute path to the Azul Zulu 11 JDK is: /usr/lib/jvm/zulu-11-amd64

@davido
Copy link
Contributor Author

davido commented Jan 14, 2019

Thanks @philwo. That's awesome!

Let me adjust this PR to use Azul Zulu 11 JDK with VanillaJavaBuilder. Can you then merge this so that Gerrit Code Review will be the very first project that is built with JDK 11 on Bazel CI?

@davido davido changed the title Actually test Gerrit on ubuntu1804_java10 Actually test Gerrit on ubuntu1804_java11 Jan 14, 2019
@philwo philwo merged commit d45e554 into bazelbuild:master Jan 14, 2019
@philwo
Copy link
Member

philwo commented Jan 14, 2019

Merged and it's green on CI: https://buildkite.com/bazel/gerrit/builds/2010 - yay, Gerrit!

@cushon @meisterT @iirina Our first build with a Java 11 host_javabase succeeded :)

FWIW, I spotted this new warning during the build with Java 11, which doesn't seem to cause problems, but at least confirms that we're actually building with Java 11 (because that dropped support for targeting Java 1.7, I guess):

warning: -parameters is not supported for target value 1.7. Use 1.8 or later.

@davido
Copy link
Contributor Author

davido commented Jan 14, 2019

Great news, thank you! I have just realized, that Bazel can also be built with Java 11, so that something like this worked:

  $ b10 build --define=ABSOLUTE_JAVABASE=/home/davido/pgm/jdk-11 --host_javabase=@bazel_tools//tools/jdk:absolute_javabase --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla --java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla src:bazel-dev

Then to make use of it, I added this line to ~/.bazelrc:

$ tail -1 ~/.bazelrc
startup --server_javabase=/home/davido/pgm/jdk-11

And then I tested to build gerrit with Bazel-built-with-JDK11 and compared it building gerrit Gerrit with vanilla bazel 0.22rc2. The results are below:

  $ time b10 build --define=ABSOLUTE_JAVABASE=/home/davido/pgm/jdk-11 --host_javabase=@bazel_tools//tools/jdk:absolute_javabase --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla --java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla :release
[...]
  INFO: From Compiling 641 JavaScript files to polygerrit-ui/app/polygerrit_ui_closure_bin.js:
WARNING - Failed to resolve sourcemap at bazel-out/k8-fastbuild/bin/polygerrit-ui/app/web-animations-next-lite.min.js.map: bazel-out/k8-fastbuild/bin/polygerrit-ui/app/web-animations-next-lite.min.js.map
  Codes: SOURCEMAP_RESOLVE_FAILED

0 error(s), 1 warning(s)

Target //:release up-to-date:
  bazel-bin/release.war
INFO: Leaving sandboxfs mounted because of --sandbox_debug
INFO: Elapsed time: 238.288s, Critical Path: 121.96s
INFO: 1435 processes: 612 linux-sandbox, 7 local, 816 worker.
INFO: Build completed successfully, 2210 total actions

real	3m58.359s
user	0m0.061s
sys	0m0.068s

then I clean everything, including caches and re-run the build with vanilla Bazel 0.22-rc2:

  $ bazel version
Build label: 0.22.0rc2

  $ time bazel build :release
[...]

INFO: From Compiling 641 JavaScript files to polygerrit-ui/app/polygerrit_ui_closure_bin.js:
WARNING - Failed to resolve sourcemap at bazel-out/k8-fastbuild/bin/polygerrit-ui/app/web-animations-next-lite.min.js.map: bazel-out/k8-fastbuild/bin/polygerrit-ui/app/web-animations-next-lite.min.js.map
  Codes: SOURCEMAP_RESOLVE_FAILED

0 error(s), 1 warning(s)

Target //:release up-to-date:
  bazel-bin/release.war
INFO: Elapsed time: 288.698s, Critical Path: 101.78s
INFO: 1435 processes: 612 linux-sandbox, 7 local, 816 worker.
INFO: Build completed successfully, 2210 total actions

real	4m48.769s
user	0m0.056s
sys	0m0.075s

Do we have an explanation, why it takes 3m58.359s to build gerrit (with cold cache) with Bazel@JDK11 and 4m48.769s to build gerrit (with cold cache) with vanilla Bazel?

Is it only because of Error Prone integration and other neat features that vanilla Bazel offers?

@philwo
Copy link
Member

philwo commented Jan 16, 2019

Do we have an explanation, why it takes 3m58.359s to build gerrit (with cold cache) with Bazel@JDK11 and 4m48.769s to build gerrit (with cold cache) with vanilla Bazel?

I think the VanillaJavaBuilder is faster than the full-featured one with Error Prone etc., but I don't think anyone ever benchmarked how much the difference is. It's possible that this is the reason, yes.

joeleba pushed a commit to joeleba/continuous-integration that referenced this pull request Jun 17, 2019
* Actually test Gerrit on ubuntu1804_java10

Closes bazelbuild#325.

* Fix path to Azul Zulu jvm

* Update path to JDK 11
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.

3 participants