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

Download cross-build jdk17u and jdk21u from CI #3308

Merged
merged 2 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ansible/docker/Dockerfile.Ubuntu2004-riscv64
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN useradd -c "Jenkins user" -d /home/${user} -u 1000 -g 1000 -m ${user}

ENV \
JDK11_BOOT_DIR="/usr/lib/jvm/java-11-openjdk-riscv64" \
JDK17_BOOT_DIR="/usr/lib/jvm/java-17-openjdk-riscv64" \
JDK17_BOOT_DIR="/usr/lib/jvm/jdk-17" \
JDK19_BOOT_DIR="/usr/lib/jvm/jdk-19" \
JDK21_BOOT_DIR="/usr/lib/jvm/jdk-21" \
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-riscv64"
8 changes: 6 additions & 2 deletions ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,10 @@
- ansible_distribution != "Solaris"
- ansible_architecture != "riscv64"
tags: build_tools
- role: adoptopenjdk_install # Current LTS
- role: adoptopenjdk_install # Previous LTS
jdk_version: 17
when:
- ansible_distribution != "Solaris"
- ansible_architecture != "riscv64"
tags: build_tools
- role: adoptopenjdk_install # JDK19 Build Bootstrap
jdk_version: 18
Expand All @@ -128,6 +127,11 @@
- ansible_distribution != "Alpine"
- ansible_distribution != "Solaris"
tags: build_tools
- role: adoptopenjdk_install # Current LTS
jdk_version: 21
when:
- ansible_architecture == "riscv64"
tags: build_tools
- role: Nagios_Plugins # AdoptOpenJDK Infrastructure
tags: [nagios_plugins, adoptopenjdk]
- role: Nagios_Master_Config # AdoptOpenJDK Infrastructure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
- ansible_distribution != "MacOSX"
- not ((ansible_distribution == "RedHat" or ansible_distribution == "CentOS") and ansible_distribution_major_version == "6")
- ansible_os_family != "Solaris"
- not (ansible_architecture == "riscv64" and jdk_version == 19) # Linux-riscv64 for JDK 19 is special cased
- not (ansible_architecture == "riscv64" and (jdk_version == 21 or jdk_version == 19 or jdk_version == 17)) # Linux-riscv64 for JDK 17, 19, 21 are special cased
- adoptopenjdk_installed.rc != 0
tags: adoptopenjdk_install
# Api does not return release information for JDK10
Expand Down Expand Up @@ -173,6 +173,37 @@
path: /tmp/jdk{{ jdk_version }}.tar.gz
state: absent

# JDK 21 on Linux-riscv64 is a special-case because JDK 21 is the first version that supports
# RISC-V. There is also no JDK 21 or 20 available on Ubuntu 20.04 that we can use as boot JDK.
- name: Install JDK {{ jdk_version }} on Linux-riscv64
when:
- ansible_architecture == "riscv64" and jdk_version == 21
- adoptopenjdk_installed.rc != 0
tags: adoptopenjdk_install
# Api does not return release information for JDK10
block:
- name: Download jdk{{ jdk_version }} release (Linux-riscv64)
get_url:
url: https://api.adoptium.net/v3/binary/version/jdk-21.0.1+12.1-ea-beta/linux/riscv64/jdk/hotspot/normal/adoptium
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 add a checksum into this to verify the download since it's a special case.
For the 21.0.1+12 that means:

    checksum: sha256:c9b8b1ca18b13e293688cafbd8990c940ca49104dbeefc242e5c3f8de271abdf

and for the 17 download:

    checksum: sha256:c9b8b1ca18b13e293688cafbd8990c940ca49104dbeefc242e5c3f8de271abdf

These should work in these stanzas in the same as the example at

checksum: sha256:c9b8b1ca18b13e293688cafbd8990c940ca49104dbeefc242e5c3f8de271abdf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The checksums you've given me here are duplicate. I assume due to a bad c/p. I've added the checksums I get when downloading them locally.

dest: /tmp/jdk21.tar.gz
mode: 0440
checksum: sha256:45baa6571849e4a93b76156a96a4eb83c0398f410d4542b8039a4e097c7c2161
retries: 3
delay: 5
register: adoptopenjdk_download
until: adoptopenjdk_download is not failed

- name: Install latest jdk{{ jdk_version }} release if one not already installed (Linux-riscv64)
unarchive:
src: /tmp/jdk21.tar.gz
dest: /usr/lib/jvm
remote_src: yes

- name: Remove jdk21.tar.gz (Linux-riscv64)
file:
path: /tmp/jdk21.tar.gz
state: absent

# JDK 19 on Linux-riscv64 is a special-case because JDK 19 is the first version that supports
# RISC-V. There is also no JDK 19 or 20 available on Ubuntu 20.04 that we can use as boot JDK.
- name: Install JDK {{ jdk_version }} on Linux-riscv64
Expand Down Expand Up @@ -203,6 +234,37 @@
path: /tmp/jdk19.tar.gz
state: absent

# JDK 17 on Linux-riscv64 is a special-case because the Ubuntu openjdk-17-jdk package doesn't seem
# to work on VF2.
- name: Install JDK {{ jdk_version }} on Linux-riscv64
when:
- ansible_architecture == "riscv64" and jdk_version == 17
- adoptopenjdk_installed.rc != 0
tags: adoptopenjdk_install
# Api does not return release information for JDK10
block:
- name: Download jdk{{ jdk_version }} release (Linux-riscv64)
get_url:
url: https://ci.adoptium.net/userContent/riscv/jdk17u-riscv64-17.0.9+9-ea-cross-20231221.tar.gz
dest: /tmp/jdk17.tar.gz
mode: 0440
checksum: sha256:7b84db96e69f075dbea49164f866d7296b1f2f7a45961978155505d4fd07b0e4
retries: 3
delay: 5
register: adoptopenjdk_download
until: adoptopenjdk_download is not failed

- name: Install latest jdk{{ jdk_version }} release if one not already installed (Linux-riscv64)
unarchive:
src: /tmp/jdk17.tar.gz
dest: /usr/lib/jvm
remote_src: yes

- name: Remove jdk17.tar.gz (Linux-riscv64)
file:
path: /tmp/jdk17.tar.gz
state: absent

# # CentOS6 needs it's own task so it can use a different python interpreter.
# # See: https://github.com/adoptium/infrastructure/issues/1877
- name: Install latest JDK {{ jdk_version }} release if not already installed (CentOS6)
Expand Down
Loading