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

Use Java 20 as bootjdk for jdknext #17302

Merged
merged 2 commits into from
May 2, 2023

Conversation

keithc-ca
Copy link
Contributor

See #17289.

@keithc-ca
Copy link
Contributor Author

In draft mode until we ensure build machines are ready for this change.

@pshipton
Copy link
Member

I don't think this will work. It downloads the JVM from https://api.adoptopenjdk.net/v3/binary/latest/${bootJDKVersion}/ga/${os}/${arch}/jdk/openj9/normal/adoptopenjdk?project=jdk for which there is no openj9 version of 20 (or even 19) yet.

@pshipton
Copy link
Member

You can modify the download link. I wrote some ramblings about that in #17289 (comment)

@keithc-ca
Copy link
Contributor Author

This new version updates the URL for downloading (new) boot JDKs.
The old URL pattern doesn't seem to work even for versions for which it could redirect to a Semeru build of OpenJ9.

@keithc-ca keithc-ca marked this pull request as ready for review April 27, 2023 19:26
dir_strip:
all: '1'
url:
all: "https://api.adoptopenjdk.net/v3/binary/latest/${bootJDKVersion}/ga/${os}/${arch}/jdk/openj9/normal/adoptopenjdk?project=jdk"
all: 'https://api.adoptium.net/v3/binary/latest/${bootJDKVersion}/ga/${os}/${arch}/jdk/hotspot/normal/eclipse?project=jdk'
Copy link
Member

Choose a reason for hiding this comment

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

We should only be using hotspot for next and openj9 for the others.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried using "openj9" for 17, I got a 404 error.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps @AdamBrousseau knows, I assume it used to work. It's only needed when we have a new machine that doesn't already have the binary. We could leave versions earlier than next as-is for now in order to deliver the jdk21 fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adam explained that while adoptopenjdk.net redirects to adoptium.net, the redirection doesn't apply to api.adoptopenjdk.net. I'll update this accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@@ -163,11 +163,11 @@ boot_jdk_default:
17: '17'
19: '18'
20: '18'
next: '18'
next: 'https://api.adoptium.net/v3/binary/latest/20/ga/${os}/${arch}/jdk/hotspot/normal/eclipse?project=jdk'
Copy link
Member

Choose a reason for hiding this comment

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

Does this work? I think you need to put the version here and the url under url:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you're right, perhaps this section should look like this?

boot_jdk_default:
  boot_jdk:
    location:
      all: '${HOME}/bootjdks'
    version:
      8: '8'
      11: '11'
      17: '17'
      19: '18'
      20: '18'
      next: '20'
    dir_strip:
      all: '1'
    url:
      all: 'https://api.adoptopenjdk.net/v3/binary/latest/${bootJDKVersion}/ga/${os}/${arch}/jdk/openj9/normal/adoptopenjdk?project=jdk'
      next: 'https://api.adoptium.net/v3/binary/latest/${bootJDKVersion}/ga/${os}/${arch}/jdk/hotspot/normal/eclipse?project=jdk'

@AdamBrousseau ?

Copy link
Member

Choose a reason for hiding this comment

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

Looks good to me, I believe we've done something like that before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@pshipton
Copy link
Member

jenkins compile amac jdknext

@pshipton
Copy link
Member

Unfortunately it doesn't work, I guess you'll have to specify all the individual versions rather than setting all.

@pshipton
Copy link
Member

Either than or perhaps the code that uses it could be fixed to recognize the version before using all.

@keithc-ca
Copy link
Contributor Author

I expect @AdamBrousseau can confirm, but I don't think this change is included in the early stages of the build and so cannot affect the bootjdk URL.

@keithc-ca
Copy link
Contributor Author

Either than or perhaps the code that uses it could be fixed to recognize the version before using all.

I think the version-specific URL would be fine if this change were loaded early enough; see https://github.com/eclipse-openj9/openj9/blob/master/buildenv/jenkins/common/variables-functions.groovy#L1603.

@pshipton
Copy link
Member

We can see what happened in the console output https://openj9-jenkins.osuosl.org/job/Build_JDKnext_aarch64_mac_Personal/75/console

It does the following before using the variable file.

10:38:04 Checking out Revision d9155d3f38a496aa2cc333e96bb65f3930148a60 (refs/remotes/origin/pr/17302/merge)

Did you look at how getScalarField is implemented?

