-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Use AdoptOpenJDK JDK 8 for testing [ci: last-only] #7931
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
Conversation
4fc1f06
to
714b67c
Compare
Rationale? |
AdoptOpenJDK is the most consistently available distribution of OpenJDK code base, so that's what Lightbend open source projects are adopting by policy. |
how long does the jdk install take? can we cache some of that? |
It's cached:
It should be like zero seconds from the second run onwards. |
.travis.yml
Outdated
@@ -63,6 +77,7 @@ jobs: | |||
|
|||
env: | |||
global: | |||
- TRAVIS_JDK=8.0.202.hs-adpt |
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 don't really like baking this exact version number into travis.yml
. Typically, we just ask for 8/9/12 and let external config in the CI platform pick the latest minor release for that.
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.
Travis's native support for JDK installation comes from:
https://github.com/sormuras/bach/blob/master/install-jdk.sh
Should we contribute AdoptOpenJDK support to that script?
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 can do
sdk list java | grep -o "8\..*hs-adpt" | tail -1
to let sdkman decide the patch version.
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.
If the bach maintainer is willing to maintain AdoptOpenJDK links, that would be great.
See also
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.
Looks like install_jdk.sh
already supports Adopt OpenJDK:
Example: https://github.com/sormuras/sormuras.github.io/blob/master/.travis.yml#L27
The only catch is that it doesn't have an alias for it that can be specified in the jdk: openjdk8
directive in .travis.yml
.
This URL resolves to the latest release of AdoptOpenJDK 8: https://api.adoptopenjdk.net/v2/binary/releases/openjdk8?openjdk_impl=hotspot&os=linux&arch=x64&release=latest&heap_size=normal&type=jdk
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.
Added patch detection here - b45f9aa
18504f7
to
b45f9aa
Compare
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 this target 2.12.x rather than 2.13.x?
otherwise LGTM
.travis.yml
Outdated
@@ -2,13 +2,26 @@ | |||
sudo: required |
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.
omit, and maybe add dist:
line, like you did in the scala-xml PR, so Travis doesn't just pick one?
b45f9aa
to
138060d
Compare
re: "rationale?", umbrella ticket is scala/scala-dev#587 |
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.
Looks great. I agree and like how this puts us back in a situation where we use the latest patch version of the JDK (assuming SDKMAN!'s metadata stays up to date).
I have a couple of mid-sized questions/requests.
.travis.yml
Outdated
- source "/home/travis/.sdkman/bin/sdkman-init.sh" | ||
|
||
install: | ||
- sdk install java $(sdk list java | grep -o "$ADOPTOPENJDK\.[0-9\.]*hs-adpt" | tail -1) |
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.
Alternatively, we could stick to using install-jdk.sh
which (apparently, but we should verify) was just updated by Travis CI (sormuras/bach#62), by adding the following as an install
step:
- source install-jdk.sh --url "https://api.adoptopenjdk.net/v2/binary/releases/openjdk$ADOPTOPENJDK?openjdk_impl=hotspot&os=linux&arch=x64&release=latest&heap_size=normal&type=jdk"
This is where those URLs redirect to:
09:11:36 $ for ADOPTOPENJDK in 8 11; do
> curl -I "https://api.adoptopenjdk.net/v2/binary/releases/openjdk$ADOPTOPENJDK?openjdk_impl=hotspot&os=linux&arch=x64&release=latest&heap_size=normal&type=jdk"
> done
HTTP/2 302
date: Tue, 09 Jul 2019 08:19:37 GMT
content-type: text/plain; charset=utf-8
content-length: 150
set-cookie: __cfduid=dbe707790dae1c34dc2e23ec1cdf42a581562660376; expires=Wed, 08-Jul-20 08:19:36 GMT; path=/; domain=.adoptopenjdk.net; HttpOnly
x-powered-by: Express
access-control-allow-origin: *
location: https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u212-b04/OpenJDK8U-jdk_x64_linux_hotspot_8u212b04.tar.gz
vary: Accept
set-cookie: b7b892882bae631693e1ea44963ef628=afdd0ec2d9aff4e059f50dfa0530835e; path=/; HttpOnly; Secure
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 4f38dfbb3ff9dbdb-LHR
HTTP/2 302
date: Tue, 09 Jul 2019 08:19:37 GMT
content-type: text/plain; charset=utf-8
content-length: 154
set-cookie: __cfduid=dab5451e461b1bce70eeaab3f5054a6981562660377; expires=Wed, 08-Jul-20 08:19:37 GMT; path=/; domain=.adoptopenjdk.net; HttpOnly
x-powered-by: Express
access-control-allow-origin: *
location: https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.3%2B7/OpenJDK11U-jdk_x64_linux_hotspot_11.0.3_7.tar.gz
vary: Accept
set-cookie: b7b892882bae631693e1ea44963ef628=afdd0ec2d9aff4e059f50dfa0530835e; path=/; HttpOnly; Secure
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 4f38dfbf3df9ce2f-LHR
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.
before_install: wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
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.
+1
If that doesn't work, jabba supports installing from an url.
jabba install 1.8-adopt-latest=tgz+'https://api.adoptopenjdk.net/v2/binary/releases/openjdk8?openjdk_impl=hotspot&os=linux&arch=x64&release=latest&heap_size=normal&type=jdk'
works on my machine.
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.
Since we cache the JDK, we should also check that the cached version is still the latest.
b37e71b
to
3c27912
Compare
c36d7a3
to
ee44ae7
Compare
ee44ae7
to
8f7fdc4
Compare
This is re-targeted to 2.12.x, and squashed. |
sudo: required | ||
|
||
dist: xenial | ||
group: stable |
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.
so did we decide to keep those two entries in the end?
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 did attempt to removed it, but for some reason Travis CI picked up trusty - https://travis-ci.org/scala/scala/jobs/556437704#L7-L9
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. Thanks!
Ref scala/scala-dev#587 This is a continuation of scala#7931 to check AdoptOpenJDK JDK 11.
Ref scala/scala-dev#587