diff --git a/ansible/inventory.yml b/ansible/inventory.yml index 045736603..9cd310d6e 100644 --- a/ansible/inventory.yml +++ b/ansible/inventory.yml @@ -103,6 +103,8 @@ hosts: fedora43-x64-2: {ip: 159.65.246.5} rhel8-x64-1: {ip: 161.35.139.78, build_test_v8: yes, swap_file_size_mb: 2048} rhel9-x64-1: {ip: 134.122.12.240, swap_file_size_mb: 2048} + rhel10-x64-1: {ip: 159.89.189.244, swap_file_size_mb: 2048} + rhel10-x64-2: {ip: 138.197.66.92, swap_file_size_mb: 2048} ubuntu2204_docker-x64-1: {ip: 134.209.55.216} ubuntu2204_docker-x64-2: {ip: 159.89.183.200} ubuntu2404-x64-1: {ip: 165.227.180.106, swap_file_size_mb: 2048} @@ -261,13 +263,12 @@ hosts: aix72-ppc64_be-4: ip: 140.211.9.101 server_jobs: 6 - rhel8-ppc64_le-1: {ip: 140.211.168.183, user: cloud-user, build_test_v8: yes, swap_file_size_mb: 4096} - rhel8-ppc64_le-2: {ip: 140.211.168.76, user: cloud-user, build_test_v8: yes, swap_file_size_mb: 4096} - rhel8-ppc64_le-3: {ip: 140.211.168.221, user: cloud-user, build_test_v8: yes, swap_file_size_mb: 4096} rhel8-ppc64_le-4: {ip: 140.211.168.161, user: cloud-user, build_test_v8: yes, swap_file_size_mb: 4096} rhel8-ppc64_le-5: {ip: 140.211.168.5, user: cloud-user, build_test_v8: yes, swap_file_size_mb: 4096} rhel9-ppc64_le-1: {ip: 140.211.10.105, user: cloud-user, swap_file_size_mb: 2048} rhel9-ppc64_le-2: {ip: 140.211.10.98, user: cloud-user, swap_file_size_mb: 2048} + rhel10-ppc64_le-1: {ip: 140.211.168.71, user: cloud-user, swap_file_size_mb: 4096} + rhel10-ppc64_le-2: {ip: 140.211.169.145, user: cloud-user, swap_file_size_mb: 4096} ubuntu2404_docker-arm64-1: {ip: 140.211.169.11, user: ubuntu} - iinthecloud: diff --git a/ansible/roles/baselayout/tasks/partials/postinstall/rhel.yml b/ansible/roles/baselayout/tasks/partials/postinstall/rhel8.yml similarity index 100% rename from ansible/roles/baselayout/tasks/partials/postinstall/rhel.yml rename to ansible/roles/baselayout/tasks/partials/postinstall/rhel8.yml diff --git a/ansible/roles/baselayout/tasks/partials/postinstall/rhel9.yml b/ansible/roles/baselayout/tasks/partials/postinstall/rhel9.yml new file mode 100644 index 000000000..917753650 --- /dev/null +++ b/ansible/roles/baselayout/tasks/partials/postinstall/rhel9.yml @@ -0,0 +1,61 @@ +# Red Hat Enterprise Linux + +# Version lock packages to prevent them being updated. Unfortunately we cannot +# lock a package before it is installed. +# The generic "install packages" task in ansible/roles/baselayout/tasks/main.yml +# doesn't allow downgrading, which means if a package is already installed at +# a later version, specifying the version to install will not downgrade to that +# version. So here we check the version and downgrade if necessary before +# version locking to ensure we get what we want. + +- name: get installed clang version + ansible.builtin.command: clang -dumpversion + changed_when: false + check_mode: false + register: clang_dumpversion_result + +- name: get installed rust version + ansible.builtin.command: rustc -vV + changed_when: false + check_mode: false + register: rustc_vv_result + +# We don't need this. Get rid of it to simplify the number of packages to lock. +- name: remove tracker-miners packages + ansible.builtin.dnf: + autoremove: true + name: tracker-miners + state: absent + +- name: downgrade packages + ansible.builtin.dnf: + allow_downgrade: true + name: + - llvm-toolset-{{rhel_llvm_version}} + - rust-toolset-{{rhel_rust_version}} + state: present + when: 'clang_dumpversion_result.rc != 0 or clang_dumpversion_result.stdout != rhel_llvm_version or + rustc_vv_result.rc != 0 or "release: " + rhel_rust_version not in rustc_vv_result.stdout_lines' + +# Lock dependent packages as well to prevent those being updated. +- name: lock package versions + community.general.dnf_versionlock: + name: + - cargo-{{rhel_rust_version}} + - clang-{{rhel_llvm_version}} + - clang-libs-{{rhel_llvm_version}} + - clang-resource-filesystem-{{rhel_llvm_version}} + - compiler-rt-{{rhel_llvm_version}} + - libomp-{{rhel_llvm_version}} + - libomp-devel-{{rhel_llvm_version}} + - lld-{{rhel_llvm_version}} + - lld-libs-{{rhel_llvm_version}} + - llvm-{{rhel_llvm_version}} + - llvm-filesystem-{{rhel_llvm_version}} + - llvm-libs-{{rhel_llvm_version}} + - llvm-toolset-{{rhel_llvm_version}} + - rust-{{rhel_rust_version}} + - rust-std-static-{{rhel_rust_version}} + - rust-toolset-{{rhel_rust_version}} + - rustfmt-{{rhel_rust_version}} + state: present diff --git a/ansible/roles/baselayout/tasks/partials/repo/rhel10.yml b/ansible/roles/baselayout/tasks/partials/repo/rhel10.yml new file mode 100644 index 000000000..0a542267a --- /dev/null +++ b/ansible/roles/baselayout/tasks/partials/repo/rhel10.yml @@ -0,0 +1,22 @@ +--- + +# Red Hat Enterprise Linux 10 + +# EPEL 10's GPG key is only importable via `ansible.builtin.rpm_key` by newer +# versions of Ansible which we cannot use until we drop all RHEL 8 hosts. +- name: install GPG key for EPEL 10 + become: yes + ansible.builtin.command: + cmd: rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-10 + creates: /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-10 + +- name: Enable RHEL 10 repositories + community.general.rhsm_repository: + name: + - codeready-builder-for-rhel-10-{{ ansible_architecture }}-rpms + state: enabled + +- name: install EPEL 10 + ansible.builtin.dnf: + name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm + state: present diff --git a/ansible/roles/baselayout/vars/main.yml b/ansible/roles/baselayout/vars/main.yml index 47d7f636c..c592f6daa 100644 --- a/ansible/roles/baselayout/vars/main.yml +++ b/ansible/roles/baselayout/vars/main.yml @@ -98,6 +98,10 @@ packages: { 'ccache,cmake,gcc-c++,gcc-toolset-12,gcc-toolset-12-libatomic-devel,gcc-toolset-13,gcc-toolset-13-libatomic-devel,gcc-toolset-14-libatomic-devel,git,llvm-toolset-{{rhel_llvm_version}},make,python3,python3-dnf-plugin-versionlock,rust-toolset-{{rhel_rust_version}}', ], + rhel10: [ + 'ccache,cmake,gcc-c++,git,llvm-toolset-{{rhel_llvm_version}},make,python3,python3-dnf-plugin-versionlock,rust-toolset-{{rhel_rust_version}}', + ], + smartos: [ 'gccmakedep', 'git', diff --git a/ansible/roles/bootstrap/tasks/partials/rhel10.yml b/ansible/roles/bootstrap/tasks/partials/rhel10.yml new file mode 100644 index 000000000..76e7c678c --- /dev/null +++ b/ansible/roles/bootstrap/tasks/partials/rhel10.yml @@ -0,0 +1,21 @@ +--- + +# Red Hat Enterprise Linux 10 + +# Set the hostname as it will be used by subscription manager. +- name: gather facts + setup: + +- name: set hostname + ansible.builtin.hostname: + name: "{{ inventory_hostname | regex_replace('_', '--') }}" + +- name: register Red Hat subscription + community.general.redhat_subscription: + activationkey: "{{ secrets.rh_activationkey }}" + org_id: "{{ secrets.rh_org }}" + state: present + +- name: set up swap on Linux + include_tasks: linux-swap.yml + when: swap_file_size_mb is defined diff --git a/ansible/roles/java-base/vars/main.yml b/ansible/roles/java-base/vars/main.yml index 03b789a0e..4199a5fe2 100644 --- a/ansible/roles/java-base/vars/main.yml +++ b/ansible/roles/java-base/vars/main.yml @@ -14,6 +14,7 @@ packages: { 'macos': 'temurin17', 'rhel8': 'java-21-openjdk-headless', 'rhel9': 'java-25-openjdk-headless', + 'rhel10': 'java-25-openjdk-headless', 'smartos': 'openjdk17', 'ubuntu': 'openjdk-25-jre-headless', } diff --git a/ansible/roles/jenkins-worker/tasks/partials/tap2junit/rhel10.yml b/ansible/roles/jenkins-worker/tasks/partials/tap2junit/rhel10.yml new file mode 100644 index 000000000..be9a7ba06 --- /dev/null +++ b/ansible/roles/jenkins-worker/tasks/partials/tap2junit/rhel10.yml @@ -0,0 +1,17 @@ +--- + +# +# install tap2junit from pip +# + +- name: install pip + ansible.builtin.dnf: + name: ['python3.12','python3.12-pip'] + state: present + +- name: install tap2junit + ansible.builtin.pip: + name: tap2junit=={{ tap2junit_version }} + state: present + virtualenv: /home/{{ server_user }}/venv + virtualenv_command: python3.12 -m venv diff --git a/ansible/roles/jenkins-worker/vars/main.yml b/ansible/roles/jenkins-worker/vars/main.yml index 12c82da18..6ef2cb479 100644 --- a/ansible/roles/jenkins-worker/vars/main.yml +++ b/ansible/roles/jenkins-worker/vars/main.yml @@ -8,7 +8,7 @@ init: { aix: ['aix72', 'aix73'], ibmi: 'ibmi74', macos: 'macos', - systemd: ['debian', 'fedora', 'rhel7', 'rhel8', 'rhel9', 'ubuntu'], + systemd: ['debian', 'fedora', 'rhel7', 'rhel8', 'rhel9', 'rhel10', 'ubuntu'], svc: 'smartos', zos_start: 'zos' } diff --git a/ansible/roles/package-upgrade/vars/main.yml b/ansible/roles/package-upgrade/vars/main.yml index f66814e75..0430262b6 100644 --- a/ansible/roles/package-upgrade/vars/main.yml +++ b/ansible/roles/package-upgrade/vars/main.yml @@ -7,7 +7,7 @@ pm: { 'yum': ['centos', 'rhel7', 'ibmi'], 'apt': ['debian', 'ubuntu'], - 'dnf': ['aix72', 'aix73', 'fedora', 'rhel8', 'rhel9'], + 'dnf': ['aix72', 'aix73', 'fedora', 'rhel8', 'rhel9', 'rhel10'], 'pkgin': 'smartos', 'chocolatey': 'win', 'brew': 'macos' diff --git a/jenkins/scripts/select-compiler.sh b/jenkins/scripts/select-compiler.sh index eae05118a..0eaf2dc03 100644 --- a/jenkins/scripts/select-compiler.sh +++ b/jenkins/scripts/select-compiler.sh @@ -96,6 +96,14 @@ fi # Linux distros should be arch agnostic case $NODE_NAME in + *rhel10*|*ubi10*) + echo "Setting compiler for Node.js $NODEJS_MAJOR_VERSION on" `cat /etc/redhat-release` + # Default gcc in RHEL 10 is 14 + export CC="ccache gcc" + export CXX="ccache g++" + echo "Selected compiler:" `${CXX} -dumpversion` + return + ;; *rhel9*|*ubi9*) echo "Setting compiler for Node.js $NODEJS_MAJOR_VERSION on" `cat /etc/redhat-release` if [ "$NODEJS_MAJOR_VERSION" -gt "22" ]; then