Skip to content

Commit

Permalink
Add Ubuntu 20.04 linux-riscv64 image
Browse files Browse the repository at this point in the history
It will be used for cross-compilation and testing.
  • Loading branch information
luhenry committed Nov 5, 2023
1 parent e955c90 commit b626322
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 23 additions & 0 deletions ansible/docker/Dockerfile.Ubuntu2004-riscv64
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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 \
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-riscv64"
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 All @@ -99,6 +113,20 @@
- ansible_architecture == "x86_64"
tags: test_tools

- name: Install additional Test Tool Packages for !riscv64
package: "name={{ item }} state=latest"
with_items: "{{ Test_Tool_Packages_not_riscv64 }}"
when:
- ansible_architecture != "riscv64"
tags: test_tools

- name: Install additional Test Tool Packages for riscv64
package: "name={{ item }} state=latest"
with_items: "{{ Test_Tool_Packages_riscv64 }}"
when:
- ansible_architecture == "riscv64"
tags: test_tools

- name: Install additional Packages specific to Ubuntu 16
package: "name={{ item }} state=latest"
with_items: "{{ Additional_Packages_Ubuntu16 }}"
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,18 @@ 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

Additional_Build_Tools_Ubuntu20:
- cmake
- ccache

Test_Tool_Packages:
- acl
- mercurial
- perl
- xauth
- xvfb
Expand All @@ -117,3 +121,13 @@ Test_Tool_Packages:

Test_Tool_Packages_x86_64:
- pulseaudio

Test_Tool_Packages_not_riscv64:
- mercurial

# For some reasons, mercurial-common package is available in riscv64 ubuntu,
# but not mercurial
Test_Tool_Packages_riscv64:
- mercurial-common
- python2
- ucf

0 comments on commit b626322

Please sign in to comment.