dir_strip:
all: '1'
url:
all: "https://api.adoptopenjdk.net/v3/binary/latest/${bootJDKVersion}/ga/${os}/${arch}/jdk/openj9/normal/adoptopenjdk?project=jdk"
all: 'https://api.adoptopenjdk.net/v3/binary/latest/${bootJDKVersion}/ga/${os}/${arch}/jdk/openj9/normal/adoptopenjdk?project=jdk'
next: 'https://api.adoptium.net/v3/binary/latest/${bootJDKVersion}/ga/${os}/${arch}/jdk/hotspot/normal/eclipse?project=jdk'
Copy link
Contributor

@AdamBrousseau AdamBrousseau Apr 28, 2023

Choose a reason for hiding this comment

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

I think next needs to be 20. L1603 is using bootJDKVersion which has already been processed into a number at that point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I think I see what you mean; '20': {url} - that makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in 93021cf.

Fetch bootjdk for jdknext from adoptium.

Issue: 17289.

Signed-off-by: Keith W. Campbell <[email protected]>
@keithc-ca
Copy link
Contributor Author

I don't think this change is included in the early stages of the build

Clearly I was incorrect, the build tried to use 20 for the boot jdk, but didn't have the right mapping to a URL.

@pshipton
Copy link
Member

jenkins compile amac jdknext

@pshipton
Copy link
Member

Seems we need more changes to handle other builds, I see

12:14:49  ++ ls
12:14:49  ++ grep semeru
12:14:49  + sdkFile=

@keithc-ca
Copy link
Contributor Author

jenkins compile amac jdknext

@@ -1618,7 +1618,7 @@ def download_boot_jdk(bootJDKVersion, bootJDK) {
sh """
curl -LJkO ${sdkUrl}
mkdir -p ${bootJDK}
sdkFile=`ls | grep semeru`
sdkFile=`ls | grep 'tar\|zip'`
Copy link
Contributor

Choose a reason for hiding this comment

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

Might need 2 back slashes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using single quotes keeps the shell from giving the backslash special meaning; I guess it has to get past groovy first.

Signed-off-by: Keith W. Campbell <[email protected]>
@keithc-ca
Copy link
Contributor Author

jenkins compile amac jdknext

@keithc-ca
Copy link
Contributor Author

Looks good now:

13:24:13  ++ grep 'tar\|zip'
13:24:13  + sdkFile=OpenJDK20U-jdk_aarch64_mac_hotspot_20.0.1_9.tar.gz
13:24:13  + [[ OpenJDK20U-jdk_aarch64_mac_hotspot_20.0.1_9.tar.gz == *zip ]]
13:24:13  + gzip -cd OpenJDK20U-jdk_aarch64_mac_hotspot_20.0.1_9.tar.gz
13:24:13  + tar xof - -C /Users/jenkins/bootjdks/jdk20 --strip=3
13:24:14  + /Users/jenkins/bootjdks/jdk20/bin/java -version
13:24:15  openjdk version "20.0.1" 2023-04-18
13:24:15  OpenJDK Runtime Environment Temurin-20.0.1+9 (build 20.0.1+9)
13:24:15  OpenJDK 64-Bit Server VM Temurin-20.0.1+9 (build 20.0.1+9, mixed mode)

@keithc-ca
Copy link
Contributor Author

jenkins compile win jdknext

@keithc-ca
Copy link
Contributor Author

The Windows build failed:

13:26:51  + mkdir -p /home/jenkins/bootjdks/jdk20
13:26:51  mkdir: cannot create directory '/home/jenkins/bootjdks/jdk20': Permission denied

@AdamBrousseau Why should that be?

@AdamBrousseau
Copy link
Contributor

Looks like that dir is owned by Administrator on the new machines.
Fixed them now.

@AdamBrousseau
Copy link
Contributor

I restarted your running win build.

@keithc-ca
Copy link
Contributor Author

Is this another feature of new machines?

13:41:24  + git clone -b openj9 https://github.com/ibmruntimes/openj9-openjdk-jdk.git . --reference /home/jenkins/openjdk_cache
13:41:24  fatal: destination path '.' already exists and is not an empty directory.

@keithc-ca
Copy link
Contributor Author

@AdamBrousseau Has the problem on Windows build machines that caused the failure noted in #17302 (comment) been addressed?

@AdamBrousseau
Copy link
Contributor

jenkins compile win jdknext

@AdamBrousseau AdamBrousseau merged commit a26b88f into eclipse-openj9:master May 2, 2023
@keithc-ca keithc-ca deleted the bootjdk branch May 2, 2023 17:19
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