Skip to content

Commit

Permalink
Merge branch 'adoptium:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdipub authored Apr 22, 2024
2 parents 945a171 + 31214c7 commit 3be8cce
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 258 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Docker Buildx to use cache feature
uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c # v3.1.0
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Docker Buildx to use cache feature
uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c # v3.1.0
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Docker Build Alpine3 Image
uses: docker/build-push-action@af5a7ed5ba88268d5278f7203fb52cd833f66d6e # v5.2.0
Expand Down
22 changes: 18 additions & 4 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,30 @@ have at the moment:
| Dockerfile | Image | Platforms | Where is this built? | In use?
|---|---|---|---|---|
| [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
| [RHEL7](./ansible/docker/Dockerfile.RHEL7) | n/a - restricted (*) | s390x | [Jenkins](https://ci.adoptium.net/job/rhel7_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

<details>
<summary>(*) - Caveats:</summary>

The RHEL7 image creation for s390x has to be run on a RHEL host using a
container implementation supplied by Red Hat, and we are using RHEL8 for
this as it has a stable implemention. The image creation requires the
following:

1. The host needs to have an active RHEL subscription
2. The RHEL7 devkit (which cannot be made public) to be available in a tar file under /usr/local on the host as per the name in the Dockerfile
</details>

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
the ansible playbooks and pushing them up to Docker Hub where they can be
consumed by our jenkins build agents when the `DOCKER_IMAGE` value is
defined on the jenkins build pipelines as configured in the
[pipeline_config files](https://github.com/AdoptOpenJDK/ci-jenkins-pipelines/tree/master/pipelines/jobs/configurations).
the ansible playbooks and - with the exception of the RHEL7 image for s390x -
pushing them up to Docker Hub where they can be consumed by our jenkins
build agents when the `DOCKER_IMAGE` value is defined on the jenkins build
pipelines as configured in the [pipeline_config
files](https://github.com/AdoptOpenJDK/ci-jenkins-pipelines/tree/master/pipelines/jobs/configurations).

### Adding a new dockerBuild dockerhub repository

Expand Down
15 changes: 7 additions & 8 deletions ansible/docker/Dockerfile.RHEL7
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
FROM registry.access.redhat.com/rhel7
# This dockerfile should be built using this from the top level of the repository:
# ROSIPW=******* docker build --no-cache -t rhel7_build_image -f ansible/docker/Dockerfile.RHEL7 --build-arg ROSIUSER=******* --secret id=ROSIPW --build-arg git_sha="$(git rev-parse --short HEAD)" `pwd`
ARG ROSIUSER
RUN sed -i 's/\(def in_container():\)/\1\n return False/g' /usr/lib64/python*/*-packages/rhsm/config.py
RUN --mount=type=secret,id=ROSIPW,required=true subscription-manager register --username=${ROSIUSER} --password="$(cat /run/secrets/ROSIPW)" --auto-attach
RUN subscription-manager repos --enable rhel-7-for-system-z-optional-rpms
RUN yum-config-manager --enable rhel-7-for-system-z-optional-rpms
# ^^ Optional repo needed for Xvfb

ARG git_sha
Expand All @@ -15,6 +10,7 @@ RUN yum --enablerepo=rhel-7-server-ansible-2-for-system-z-rpms install -y ansibl
RUN yum clean all

COPY . /ansible
COPY devkit /usr/local/devkit

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

Expand All @@ -31,7 +27,10 @@ RUN useradd -c "Jenkins user" -d /home/${user} -u 1002 -g 1003 -m ${user}
ENV \
JDK7_BOOT_DIR="/usr/lib/jvm/java-1.7.0-openjdk" \
JDK8_BOOT_DIR="/usr/lib/jvm/java-1.8.0-openjdk" \
JDK10_BOOT_DIR="/usr/lib/jvm/jdk-10" \
JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk"
RUN subscription-manager unregister

# While this does bloat the image it is required for building the
# devkit, and the process for that runs as non-root ...
# Disabled for now as we're going to copy from /usr/local/devkit on the host
RUN yum clean all
RUN yum reinstall --downloadonly glibc glibc-headers glibc-devel cups-libs cups-devel libX11 libX11-devel xorg-x11-proto-devel alsa-lib alsa-lib-devel libXext libXext-devel libXtst libXtst-devel libXrender libXrender-devel libXrandr libXrandr-devel freetype freetype-devel libXt libXt-devel libSM libSM-devel libICE libICE-devel libXi libXi-devel libXdmcp libXdmcp-devel libXau libXau-devel libgcc libxcrypt zlib zlib-devel libffi libffi-devel fontconfig fontconfig-devel kernel-headers
12 changes: 2 additions & 10 deletions ansible/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,8 @@ hosts:
solaris10u11-sparcv9-1: {ip: cloud.siteox.com, port: 24322}

- ibmcloud:
win2012r2-x64-1: {ip: 169.48.4.138, user: Administrator}
win2012r2-x64-2: {ip: 169.48.4.142, user: Administrator}
win2022-x64-1: {ip: 52.118.206.11, user: Administrator}

- spearhead:
freebsd12-x64-1: {ip: 185.131.222.224}

- docker:

- skytap:
Expand All @@ -86,10 +81,9 @@ hosts:

- azure:
ubuntu2204-x64-1: {ip: 52.180.147.157, description: Xeon Platinum 8272CL, 16 cores, 64GB}
ubuntu2204-x64-2: {ip: 20.83.24.86, description: 16 cores, 64GB}

- equinix:
ubuntu2204-x64-1: {ip: 145.40.113.173, description: Intel Xeon Gold 40 core}
ubuntu2004-x64-1: {ip: 145.40.114.58, description: AMD EPYC 7401P 24 core}
ubuntu2004-armv8-1: {ip: 147.75.35.203, description: Ampere Altra 160 core, 512Gb}
ubuntu2204-armv8-1: {ip: 139.178.86.243, description: Ampere Altra 160 cores, 512Gb}

Expand All @@ -112,7 +106,7 @@ hosts:

- azure:
win2016-x64-1: {ip: 52.149.211.210, user: adoptopenjdk}
win2019-x64-1: {ip: 20.185.182.137, user: adoptopenjdk}
win2019-x64-1: {ip: 13.92.177.186, user: adoptopenjdk}
win2022-x64-1: {ip: 51.132.234.42, user: adoptopenjdk}
win2022-x64-2: {ip: 20.26.116.218, user: adoptopenjdk}
win11-aarch64-1: {ip: 20.4.31.184, user: adoptopenjdk}
Expand Down Expand Up @@ -177,5 +171,3 @@ hosts:
rhel6-x64-1: {ip: 169.48.4.140}
rhel7-x64-1: {ip: 169.48.4.136}
ubuntu1604-x64-1: {ip: 169.48.4.141}
win2012r2-x64-1: {ip: 169.48.4.131, user: Administrator}
win2012r2-x64-2: {ip: 169.48.4.139, user: Administrator}
2 changes: 2 additions & 0 deletions ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
when:
- (ansible_distribution != "Alpine" or ansible_architecture != "aarch64")
- ansible_architecture != "riscv64"
- ansible_architecture != "s390x"
tags: build_tools
- role: adoptopenjdk_install # JDK11 Build Bootstrap
jdk_version: 10
Expand All @@ -120,6 +121,7 @@
- ansible_distribution != "Solaris"
- ansible_architecture != "riscv64"
- ansible_architecture != "armv7l"
- ansible_architecture != "s390x"
tags: build_tools
- role: adoptopenjdk_install # Current LTS
jdk_version: 21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM registry.suse.com/suse/sles12sp5:latest

RUN zypper ar https://download.opensuse.org/distribution/leap/15.4/repo/oss/ sles15oss
RUN zypper --gpg-auto-import-keys refresh
RUN zypper update -y && zypper install -y wget perl openssh-server unzip zip tar gzip
RUN zypper update -y && zypper install -y wget perl openssh-server unzip zip tar gzip hostname

RUN wget 'https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jdk/hotspot/normal/eclipse?project=jdk' -O /tmp/jdk17.tar.gz
RUN mkdir -p /usr/lib/jvm/jdk17 && tar -xpzf /tmp/jdk17.tar.gz -C /usr/lib/jvm/jdk17 --strip-components=1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
#################################################
# Build basic test images for each distribution #
#################################################
##########################################
# Config changes for Dockerhost machines #
##########################################

- name: Enable ipv6 on Dockerhost
lineinfile:
Expand All @@ -13,224 +13,6 @@
notify:
- Restart docker service

- name: Send Dockerfiles to remote machine
copy:
src: Dockerfiles/
dest: /tmp/Dockerfiles/

- name: Collate all Dockerfile names
find:
paths: "/tmp/Dockerfiles/"
patterns: "Dockerfile.*"
register: dockerfiles

# Defaulting to x64 in Dockerfiles means no need to special case that one
# since API architecture = ansible_architecture everywhere else we use this
- name: Translate architecture name in dockerfiles
replace: dest={{ item.path }} regexp="arch=x64" replace="arch={{ ansible_architecture }}"
with_items: "{{ dockerfiles.files }}"
when: ansible_architecture != "x86_64"

- name: Set jenkins authorized_Key in dockerfiles
replace: dest={{ item.path }} regexp="Jenkins_User_SSHKey" replace="{{ Jenkins_User_SSHKey }}"
with_items: "{{ dockerfiles.files }}"

- name: Create docker images for each distribution for test
command: docker build --cpu-period=100000 --cpu-quota=800000 -t aqa_{{ item }} --memory=8G -f /tmp/Dockerfiles/Dockerfile.{{ item }} /tmp/Dockerfiles
with_items:
- u1604
- u1804
- u2004
- u2104
- f33
- f34
- f35
- alp311
- alp312
- alp313
- alp314
- ubi8
- deb11

##############################################################
# Start the containers #
# If startallcontainers is skipped, only start three of them #
# ignore_errors simplest way to ignore if already started #
# #
# TODO: Check if started rather than ignore error? #
# hard to 'docker_container_info depends on start time #
# TODO: Use a calculated value instead of 2 core/6Gb #
##############################################################

- name: Start Ubuntu 16.04 container if not already started
community.docker.docker_container:
name: U1604_2222
image: aqa_u1604
ports:
- "2222:22"
cpus: 2.0
memory: 6G
state: started # Make sure container is presented (if not exist then start it)
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
detach: yes
tags: startcontainers
failed_when: false

- name: Start Ubuntu 18.04 container if not already started
community.docker.docker_container:
name: U1804_2223
image: aqa_u1804
ports:
- "2223:22"
cpus: 4.0
memory: 6G
state: started # Make sure container is presented (if not exist then start it)
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
detach: yes
tags: startcontainers, startallcontainers
failed_when: false

- name: Start Ubuntu 20.04 container if not already started
community.docker.docker_container:
name: U2004_2224
image: aqa_u2004
ports:
- "2224:22"
cpus: 2.0
memory: 6G
state: started # Make sure container is presented (if not exist then start it)
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
detach: yes
tags: startcontainers
failed_when: false

- name: Start Ubuntu 21.04 container if not already started
community.docker.docker_container:
name: U2104_2225
image: aqa_aqa_u2104u2004
ports:
- "2225:22"
cpus: 4.0
memory: 6G
state: started # Make sure container is presented (if not exist then start it)
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
detach: yes
tags: startcontainers, startallcontainers
failed_when: false

- name: Start Ubuntu 22.04 container if not already started
command: docker run --restart unless-stopped -p 2226:22 --cpus=4.0 --memory=6G --detach --name U2204_2226 aqa_u2204
tags: startcontainers, startallcontainers
failed_when: false

- name: Start fedora 33 container if not already started
community.docker.docker_container:
name: f33.2227
image: aqa_f33
ports:
- "2227:22"
cpus: 2.0
memory: 6G
state: started # Make sure container is presented (if not exist then start it)
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
detach: yes
tags: startcontainers
failed_when: false

- name: Start fedora 34 container if not already started
community.docker.docker_container:
name: f34.2232
image: aqa_f34
ports:
- "2232:22"
cpus: 2.0
memory: 6G
state: started # Make sure container is presented (if not exist then start it)
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
detach: yes
tags: startcontainers
failed_when: false

- name: Start fedora 35 container if not already started
community.docker.docker_container:
name: f35.2233
image: aqa_f35
ports:
- "2233:22"
cpus: 2.0
memory: 6G
state: started # Make sure container is presented (if not exist then start it)
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
detach: yes
tags: startcontainers
failed_when: false

- name: Start Alpine 3.11 container if not already started
community.docker.docker_container:
name: alp311.2228
image: aqa_alp311
ports:
- "2228:22"
cpus: 2.0
memory: 6G
state: started # Make sure container is presented (if not exist then start it)
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
detach: yes
tags: startcontainers, startallcontainers
failed_when: false

- name: Start Alpine 3.12 container if not already started
community.docker.docker_container:
name: alp312.2229
image: aqa_alp312
ports:
- "2229:22"
cpus: 2.0
memory: 6G
state: started # Make sure container is presented (if not exist then start it)
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
detach: yes
tags: startcontainers
failed_when: false

- name: Start Alpine 3.13 container if not already started
community.docker.docker_container:
name: alp313.2230
image: aqa_alp313
ports:
- "2230:22"
cpus: 2.0
memory: 6G
state: started # Make sure container is presented (if not exist then start it)
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
detach: yes
tags: startcontainers
failed_when: false

- name: Start Alpine 3.14 container if not already started
community.docker.docker_container:
name: alp314.2231
image: aqa_alp314
ports:
- "2231:22"
cpus: 2.0
memory: 6G
state: started # Make sure container is presented (if not exist then start it)
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
detach: yes
tags: startcontainers
failed_when: false

- name: Start UBI8 container if not already started
command: docker run --restart unless-stopped -p 2235:22 --cpus=2.0 --memory=6G --detach --name ubi8.2235 aqa_ubi8
tags: startcontainers
failed_when: false

- name: Start Deb11 container if not already started
command: docker run --restart unless-stopped -p 2211:22 --cpus=2.0 --memory=6G --detach --name deb11.2211 aqa_deb11
tags: startcontainers
failed_when: false

# lineinfile does not work here - similar to the operation in /var/log in adopt_etc
# lineinfile: path /proc/sys/kernel/core_pattern state: present: regexp: . line: core.%p
# therefore the following section wil not become live prior to a reboot
Expand Down
Loading

0 comments on commit 3be8cce

Please sign in to comment.