From 24912dc23b03b0169fd145cb6fc7e0b48cb44d67 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 16 Aug 2024 15:14:41 +0100 Subject: [PATCH] ansible: add gcc 12 to Linux containers (#3865) Add gcc 12 to RHEL/UBI and Ubuntu containers. Update arm containers from Ubuntu 20.04 to 22.04. Remove unused CentOS 7 container. Refs: https://github.com/nodejs/build/issues/3806 Refs: https://github.com/nodejs/build/pull/3846 --- .../docker/templates/centos7.Dockerfile.j2 | 58 --------- .../docker/templates/rhel8.Dockerfile.j2 | 11 +- .../templates/rhel8_arm_cross.Dockerfile.j2 | 1 + .../docker/templates/ubi81.Dockerfile.j2 | 11 +- .../ubuntu1804_sharedlibs.Dockerfile.j2 | 6 +- .../ubuntu2004_sharedlibs.Dockerfile.j2 | 111 ------------------ ...Dockerfile.j2 => ubuntu2204.Dockerfile.j2} | 6 +- ...ile.j2 => ubuntu2204_armv7l.Dockerfile.j2} | 6 +- 8 files changed, 20 insertions(+), 190 deletions(-) delete mode 100644 ansible/roles/docker/templates/centos7.Dockerfile.j2 delete mode 100644 ansible/roles/docker/templates/ubuntu2004_sharedlibs.Dockerfile.j2 rename ansible/roles/docker/templates/{ubuntu2004.Dockerfile.j2 => ubuntu2204.Dockerfile.j2} (97%) rename ansible/roles/docker/templates/{ubuntu2004_armv7l.Dockerfile.j2 => ubuntu2204_armv7l.Dockerfile.j2} (96%) diff --git a/ansible/roles/docker/templates/centos7.Dockerfile.j2 b/ansible/roles/docker/templates/centos7.Dockerfile.j2 deleted file mode 100644 index e926b22b1..000000000 --- a/ansible/roles/docker/templates/centos7.Dockerfile.j2 +++ /dev/null @@ -1,58 +0,0 @@ -FROM centos:7 - -ENV LC_ALL C -ENV USER {{ server_user }} -ENV JOBS {{ server_jobs | default(ansible_processor_vcpus) }} -ENV SHELL /bin/bash -ENV HOME /home/{{ server_user }} -ENV PATH /usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV NODE_COMMON_PIPE /home/{{ server_user }}/test.pipe -ENV NODE_TEST_DIR /home/{{ server_user }}/tmp -ENV OSTYPE linux-gnu -ENV OSVARIANT docker -ENV DESTCPU {{ arch }} -ENV ARCH {{ arch }} - -RUN yum -y update && \ - yum install -y centos-release-scl && \ - yum install -y \ - gcc \ - gcc-c++ \ - make \ - git \ - java-11-openjdk-headless \ - pkgconfig \ - curl \ - rh-python38-python-pip \ - fontconfig-devel \ - libtool \ - automake - -RUN . /opt/rh/rh-python38/enable && pip3 install tap2junit=={{ tap2junit_version }} - -RUN groupadd --gid {{ server_user_gid.stdout_lines[0] }} {{ server_user }} - -RUN adduser --gid {{ server_user_gid.stdout_lines[0] }} --uid {{ server_user_uid.stdout_lines[0] }} -c {{ server_user }} {{ server_user }} - -RUN yum -y install epel-release -RUN yum -y install ccache - -RUN yum -y install glibc-devel zip unzip perl openssh-clients libgomp make scl-utils avahi kernel-devel policycoreutils-python which libgfortran -RUN rpm -ivh https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-runtime-6.1-1.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-elfutils-libs-0.168-3.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-systemtap-runtime-3.0-8s.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-ltrace-0.7.91-17.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-strace-4.12-3.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-systemtap-client-3.0-8s.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-gcc-gfortran-6.3.1-3.1.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-binutils-2.27-12.el7.1.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-elfutils-libelf-0.168-3.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-elfutils-0.168-3.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-gdb-7.12.1-48.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-make-4.1-3.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-gcc-c++-6.3.1-3.1.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-memstomp-0.1.5-5.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-dwz-0.12-1.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-systemtap-3.0-8s.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-toolchain-6.1-1.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-gcc-6.3.1-3.1.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-valgrind-3.12.0-1.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-libstdc++-devel-6.3.1-3.1.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-oprofile-1.1.0-4.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-systemtap-devel-3.0-8s.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-perftools-6.1-1.el7.aarch64.rpm https://buildlogs.centos.org/c7-devtoolset-6.aarch64/Packages/devtoolset-6-6.1-1.el7.aarch64.rpm - -RUN yum -y install devtoolset-8 devtoolset-8-libatomic-devel - -VOLUME /home/{{ server_user }}/ /home/{{ server_user }}/.ccache - -USER iojs:iojs - -ENV CCACHE_TEMPDIR /home/iojs/.ccache/{{ item.name }} - -CMD cd /home/iojs \ - && . /opt/rh/rh-python38/enable \ - && curl https://ci.nodejs.org/jnlpJars/agent.jar -O \ - && java -Xmx{{ server_ram|default('128m') }} \ - -jar /home/{{ server_user }}/agent.jar \ - -url {{ jenkins_url }} \ - -name {{ item.name }} \ - -secret {{ item.secret }} diff --git a/ansible/roles/docker/templates/rhel8.Dockerfile.j2 b/ansible/roles/docker/templates/rhel8.Dockerfile.j2 index 9776acce1..9f56e2ae1 100644 --- a/ansible/roles/docker/templates/rhel8.Dockerfile.j2 +++ b/ansible/roles/docker/templates/rhel8.Dockerfile.j2 @@ -19,6 +19,7 @@ RUN dnf install --disableplugin=subscription-manager -y \ && dnf install --disableplugin=subscription-manager -y \ ccache \ gcc-c++ \ + gcc-toolset-12 \ git \ java-17-openjdk-headless \ make \ @@ -28,11 +29,11 @@ RUN dnf install --disableplugin=subscription-manager -y \ && dnf --disableplugin=subscription-manager clean all RUN dnf install --disableplugin=subscription-manager -y \ - http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-binutils-2.35-11.el8.{{ ansible_architecture }}.rpm \ - http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-gcc-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \ - http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-gcc-c++-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \ - http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-libstdc++-devel-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \ - http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-runtime-10.1-0.el8.{{ ansible_architecture }}.rpm + http://vault.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-binutils-2.35-11.el8.{{ ansible_architecture }}.rpm \ + http://vault.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-gcc-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \ + http://vault.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-gcc-c++-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \ + http://vault.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-libstdc++-devel-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \ + http://vault.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-runtime-10.1-0.el8.{{ ansible_architecture }}.rpm RUN groupadd -r -g {{ server_user_gid.stdout_lines[0] }} {{ server_user }} \ && adduser -r -m -d /home/{{ server_user }}/ \ diff --git a/ansible/roles/docker/templates/rhel8_arm_cross.Dockerfile.j2 b/ansible/roles/docker/templates/rhel8_arm_cross.Dockerfile.j2 index dc5e2d102..acd43229c 100644 --- a/ansible/roles/docker/templates/rhel8_arm_cross.Dockerfile.j2 +++ b/ansible/roles/docker/templates/rhel8_arm_cross.Dockerfile.j2 @@ -19,6 +19,7 @@ RUN dnf install --disableplugin=subscription-manager -y \ && dnf install --disableplugin=subscription-manager -y \ ccache \ gcc-c++ \ + gcc-toolset-12 \ git \ glibc-devel.i686 \ java-17-openjdk-headless \ diff --git a/ansible/roles/docker/templates/ubi81.Dockerfile.j2 b/ansible/roles/docker/templates/ubi81.Dockerfile.j2 index 139a69a6a..185172a02 100644 --- a/ansible/roles/docker/templates/ubi81.Dockerfile.j2 +++ b/ansible/roles/docker/templates/ubi81.Dockerfile.j2 @@ -19,6 +19,7 @@ RUN dnf install --disableplugin=subscription-manager -y \ && dnf install --disableplugin=subscription-manager -y \ ccache \ gcc-c++ \ + gcc-toolset-12 \ git \ java-17-openjdk-headless \ make \ @@ -28,11 +29,11 @@ RUN dnf install --disableplugin=subscription-manager -y \ && dnf --disableplugin=subscription-manager clean all RUN dnf install --disableplugin=subscription-manager -y \ - http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-binutils-2.35-11.el8.{{ ansible_architecture }}.rpm \ - http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-gcc-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \ - http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-gcc-c++-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \ - http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-libstdc++-devel-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \ - http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-runtime-10.1-0.el8.{{ ansible_architecture }}.rpm + http://vault.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-binutils-2.35-11.el8.{{ ansible_architecture }}.rpm \ + http://vault.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-gcc-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \ + http://vault.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-gcc-c++-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \ + http://vault.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-libstdc++-devel-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \ + http://vault.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-runtime-10.1-0.el8.{{ ansible_architecture }}.rpm RUN groupadd -r -g {{ server_user_gid.stdout_lines[0] }} {{ server_user }} \ && adduser -r -m -d /home/{{ server_user }}/ \ diff --git a/ansible/roles/docker/templates/ubuntu1804_sharedlibs.Dockerfile.j2 b/ansible/roles/docker/templates/ubuntu1804_sharedlibs.Dockerfile.j2 index 68d1549b7..5135785a8 100644 --- a/ansible/roles/docker/templates/ubuntu1804_sharedlibs.Dockerfile.j2 +++ b/ansible/roles/docker/templates/ubuntu1804_sharedlibs.Dockerfile.j2 @@ -44,11 +44,7 @@ RUN addgroup --gid {{ server_user_gid.stdout_lines[0] }} {{ server_user }} RUN adduser --gid {{ server_user_gid.stdout_lines[0] }} --uid {{ server_user_uid.stdout_lines[0] }} --disabled-password --gecos {{ server_user }} {{ server_user }} -ENV ICU64DIR=/opt/icu-64 \ - ICU65DIR=/opt/icu-65 \ - ICU67DIR=/opt/icu-67 \ - ICU68DIR=/opt/icu-68 \ - ICU69DIR=/opt/icu-69 \ +ENV ICU69DIR=/opt/icu-69 \ ICU71DIR=/opt/icu-71 \ ICU73DIR=/opt/icu-73 diff --git a/ansible/roles/docker/templates/ubuntu2004_sharedlibs.Dockerfile.j2 b/ansible/roles/docker/templates/ubuntu2004_sharedlibs.Dockerfile.j2 deleted file mode 100644 index 25f4b3df8..000000000 --- a/ansible/roles/docker/templates/ubuntu2004_sharedlibs.Dockerfile.j2 +++ /dev/null @@ -1,111 +0,0 @@ -FROM ubuntu:20.04 - -ENV LC_ALL C -ENV USER {{ server_user }} -ENV JOBS {{ server_jobs | default(ansible_processor_vcpus) }} -ENV SHELL /bin/bash -ENV HOME /home/{{ server_user }} -ENV PATH /usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV NODE_COMMON_PIPE /home/{{ server_user }}/test.pipe -ENV NODE_TEST_DIR /home/{{ server_user }}/tmp -ENV OSTYPE linux-gnu -ENV OSVARIANT docker -ENV DESTCPU {{ arch }} -ENV ARCH {{ arch }} -ENV DEBIAN_FRONTEND noninteractive - -RUN apt-get update && apt-get install apt-utils -y && \ - apt-get dist-upgrade -y && apt-get install -y \ - ccache \ - g++-8 \ - gcc-8 \ - g++-10 \ - gcc-10 \ - git \ - openjdk-17-jre-headless \ - pkg-config \ - curl \ - python3-pip \ - python-is-python3 \ - libfontconfig1 \ - libtool \ - automake - -RUN pip3 install tap2junit=={{ tap2junit_version }} - -RUN addgroup --gid {{ server_user_gid.stdout_lines[0] }} {{ server_user }} - -RUN adduser --gid {{ server_user_gid.stdout_lines[0] }} --uid {{ server_user_uid.stdout_lines[0] }} --disabled-password --gecos {{ server_user }} {{ server_user }} - -ENV ICU64DIR=/opt/icu-64.1 \ - ICU65DIR=/opt/icu-65.1 \ - ICU67DIR=/opt/icu-67.1 \ - ICU68DIR=/opt/icu-68.2 \ - ICU69DIR=/opt/icu-69.1 \ - ICU71DIR=/opt/icu-71.1 \ - ICU73DIR=/opt/icu-73.2 - -RUN for ICU_ENV in $(env | grep ICU..DIR); do \ - ICU_PREFIX=$(echo $ICU_ENV | cut -d '=' -f 2) && \ - ICU_VERSION=$(echo $ICU_PREFIX | cut -d '-' -f 2) && \ - ICU_MAJOR=$(echo $ICU_VERSION | cut -d '.' -f 1) && \ - ICU_MINOR=$(echo $ICU_VERSION | cut -d '.' -f 2) && \ - mkdir -p /tmp/icu-$ICU_VERSION && \ - cd /tmp/icu-$ICU_VERSION && \ - curl -sL "https://github.com/unicode-org/icu/releases/download/release-$ICU_MAJOR-$ICU_MINOR/icu4c-${ICU_MAJOR}_$ICU_MINOR-src.tgz" | tar zxv --strip=1 && \ - cd source && \ - ./runConfigureICU Linux --prefix=$ICU_PREFIX && \ - make -j $JOBS && \ - make install && \ - rm -rf /tmp/icu-$ICU_VERSION; \ - done - -ENV OPENSSL111VER 1.1.1n -ENV OPENSSL111DIR /opt/openssl-$OPENSSL111VER - -RUN mkdir -p /tmp/openssl_$OPENSSL111VER && \ - cd /tmp/openssl_$OPENSSL111VER && \ - curl -sL https://www.openssl.org/source/openssl-$OPENSSL111VER.tar.gz | tar zxv --strip=1 && \ - ./config --prefix=$OPENSSL111DIR && \ - make -j 6 && \ - make install && \ - rm -rf /tmp/openssl_$OPENSSL111VER - -ENV OPENSSL3VER 3.0.2+quic -ENV OPENSSL3DIR /opt/openssl-$OPENSSL3VER -# TODO(richardlau) remove OPENSSL300DIR when the CI has been updated to use OPENSSL3DIR -ENV OPENSSL300DIR $OPENSSL3DIR - -RUN mkdir -p /tmp/openssl-$OPENSSL3VER && \ - cd /tmp/openssl-$OPENSSL3VER && \ - git clone https://github.com/quictls/openssl.git -b openssl-$OPENSSL3VER --depth 1 && \ - cd openssl && \ - ./config --prefix=$OPENSSL3DIR && \ - make -j 6 && \ - make install && \ - rm -rf /tmp/openssl-$OPENSSL3VER - -ENV ZLIBVER 1.2.13 -ENV ZLIB12DIR /opt/zlib_$ZLIBVER - -RUN mkdir -p /tmp/zlib_$ZLIBVER && \ - cd /tmp/zlib_$ZLIBVER && \ - curl -sL https://zlib.net/fossils/zlib-$ZLIBVER.tar.gz | tar zxv --strip=1 && \ - ./configure --prefix=$ZLIB12DIR && \ - make -j 6 && \ - make install && \ - rm -rf /tmp/zlib_$ZLIBVER - -VOLUME /home/{{ server_user }}/ /home/{{ server_user }}/.ccache - -USER iojs:iojs - -ENV CCACHE_TEMPDIR /home/iojs/.ccache/{{ item.name }} - -CMD cd /home/iojs \ - && curl https://ci.nodejs.org/jnlpJars/agent.jar -O \ - && java -Xmx{{ server_ram|default('128m') }} \ - -jar /home/{{ server_user }}/agent.jar \ - -url {{ jenkins_url }} \ - -name {{ item.name }} \ - -secret {{ item.secret }} diff --git a/ansible/roles/docker/templates/ubuntu2004.Dockerfile.j2 b/ansible/roles/docker/templates/ubuntu2204.Dockerfile.j2 similarity index 97% rename from ansible/roles/docker/templates/ubuntu2004.Dockerfile.j2 rename to ansible/roles/docker/templates/ubuntu2204.Dockerfile.j2 index 83c7a55e3..6f78f6339 100644 --- a/ansible/roles/docker/templates/ubuntu2004.Dockerfile.j2 +++ b/ansible/roles/docker/templates/ubuntu2204.Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 ENV LC_ALL C ENV USER {{ server_user }} @@ -16,10 +16,10 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y \ ccache \ - g++-8 \ - gcc-8 \ g++-10 \ gcc-10 \ + g++-12 \ + gcc-12 \ git \ openjdk-17-jre-headless \ curl \ diff --git a/ansible/roles/docker/templates/ubuntu2004_armv7l.Dockerfile.j2 b/ansible/roles/docker/templates/ubuntu2204_armv7l.Dockerfile.j2 similarity index 96% rename from ansible/roles/docker/templates/ubuntu2004_armv7l.Dockerfile.j2 rename to ansible/roles/docker/templates/ubuntu2204_armv7l.Dockerfile.j2 index f72876cc4..accc17f70 100644 --- a/ansible/roles/docker/templates/ubuntu2004_armv7l.Dockerfile.j2 +++ b/ansible/roles/docker/templates/ubuntu2204_armv7l.Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM arm32v7/ubuntu:20.04 +FROM arm32v7/ubuntu:22.04 ENV LC_ALL C ENV USER {{ server_user }} @@ -14,10 +14,10 @@ ENV DESTCPU {{ arch }} ENV ARCH {{ arch }} ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y ccache \ - g++-8 \ - gcc-8 \ g++-10 \ gcc-10 \ + g++-12 \ + gcc-12 \ git \ openjdk-17-jre-headless \ pkg-config \