8000 Use AdoptOpenJDK JDK 8 for testing [ci: last-only] by eed3si9n · Pull Request #7931 · scala/scala · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 1 commit into from
Jul 10, 2019

Conversation

eed3si9n
Copy link
Member
@eed3si9n eed3si9n commented Mar 27, 2019

@scala-jenkins scala-jenkins added this to the 2.13.1 milestone Mar 27, 2019
@retronym
Copy link
Member

Rationale?

@eed3si9n
Copy link
Member Author

AdoptOpenJDK is the most consistently available distribution of OpenJDK code base, so that's what Lightbend open source projects are adopting by policy.

@adriaanm
Copy link
Contributor

how long does the jdk install take? can we cache some of that?

@eed3si9n
Copy link
Member Author

It's cached:

 - $HOME/.sdkman

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
Copy link
Member
@retronym retronym Mar 27, 2019

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.

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

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

Copy link
Member Author

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

@diesalbla diesalbla added the internal not resulting in user-visible changes (build changes, tests, internal cleanups) label May 18, 2019
@eed3si9n eed3si9n force-pushed the wip/adoptopenjdk branch 2 times, most recently from 18504f7 to b45f9aa Compare July 8, 2019 18:04
Copy link
Member
@SethTisue SethTisue left a 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
8000
@@ -2,13 +2,26 @@
sudo: required
Copy link
Member

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?

@eed3si9n eed3si9n force-pushed the wip/adoptopenjdk branch from b45f9aa to 138060d Compare July 8, 2019 18:44
@eed3si9n eed3si9n changed the base branch from 2.13.x to 2.12.x July 8, 2019 18:44
@eed3si9n eed3si9n changed the title Use AdoptOpenJDK JDK 8 for testing Use AdoptOpenJDK JDK 8 for testing [ci: last-only] Jul 8, 2019
@eed3si9n eed3si9n closed this Jul 8, 2019
@eed3si9n eed3si9n reopened this Jul 8, 2019
@SethTisue
Copy link
Member

re: "rationale?", umbrella ticket is scala/scala-dev#587

Copy link
Member
@dwijnand dwijnand left a 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)
Copy link
Member

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

Copy link
Member

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

Copy link
Member

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.

Copy link
Member

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.

@eed3si9n eed3si9n force-pushed the wip/adoptopenjdk branch from ee44ae7 to 8f7fdc4 Compare July 9, 2019 18:48
@eed3si9n
Copy link
Member Author
eed3si9n commented Jul 9, 2019

This is re-targeted to 2.12.x, and squashed.

@SethTisue SethTisue modified the milestones: 2.13.1, 2.12.9 Jul 9, 2019
sudo: required

dist: xenial
group: stable
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

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

OK. Thanks!

@lrytz lrytz merged commit fa704e5 into scala:2.12.x Jul 10, 2019
@eed3si9n eed3si9n deleted the wip/adoptopenjdk branch July 10, 2019 14:56
eed3si9n added a commit to eed3si9n/scala that referenced this pull request Jul 10, 2019
Ref scala/scala-dev#587

This is a continuation of scala#7931 to check AdoptOpenJDK JDK 11.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal not resulting in user-visible changes (build changes, tests, internal cleanups)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
0