From 75d269cfc407f53e02f226530e0e4d85c4c765c3 Mon Sep 17 00:00:00 2001 From: Carlos O'Ryan Date: Tue, 2 Jul 2024 17:52:18 +0000 Subject: [PATCH] ci: enable `gcc-oldest` build --- ci/cloudbuild/builds/gcc-7.3.sh | 42 ---- ci/cloudbuild/dockerfiles/centos-7.Dockerfile | 199 ------------------ ci/cloudbuild/triggers/gcc-7-3-ci.yaml | 31 --- ci/cloudbuild/triggers/gcc-7-3-pr.yaml | 32 --- ci/cloudbuild/triggers/gcc-oldest-ci.yaml | 3 + ci/cloudbuild/triggers/gcc-oldest-pr.yaml | 5 +- 6 files changed, 7 insertions(+), 305 deletions(-) delete mode 100755 ci/cloudbuild/builds/gcc-7.3.sh delete mode 100644 ci/cloudbuild/dockerfiles/centos-7.Dockerfile delete mode 100644 ci/cloudbuild/triggers/gcc-7-3-ci.yaml delete mode 100644 ci/cloudbuild/triggers/gcc-7-3-pr.yaml diff --git a/ci/cloudbuild/builds/gcc-7.3.sh b/ci/cloudbuild/builds/gcc-7.3.sh deleted file mode 100755 index 163b81a1d9c55..0000000000000 --- a/ci/cloudbuild/builds/gcc-7.3.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -euo pipefail - -source "$(dirname "$0")/../../lib/init.sh" -source module ci/cloudbuild/builds/lib/cmake.sh -source module ci/cloudbuild/builds/lib/ctest.sh -source module ci/lib/io.sh - -# We run this test in a docker image that includes the oldest GCC that we -# support, which happens to be 7.3 currently. -export CC=gcc -export CXX=g++ - -mapfile -t cmake_args < <(cmake::common_args) -read -r ENABLED_FEATURES < <(features::always_build_cmake) -ENABLED_FEATURES="${ENABLED_FEATURES},compute" -readonly ENABLED_FEATURES - -io::run cmake "${cmake_args[@]}" \ - -DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" -io::run cmake --build cmake-out -mapfile -t ctest_args < <(ctest::common_args) -# This platform does not support `env -C`. -( - cd cmake-out - io::run ctest "${ctest_args[@]}" -LE "integration-test" -) diff --git a/ci/cloudbuild/dockerfiles/centos-7.Dockerfile b/ci/cloudbuild/dockerfiles/centos-7.Dockerfile deleted file mode 100644 index 9e3e1cceb0ef4..0000000000000 --- a/ci/cloudbuild/dockerfiles/centos-7.Dockerfile +++ /dev/null @@ -1,199 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM centos:7 - -# First install the development tools and OpenSSL. The development tools -# distributed with CentOS 7 are too old to build the project. In these -# instructions, we use `cmake3` and `gcc-7` obtained from -# [Software Collections](https://www.softwarecollections.org/). - -RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -RUN yum install -y centos-release-scl yum-utils -RUN yum-config-manager --enable rhel-server-rhscl-7-rpms -RUN yum makecache && \ - yum install -y automake cmake3 curl-devel devtoolset-7 gcc gcc-c++ \ - git libtool make ninja-build openssl-devel patch re2-devel tar wget \ - which zlib-devel -RUN ln -sf /usr/bin/cmake3 /usr/bin/cmake && ln -sf /usr/bin/ctest3 /usr/bin/ctest - -# In order to use the `devtoolset-7` Software Collection we're supposed to run -# `scl enable devtoolset-7 bash`, which starts a new shell with the environment -# configured correctly. However, we can't do that in this Dockerfile, AND we -# want the instructions that we generate for the user to say the right thing. -# So this block is ignored, and we manually set some environment variables to -# make the devtoolset-7 available. After this ignored block, we'll include the -# correct instructions for the user. NOTE: These env values were obtained by -# manually running the `scl ...` command (above) then copying the values set in -# its environment. -ENV PATH /opt/rh/devtoolset-7/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV LD_LIBRARY_PATH /opt/rh/devtoolset-7/root/usr/lib64:/opt/rh/devtoolset-7/root/usr/lib:/opt/rh/devtoolset-7/root/usr/lib64/dyninst:/opt/rh/devtoolset-7/root/usr/lib/dyninst:/opt/rh/devtoolset-7/root/usr/lib64:/opt/rh/devtoolset-7/root/usr/lib - -# CentOS-7 ships with `pkg-config` 0.27.1, which has a -# [bug](https://bugs.freedesktop.org/show_bug.cgi?id=54716) that can make -# invocations take extremely long to complete. - -WORKDIR /var/tmp/build/pkgconf -RUN curl -fsSL https://distfiles.ariadne.space/pkgconf/pkgconf-2.2.0.tar.gz | \ - tar -xzf - --strip-components=1 && \ - ./configure --with-system-libdir=/lib64:/usr/lib64 --with-system-includedir=/usr/include && \ - make -j ${NCPU:-4} && \ - make install && \ - ldconfig && cd /var/tmp && rm -fr build - -# The following steps will install libraries and tools in `/usr/local`. By -# default, CentOS-7 does not search for shared libraries in these directories, -# there are multiple ways to solve this problem, the following steps are one -# solution: - -RUN (echo "/usr/local/lib" ; echo "/usr/local/lib64") | \ - tee /etc/ld.so.conf.d/usrlocal.conf -ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig -ENV PATH=/usr/local/bin:${PATH} - -WORKDIR /var/tmp/build/abseil-cpp -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DABSL_BUILD_TESTING=OFF \ - -DABSL_PROPAGATE_CXX_STD=ON \ - -DBUILD_SHARED_LIBS=yes \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out && \ - cmake --build cmake-out --target install && \ - ldconfig && cd /var/tmp && rm -fr build - -WORKDIR /var/tmp/build/protobuf -RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v27.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -Dprotobuf_BUILD_TESTS=OFF \ - -Dprotobuf_ABSL_PROVIDER=package \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out && \ - cmake --build cmake-out --target install && \ - ldconfig && cd /var/tmp && rm -fr build - -WORKDIR /var/tmp/build/c-ares -RUN curl -fsSL https://github.com/c-ares/c-ares/archive/cares-1_14_0.tar.gz | \ - tar -xzf - --strip-components=1 && \ - ./buildconf && ./configure && make -j "$(nproc)" && \ - make install && \ - ldconfig && cd /var/tmp && rm -fr build - -# We need to patch opentelemetry-cpp to work around a compiler bug in (at least) -# GCC 7.x. See https://github.com/open-telemetry/opentelemetry-cpp/issues/1014 -# for more details. -WORKDIR /var/tmp/build/ -RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.16.0.tar.gz | \ - tar -xzf - --strip-components=1 && \ - sed -i 's/Stack &GetStack()/Stack \&GetStack() __attribute__((noinline, noclone))/' "api/include/opentelemetry/context/runtime_context.h" && \ - cmake \ - -DCMAKE_CXX_STANDARD=14 \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ - -DBUILD_SHARED_LIBS=ON \ - -DWITH_EXAMPLES=OFF \ - -DWITH_ABSEIL=ON \ - -DBUILD_TESTING=OFF \ - -DOPENTELEMETRY_INSTALL=ON \ - -DOPENTELEMETRY_ABI_VERSION_NO=2 \ - -DWITH_DEPRECATED_SDK_FACTORY=OFF \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out --target install && \ - ldconfig && cd /var/tmp && rm -fr build - -WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.64.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DgRPC_INSTALL=ON \ - -DgRPC_BUILD_TESTS=OFF \ - -DgRPC_ABSL_PROVIDER=package \ - -DgRPC_CARES_PROVIDER=package \ - -DgRPC_PROTOBUF_PROVIDER=package \ - -DgRPC_RE2_PROVIDER=package \ - -DgRPC_SSL_PROVIDER=package \ - -DgRPC_ZLIB_PROVIDER=package \ - -DgRPC_OPENTELEMETRY_PROVIDER=package \ - -DgRPC_BUILD_GRPCPP_OTEL_PLUGIN=ON \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out && \ - cmake --build cmake-out --target install && \ - ldconfig && cd /var/tmp && rm -fr build - -WORKDIR /var/tmp/build/crc32c -RUN curl -fsSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DCRC32C_BUILD_TESTS=OFF \ - -DCRC32C_BUILD_BENCHMARKS=OFF \ - -DCRC32C_USE_GLOG=OFF \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out && \ - cmake --build cmake-out --target install && \ - ldconfig && cd /var/tmp && rm -fr build - -WORKDIR /var/tmp/build/json -RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=yes \ - -DBUILD_TESTING=OFF \ - -DJSON_BuildTests=OFF \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out --target install && \ - ldconfig && cd /var/tmp && rm -fr build - -# Install googletest, remove the downloaded files and the temporary artifacts -# after a successful build to keep the image smaller (and with fewer layers) -WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/google/googletest/archive/v1.14.0.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE="Release" \ - -DBUILD_SHARED_LIBS=yes \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out --target install && \ - ldconfig && cd /var/tmp && rm -fr build - -# Download and compile Google microbenchmark support library: -WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/google/benchmark/archive/v1.8.4.tar.gz | \ - tar -xzf - --strip-components=1 && \ - cmake \ - -DCMAKE_BUILD_TYPE="Release" \ - -DBUILD_SHARED_LIBS=yes \ - -DBENCHMARK_ENABLE_TESTING=OFF \ - -GNinja -S . -B cmake-out && \ - cmake --build cmake-out --target install && \ - ldconfig && cd /var/tmp && rm -fr build - -WORKDIR /var/tmp/sccache -RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.8.1/sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz | \ - tar -zxf - --strip-components=1 && \ - mkdir -p /usr/local/bin && \ - mv sccache /usr/local/bin/sccache && \ - chmod +x /usr/local/bin/sccache - -# Update the ld.conf cache in case any libraries were installed in /usr/local/lib* -RUN ldconfig /usr/local/lib* diff --git a/ci/cloudbuild/triggers/gcc-7-3-ci.yaml b/ci/cloudbuild/triggers/gcc-7-3-ci.yaml deleted file mode 100644 index b0b7d73a8ab08..0000000000000 --- a/ci/cloudbuild/triggers/gcc-7-3-ci.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -createTime: '2022-07-01T20:44:04.310246204Z' -filename: ci/cloudbuild/cloudbuild.yaml -github: - name: google-cloud-cpp - owner: googleapis - push: - branch: ^main$ -id: 21bec190-b6d5-4eb6-b0cc-9e28fac9ab8a -includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: gcc-7-3-ci -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/21bec190-b6d5-4eb6-b0cc-9e28fac9ab8a -substitutions: - _BUILD_NAME: gcc-7.3 - _DISTRO: centos-7 - _TRIGGER_TYPE: ci -tags: -- ci diff --git a/ci/cloudbuild/triggers/gcc-7-3-pr.yaml b/ci/cloudbuild/triggers/gcc-7-3-pr.yaml deleted file mode 100644 index 339d5a8afd413..0000000000000 --- a/ci/cloudbuild/triggers/gcc-7-3-pr.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -createTime: '2022-07-01T20:43:58.864328349Z' -filename: ci/cloudbuild/cloudbuild.yaml -github: - name: google-cloud-cpp - owner: googleapis - pullRequest: - branch: ^main$ - commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY -id: bc4951d8-7147-4a7b-87d0-f805ae630a2f -includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: gcc-7-3-pr -resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/bc4951d8-7147-4a7b-87d0-f805ae630a2f -substitutions: - _BUILD_NAME: gcc-7.3 - _DISTRO: centos-7 - _TRIGGER_TYPE: pr -tags: -- pr diff --git a/ci/cloudbuild/triggers/gcc-oldest-ci.yaml b/ci/cloudbuild/triggers/gcc-oldest-ci.yaml index 85713715de74c..4a3f90949fe28 100644 --- a/ci/cloudbuild/triggers/gcc-oldest-ci.yaml +++ b/ci/cloudbuild/triggers/gcc-oldest-ci.yaml @@ -12,14 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +createTime: '2024-07-02T17:49:31.595592561Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp owner: googleapis push: branch: ^main$ +id: 71fc938d-2480-4bdb-b274-eb0bf3a3ed1b includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: gcc-oldest-ci +resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/71fc938d-2480-4bdb-b274-eb0bf3a3ed1b substitutions: _BUILD_NAME: gcc-oldest _DISTRO: gcc-oldest diff --git a/ci/cloudbuild/triggers/gcc-oldest-pr.yaml b/ci/cloudbuild/triggers/gcc-oldest-pr.yaml index 7d9966e4af3c6..5f2ddeb348c6f 100644 --- a/ci/cloudbuild/triggers/gcc-oldest-pr.yaml +++ b/ci/cloudbuild/triggers/gcc-oldest-pr.yaml @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +createTime: '2024-07-02T17:51:28.002279385Z' filename: ci/cloudbuild/cloudbuild.yaml github: name: google-cloud-cpp @@ -19,9 +20,11 @@ github: pullRequest: branch: ^main$ commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY +id: d2015e6f-b0c4-46a4-afc6-d1ac99c4abea includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS name: gcc-oldest-pr - substitutions: +resourceName: projects/cloud-cpp-testing-resources/locations/global/triggers/d2015e6f-b0c4-46a4-afc6-d1ac99c4abea +substitutions: _BUILD_NAME: gcc-oldest _DISTRO: gcc-oldest _TRIGGER_TYPE: pr