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

[ansible] Add Ubuntu 20.04 linux-riscv64 image #3240

Merged
merged 13 commits into from
Nov 9, 2023
Merged
8 changes: 4 additions & 4 deletions .github/workflows/build_qemu.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build QEMU
name: QEMU Playbook Checker

on:
pull_request:
Expand All @@ -16,7 +16,7 @@ jobs:
build_job:
if: ${{ github.event.label.name == 'QEMU-playbook-check' }}
# The host should always be linux
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}

strategy:
Expand All @@ -30,8 +30,8 @@ jobs:
distro: ubuntu18.04
- arch: s390x
distro: ubuntu18.04
# - arch: riscv64
# distro: ubuntu22.04
- arch: riscv64
distro: ubuntu20.04
# - arch: armv7
# distro: jessie

Expand Down
1 change: 1 addition & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ have at the moment:
| [Centos7](./ansible/docker/Dockerfile.CentOS7) | [`adoptopenjdk/centos7_build_image`](https://hub.docker.com/r/adoptopenjdk/centos7_build_image) | linux on amd64, arm64, ppc64le | [Jenkins](https://ci.adoptium.net/job/centos7_docker_image_updater/) | Yes
| [Centos6](./ansible/docker/Dockerfile.CentOS6) | [`adoptopenjdk/centos6_build_image`](https://hub.docker.com/r/adoptopenjdk/centos6_build_image)| linux/amd64 | [GH Actions](.github/workflows/build.yml) | Yes
| [Alpine3](./ansible/docker/Dockerfile.Alpine3) | [`adoptopenjdk/alpine3_build_image`](https://hub.docker.com/r/adoptopenjdk/alpine3_build_image) | linux/x64 & linux/arm64 | [Jenkins](https://ci.adoptium.net/job/centos7_docker_image_updater/) | Yes
| [Ubuntu 20.04 (riscv64 only)](./ansible/docker/Dockerfile.Ubuntu2004-riscv64) | [`adoptopenjdk/ubuntu2004_build_image:linux-riscv64`](https://hub.docker.com/r/adoptopenjdk/ubuntu2004_build_image) | linux/riscv64 | [Jenkins](https://ci.adoptium.net/job/centos7_docker_image_updater/) | Yes

When a change lands into master, the relevant dockerfiles are built using
the appropriate CI system listed in the table above by configuring them with
Expand Down
8 changes: 8 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ pipeline {
dockerBuild('armv7l', 'ubuntu1604', 'Dockerfile.Ubuntu1604')
}
}
stage('Ubuntu20.04 riscv64') {
agent {
label "docker&&linux&&riscv64"
}
steps {
dockerBuild('riscv64', 'ubuntu2004', 'Dockerfile.Ubuntu2004-riscv64')
}
}
stage('Alpine3 x64') {
agent {
label "dockerBuild&&linux&&x64"
Expand Down
26 changes: 26 additions & 0 deletions ansible/docker/Dockerfile.Ubuntu2004-riscv64
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM riscv64/ubuntu:20.04

ARG user=jenkins

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get -y install git curl ansible gpg

COPY . /ansible

RUN echo "localhost ansible_connection=local" > /ansible/hosts

RUN set -eux; \
cd /ansible; \
ansible-playbook -i hosts ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml --skip-tags="debug,hosts_file,hostname,adoptopenjdk,jenkins,nagios,superuser,docker,swap_file,crontab,nvidia_cuda_toolkit,ntp_time"

RUN rm -rf /ansible

RUN groupadd -g 1000 ${user}
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" \
JDK19_BOOT_DIR="/usr/lib/jvm/jdk-19" \
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-riscv64"
1 change: 0 additions & 1 deletion ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
when:
- ansible_distribution != "Alpine"
- ansible_distribution != "Solaris"
- ansible_architecture != "riscv64"
tags: build_tools
- role: Nagios_Plugins # AdoptOpenJDK Infrastructure
tags: [nagios_plugins, adoptopenjdk]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@
- ansible_architecture == "aarch64"
tags: build_tools

- name: Install additional build tools for !riscv64
package: "name={{ item }} state=latest"
with_items: "{{ Additional_Build_Tools_not_riscv64 }}"
when:
- ansible_architecture != "riscv64"
tags: build_tools

- name: Install additional build tools for riscv64
package: "name={{ item }} state=latest"
with_items: "{{ Additional_Build_Tools_riscv64 }}"
when:
- ansible_architecture == "riscv64"
tags: build_tools

- name: Install additional build tools for Ubuntu 20 +
package: "name={{ item }} state=latest"
with_items: "{{ Additional_Build_Tools_Ubuntu20 }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ Build_Tool_Packages:
- libxtst-dev
- make
- ntp
- openjdk-8-jdk
- pigz
- pkg-config
- systemtap-sdt-dev
Expand Down Expand Up @@ -94,13 +93,20 @@ Additional_Build_Tools_s390x:
Additional_Build_Tools_aarch64:
- libpng-dev

Additional_Build_Tools_not_riscv64:
- openjdk-8-jdk

Additional_Build_Tools_riscv64:
- openjdk-11-jdk
- openjdk-17-jdk
- libatomic1

Additional_Build_Tools_Ubuntu20:
- cmake
- ccache

Test_Tool_Packages:
- acl
- mercurial
- perl
- xauth
- xvfb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +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
- adoptopenjdk_installed.rc != 0
tags: adoptopenjdk_install
# Api does not return release information for JDK10
Expand Down Expand Up @@ -172,6 +173,36 @@
path: /tmp/jdk{{ jdk_version }}.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
when:
- ansible_architecture == "riscv64" and jdk_version == 19
- 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/job/build-jdk19-rv64-cross/392/artifact/archive/jdk19u-riscv64-20231104.tar.gz
luhenry marked this conversation as resolved.
Show resolved Hide resolved
dest: /tmp/jdk19.tar.gz
mode: 0440
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/jdk19.tar.gz
dest: /usr/lib/jvm
remote_src: yes

- name: Remove jdk19.tar.gz (Linux-riscv64)
file:
path: /tmp/jdk19.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