Skip to content

Commit 6182c5b

Browse files
authored
unixPB: CentOS Stream 10 updates and dockerfiles (#3850)
* unixPB: add CentOS Stream 10 static docker file --------- Signed-off-by: Stewart X Addison <[email protected]>
1 parent 43fd5c7 commit 6182c5b

File tree

7 files changed

+150
-33
lines changed

7 files changed

+150
-33
lines changed

.github/workflows/check_dockerstatic.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ jobs:
4646
dockerfile: "Dockerfile.cent8"
4747
- os: centos-stream-9
4848
dockerfile: "Dockerfile.centstream9"
49+
- os: centos-stream-10
50+
dockerfile: "Dockerfile.centstream10"
4951
steps:
5052
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5153
- name: Test Dockerfile on ${{ matrix.os }}

ansible/docker/Dockerfile.CentOS10

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM quay.io/centos/centos:stream10
2+
3+
ARG git_sha
4+
ARG user=jenkins
5+
6+
# EPEL needed for ansible-collection-community-general
7+
RUN dnf -y update; yum clean all; \
8+
dnf -y install python-pip sudo; \
9+
dnf clean all
10+
11+
RUN pip install ansible
12+
#RUN ansible-galaxy collection install ansible.posix
13+
14+
COPY . /ansible
15+
16+
RUN echo "localhost ansible_connection=local" > /ansible/hosts
17+
18+
RUN ansible-playbook --version
19+
20+
RUN dnf -y install epel-release
21+
22+
RUN set -eux; \
23+
cd /ansible; \
24+
ansible-playbook -i hosts ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml -e "git_sha=$git_sha" --skip-tags="hosts_file,hostname,adoptopenjdk,jenkins,nagios,superuser,docker,swap_file,crontab,nvidia_cuda_toolkit"
25+
26+
RUN rm -rf /ansible; dnf remove ansible; dnf clean all
27+
28+
RUN groupadd -g 1000 ${user}
29+
RUN useradd -c "Jenkins user" -d /home/${user} -u 1000 -g 1000 -m ${user}
30+
31+
ENV \
32+
JDK7_BOOT_DIR="/usr/lib/jvm/java-1.7.0-openjdk" \
33+
JDK8_BOOT_DIR="/usr/lib/jvm/java-1.8.0-openjdk" \
34+
JDK10_BOOT_DIR="/usr/lib/jvm/jdk10" \
35+
JDK11_BOOT_DIR="/usr/lib/jvm/jdk11" \
36+
JDK13_BOOT_DIR="/usr/lib/jvm/jdk13" \
37+
JDK14_BOOT_DIR="/usr/lib/jvm/jdk14" \
38+
JDKLATEST_BOOT_DIR="/usr/lib/jvm/jdk14" \
39+
JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk"

ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks/CentOS.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
- name: Enable CodeReady Builder repo for CentOS9 Stream
4040
shell: dnf config-manager --set-enabled crb
4141
when:
42-
- ansible_distribution_major_version == "9"
42+
- ansible_distribution_major_version| int > 8
4343
tags: patch_update
4444

4545
- name: Clean dnf cache
@@ -69,21 +69,36 @@
6969
when: ansible_distribution_major_version == "7"
7070
tags: build_tools
7171

72-
- name: Install additional build tools for CentOS 8/9 Stream
72+
- name: Install additional build tools for CentOS 8+
7373
package: "name={{ item }} state=latest"
74-
with_items: "{{ Additional_Build_Tools_CentOS8_CentOS9Stream }}"
75-
when: ansible_distribution_major_version == "8" or ansible_distribution_major_version == "9"
74+
with_items: "{{ Additional_Build_Tools_CentOS8_Plus }}"
75+
when:
76+
- ansible_distribution_major_version|int > 7
77+
- ansible_distribution_major_version|int > 7
7678
tags: build_tools
7779

78-
- name: Install additional build tools for NOT CentOS8/9
80+
- name: Install additional build tools when NOT CentOS8+
7981
package: "name={{ item }} state=latest"
8082
with_items: "{{ Additional_Build_Tools_NOT_CentOS8_CentOS9Stream }}"
8183
when:
82-
- ansible_distribution_major_version != "8"
83-
- ansible_distribution_major_version != "9"
84+
- ansible_distribution_major_version|int < 8
8485
tags: build_tools
8586

86-
- name: Install Libdwarf.h for CentOS8 Stream
87+
- name: Install additional test tools for CentOS 10+ e.g. weston
88+
package: "name={{ item }} state=latest"
89+
with_items: "{{ Additional_Test_Tools_CentOS10_Plus }}"
90+
when:
91+
- ansible_distribution_major_version|int > 10
92+
tags: test_tools
93+
94+
- name: Install additional tools for CentOS pre-10
95+
package: "name={{ item }} state=latest"
96+
with_items: "{{ Additional_Test_Tools_PreCentOS10 }}"
97+
when:
98+
- ansible_distribution_major_version|int < 10
99+
tags: test_tools
100+
101+
- name: Install libdwarf.h for CentOS8 Stream
87102
shell: dnf --enablerepo=powertools install libdwarf-devel -y
88103
when: (ansible_distribution_major_version == "8") and (relfile_contents.stdout.find('Stream') != -1)
89104
tags: build_tools
@@ -117,7 +132,8 @@
117132
- name: Install jq for SBoM parsing for build reproducibility testing
118133
package: "name=jq state=latest"
119134
when:
120-
- ansible_distribution_major_version > "7"
135+
- ansible_distribution_major_version != "6"
136+
- ansible_distribution_major_version != "7"
121137
tags: test_tools
122138

123139
- name: Add devtools-2 to yum repo list for gcc 4.8
@@ -323,7 +339,8 @@
323339
name: java
324340
path: "{{ jre_path.stat.lnk_source }}/bin/java"
325341
when:
326-
- ansible_distribution_major_version > "6"
342+
- ansible_distribution_major_version|int > 6
343+
- ansible_distribution_major_version|int < 10
327344
tags: default_java
328345

329346
- name: Set Default JDK (CentOS 6)
@@ -339,7 +356,8 @@
339356
name: javac
340357
path: "{{ jdk_path.stat.lnk_source }}/bin/javac"
341358
when:
342-
- ansible_distribution_major_version > "6"
359+
- ansible_distribution_major_version|int > 6
360+
- ansible_distribution_major_version|int < 9
343361
tags: default_java
344362

345363
###########

ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/vars/CentOS.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Build_Tool_Packages:
2828
- gmp-devel
2929
- gnutls
3030
- gnutls-utils
31-
- java-1.8.0-openjdk-devel
3231
- libcurl-devel
3332
- libpng-devel
3433
- libXext-devel
@@ -56,7 +55,7 @@ Build_Tool_Packages:
5655
- pigz
5756
- strace # For SBOM dependency analysis
5857
- systemtap-sdt-devel
59-
- texinfo # For DevKit creation (binutils build)
58+
- texinfo
6059
- unzip
6160
- wget
6261
- which
@@ -73,7 +72,7 @@ Additional_Build_Tools_CentOS7:
7372
- ccache
7473
- procps-ng
7574

76-
Additional_Build_Tools_CentOS8_CentOS9Stream:
75+
Additional_Build_Tools_CentOS8_Plus:
7776
- glibc-locale-source
7877
- glibc-langpack-ja # required for creating Japanese locales
7978
- glibc-langpack-ko # required for creating Korean locales
@@ -86,6 +85,7 @@ Additional_Build_Tools_CentOS8_CentOS9Stream:
8685
Additional_Build_Tools_NOT_CentOS8_CentOS9Stream:
8786
- lbzip2
8887
- java-1.7.0-openjdk-devel
88+
- java-1.8.0-openjdk-devel
8989
- ntp
9090

9191
Additional_Build_Tools_CentOS_x86:
@@ -102,13 +102,22 @@ Additional_Build_Tools_CentOS8_Stream:
102102
Additional_Build_Tools_NOT_CentOS8_Stream:
103103
- libdwarf-devel # OpenJ9
104104

105+
Additional_Test_Tools_CentOS10_Plus:
106+
- weston
107+
- xwayland-run
108+
109+
Additional_Test_Tools_PreCentOS10:
110+
- xorg-x11-server-Xvfb
111+
- java-1.8.0-openjdk-devel
112+
105113
Test_Tool_Packages:
106114
- gcc
107115
- gcc-c++
108116
- unzip
109117
- zlib-devel
110118
- perl-devel
111119
- libcurl-devel
120+
- openssl
112121
- openssl-devel
113122
- perl
114123
- perl-Test-Simple
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FROM quay.io/centos/centos:stream10
2+
3+
ARG ant_version="1.10.15"
4+
ARG ant_512checksum="1de7facbc9874fa4e5a2f045d5c659f64e0b89318c1dbc8acc6aae4595c4ffaf90a7b1ffb57f958dd08d6e086d3fff07aa90e50c77342a0aa5c9b4c36bff03a9"
5+
6+
RUN dnf -y update && dnf install -y perl openssh-server unzip zip wget epel-release
7+
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -P ""
8+
9+
# Download JDK
10+
RUN curl -Lo /tmp/jdk17.tar.gz 'https://api.adoptium.net/v3/binary/latest/17/ga/linux/aarch64/jdk/hotspot/normal/eclipse?project=jdk'
11+
# This looks odd but without it CS10 hits a lock file issue in the later GPG verify step
12+
# Ref: https://adoptium.slack.com/archives/C53GHCXL4/p1734707508976569?thread_ts=1734705997.537229&cid=C53GHCXL4
13+
RUN mkdir -p /root/.gnupg/public-keys.d
14+
RUN gpg --keyserver keyserver.ubuntu.com --recv-keys 3B04D753C9050D9A5D343F39843C48A565F8F04B
15+
# Get sig file for latest jdk17 ga
16+
RUN curl -Lo /tmp/jdk17.sig `curl -s 'https://api.adoptium.net/v3/assets/feature_releases/17/ga?architecture=aarch64&heap_size=normal&image_type=jdk&jvm_impl=hotspot&os=linux&page=0&page_size=1&project=jdk&vendor=eclipse' | grep signature_link | awk '{split($0,a,"\""); print a[4]}'`
17+
RUN gpg --verify /tmp/jdk17.sig /tmp/jdk17.tar.gz
18+
RUN mkdir -p /usr/lib/jvm/jdk17 && tar -xpzf /tmp/jdk17.tar.gz -C /usr/lib/jvm/jdk17 --strip-components=1
19+
20+
# Install Ant
21+
RUN curl -Lo /tmp/ant.zip "https://archive.apache.org/dist/ant/binaries/apache-ant-$ant_version-bin.zip"
22+
RUN curl -Lo /tmp/ant-contrib.tgz https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.tar.gz
23+
RUN echo "$ant_512checksum /tmp/ant.zip" > /tmp/ant.sha512
24+
RUN echo "0fd2771dca2b8b014a4cb3246715b32e20ad5d26754186d82eee781507a183d5e63064890b95eb27c091c93c1209528a0b18a6d7e6901899319492a7610e74ad /tmp/ant-contrib.tgz" >> /tmp/ant.sha512
25+
RUN sha512sum --check --strict /tmp/ant.sha512
26+
RUN ln -s /usr/local/apache-ant-$ant_version/bin/ant /usr/bin/ant
27+
RUN unzip -q -d /usr/local /tmp/ant.zip
28+
RUN tar xpfz /tmp/ant-contrib.tgz -C /usr/local/apache-ant-$ant_version/lib --strip-components=2 ant-contrib/lib/ant-contrib.jar
29+
# Clear up space
30+
RUN rm /tmp/jdk17.tar.gz /tmp/ant.zip /tmp/ant-contrib.tgz /tmp/jdk17.sig /tmp/ant.sha512
31+
32+
# Set up jenkins user
33+
RUN useradd -m -d /home/jenkins jenkins
34+
RUN mkdir /home/jenkins/.ssh
35+
RUN echo "Jenkins_User_SSHKey" > /home/jenkins/.ssh/authorized_keys
36+
RUN chown -R jenkins /home/jenkins/.ssh
37+
RUN chmod -R og-rwx /home/jenkins/.ssh
38+
# RUN service ssh start
39+
CMD ["/usr/sbin/sshd","-D"]
40+
41+
RUN dnf -y --enablerepo=crb install turbojpeg
42+
RUN dnf install -y git make gcc weston xwayland-run libXrender libXi libXtst fontconfig fakeroot procps-ng hostname diffutils shared-mime-info
43+
# Install SSL Test packages
44+
RUN dnf install -y gnutls gnutls-utils nss nss-tools openssl
45+
# ENTRYPOINT /usr/lib/jvm/jdk17/bin/java
46+
EXPOSE 22
47+
# Start with docker run -p 2222:22 UUID

ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ A verbose description of our static docker container system can be found in the
66
The DockerStatic ansible role provides allows us to automate the setup of our dockerhost machines using the [dockerhost.yml](https://github.com/adoptium/infrastructure/blob/master/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/dockerhost.yml) playbook.
77

88
## Our current Dockerhost machines
9-
* [docker-packet-ubuntu2004-amd-1](https://ci.adoptium.net/computer/docker-packet-ubuntu2004-amd-1/)
10-
* [docker-packet-ubuntu2004-intel-1](https://ci.adoptium.net/computer/docker-packet-ubuntu2004-intel-1/)
11-
* [docker-packet-ubuntu2004-armv8-1](https://ci.adoptium.net/computer/docker-packet-ubuntu2004-armv8-1/)
12-
* [dockerhost-equinix-ubuntu2004-armv8-1](https://ci.adoptium.net/computer/dockerhost-equinix-ubuntu2004-armv8-1/)
9+
* [dockerhost-azure-ubuntu2204-x64-1](https://ci.adoptium.net/computer/dockerhost-azure-ubuntu2204-x64-1/)
10+
* [dockerhost-equinix-ubuntu2204-armv8-1](https://ci.adoptium.net/computer/dockerhost-equinix-ubuntu2204-armv8-1/)
11+
* [dockerhost-equinix-ubuntu2404-armv8-1](https://ci.adoptium.net/computer/dockerhost-equinix-ubuntu2404-armv8-1/)
12+
* [dockerhost-marist-ubuntu2404-s390x-1](https://ci.adoptium.net/computer/dockerhost-marist-ubuntu2404-s390x-1/)
13+
* [dockerhost-osuosl-ubuntu2404-ppc64le-1](https://ci.adoptium.net/computer/dockerhost-osuosl-ubuntu2404-ppc64le-1/)
14+
* [dockerhost-skytap-ubuntu2004-ppc64le-1](https://ci.adoptium.net/computer/dockerhost-skytap-ubuntu2004-ppc64le-1/)
15+
* [dockerhost-skytap-ubuntu2204-x64-1](https://ci.adoptium.net/computer/dockerhost-skytap-ubuntu2204-x64-1/) (Generally offline)
1316

14-
15-
## Setting up a new DockerStatic container (recommended)
17+
## Setting up a new DockerStatic container with ansible (recommended method)
1618

1719
The [dockerhost.yml](https://github.com/adoptium/infrastructure/blob/master/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/dockernode.yml) playbook is used to deploy docker containers onto our dockerhost machines.
1820

@@ -23,7 +25,7 @@ ansible-playbook -u root -i <host-file> AdoptOpenJDK_Unix_Playbook
2325
/dockernode.yml -t "deploy" -e "docker_images=u2204,alp319,deb12"
2426
```
2527

26-
The `docker_images` variable is where the user can specifiy which docker containers to deploy, using the dockerfiles avaiable [here](https://github.com/adoptium/infrastructure/tree/master/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/Dockerfiles) (which do get updated regularly).
28+
The `docker_images` variable is where the user can specify which docker containers to deploy, using the dockerfiles avaiable [here](https://github.com/adoptium/infrastructure/tree/master/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/Dockerfiles) (which do get updated regularly).
2729

2830
The `dockerhost.yml` playbook can deploy single, multiple and duplicate containers, for example
2931

ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/logs/tasks/main.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33

44
- name: Set Log path
55
set_fact:
6-
log_path: /var/log
6+
log_path: /var/log
77

88
- name: Set variables (MacOS)
99
set_fact:
10-
user_group: "staff"
10+
user_group: "staff"
1111
when:
12-
- ansible_distribution == "MacOSX"
12+
- ansible_distribution == "MacOSX"
1313

1414
- name: Set variables (Not MacOS)
1515
set_fact:
16-
user_group: "root"
16+
user_group: "root"
1717
when:
18-
- ansible_distribution != "MacOSX"
18+
- ansible_distribution != "MacOSX"
1919

2020
- name: Get Date and Time
2121
shell: date +%Y-%m-%d\ %H:%M:%S
@@ -30,16 +30,16 @@
3030

3131
- name: Set git_output to git_sha
3232
set_fact:
33-
git_sha: "{{ git_output.stdout }}"
33+
git_sha: "{{ git_output.stdout }}"
3434
when: git_sha is not defined
3535

3636
- name: Update Log File
3737
lineinfile:
38-
owner: root
39-
group: "{{ user_group }}"
40-
create: yes
41-
path: "{{ log_path }}/ansible.log"
42-
insertafter: EOF
43-
line: "{{ position }} {{ date_output.stdout }} {{ git_sha }}"
38+
owner: root
39+
group: "{{ user_group }}"
40+
create: yes
41+
path: "{{ log_path }}/ansible.log"
42+
insertafter: EOF
43+
line: "{{ position }} {{ date_output.stdout }} {{ git_sha }}"
4444
become: yes
4545
become_user: root

0 commit comments

Comments
 (0)