Skip to content

Commit 2b28e0d

Browse files
authored
ci: use older version of gRPC for quickstart-production (#16155)
1 parent e908d88 commit 2b28e0d

3 files changed

Lines changed: 238 additions & 2 deletions

File tree

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM fedora:40
16+
ARG NCPU=4
17+
ARG ARCH=amd64
18+
19+
# Fedora includes packages for libcurl and OpenSSL that are recent enough
20+
# for `google-cloud-cpp`. Install these packages and additional development
21+
# tools to compile the dependencies:
22+
RUN dnf makecache && \
23+
dnf install -y abi-compliance-checker autoconf automake \
24+
clang clang-analyzer clang-tools-extra \
25+
cmake diffutils findutils gcc-c++ git \
26+
libcurl-devel llvm make ninja-build \
27+
openssl-devel patch python python3 \
28+
python-pip tar unzip w3m wget which zip zlib-devel
29+
30+
# Install the Python modules needed to run the storage emulator
31+
RUN dnf makecache && dnf install -y python3-devel
32+
RUN pip3 install --upgrade pip
33+
RUN pip3 install setuptools wheel
34+
35+
# The Cloud Pub/Sub emulator needs Java :shrug:
36+
RUN dnf makecache && dnf install -y java-latest-openjdk
37+
38+
# This is used to improve the output in check-api builds
39+
RUN dnf makecache && dnf install -y "dnf-command(debuginfo-install)"
40+
RUN dnf makecache && dnf debuginfo-install -y libstdc++
41+
42+
# These are used by the docfx tool.
43+
RUN dnf makecache && dnf install -y pugixml-devel
44+
45+
RUN dnf install -y valgrind
46+
47+
# Sets root's password to the empty string to enable users to get a root shell
48+
# inside the container with `su -` and no password. Sudo would not work because
49+
# we run these containers as the invoking user's uid, which does not exist in
50+
# the container's /etc/passwd file.
51+
RUN echo "root:cloudcxx" | chpasswd
52+
53+
WORKDIR /var/tmp/build/
54+
RUN curl -fsSL https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.9.0.tar.gz | \
55+
tar -xzf - --strip-components=1 && \
56+
cmake \
57+
-DCMAKE_BUILD_TYPE=Release \
58+
-DCMAKE_CXX_STANDARD=17 \
59+
-DBUILD_SHARED_LIBS=ON \
60+
-DBUILD_TESTING=OFF \
61+
-S . -B cmake-out -GNinja && \
62+
cmake --build cmake-out --target install && \
63+
ldconfig && cd /var/tmp && rm -fr build
64+
65+
# Fedora's version of `pkg-config` (https://github.com/pkgconf/pkgconf) is slow
66+
# when handling `.pc` files with lots of `Requires:` deps. This problem is
67+
# triggered by the Abseil `.pc` files, which we use (indirectly) when testing
68+
# our own `.pc` files. We install the more traditional `pkg-config` binary.
69+
# For more details see
70+
# https://github.com/googleapis/google-cloud-cpp/issues/7052
71+
WORKDIR /var/tmp/build/pkgconf
72+
RUN curl -fsSL https://distfiles.ariadne.space/pkgconf/pkgconf-2.2.0.tar.gz | \
73+
tar -xzf - --strip-components=1 && \
74+
./configure --prefix=/usr --with-system-libdir=/lib64:/usr/lib64 --with-system-includedir=/usr/include && \
75+
make -j ${NCPU:-4} && \
76+
make install && \
77+
ldconfig && cd /var/tmp && rm -fr build
78+
79+
# The following steps will install libraries and tools in `/usr/local`. By
80+
# default, pkgconf does not search in these directories. We need to explicitly
81+
# set the search path.
82+
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig
83+
84+
# We disable the inline namespace because otherwise Abseil LTS updates break our
85+
# `check-api` build.
86+
WORKDIR /var/tmp/build
87+
RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \
88+
tar -xzf - --strip-components=1 && \
89+
cmake \
90+
-DCMAKE_BUILD_TYPE="Release" \
91+
-DCMAKE_CXX_STANDARD=17 \
92+
-DABSL_BUILD_TESTING=OFF \
93+
-DBUILD_SHARED_LIBS=yes \
94+
-GNinja -S . -B cmake-out && \
95+
cmake --build cmake-out --target install && \
96+
ldconfig && cd /var/tmp && rm -fr build
97+
98+
WORKDIR /var/tmp/build
99+
RUN curl -fsSL https://github.com/google/googletest/archive/v1.16.0.tar.gz | \
100+
tar -xzf - --strip-components=1 && \
101+
cmake \
102+
-DCMAKE_BUILD_TYPE="Release" \
103+
-DBUILD_SHARED_LIBS=yes \
104+
-GNinja -S . -B cmake-out && \
105+
cmake --build cmake-out --target install && \
106+
ldconfig && cd /var/tmp && rm -fr build
107+
108+
WORKDIR /var/tmp/build
109+
RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.5.tar.gz | \
110+
tar -xzf - --strip-components=1 && \
111+
cmake \
112+
-DCMAKE_BUILD_TYPE="Release" \
113+
-DBUILD_SHARED_LIBS=yes \
114+
-DBENCHMARK_ENABLE_TESTING=OFF \
115+
-GNinja -S . -B cmake-out && \
116+
cmake --build cmake-out --target install && \
117+
ldconfig && cd /var/tmp && rm -fr build
118+
119+
WORKDIR /var/tmp/build
120+
RUN curl -fsSL https://github.com/nlohmann/json/archive/v3.11.3.tar.gz | \
121+
tar -xzf - --strip-components=1 && \
122+
cmake \
123+
-DCMAKE_BUILD_TYPE=Release \
124+
-DBUILD_SHARED_LIBS=yes \
125+
-DBUILD_TESTING=OFF \
126+
-DJSON_BuildTests=OFF \
127+
-GNinja -S . -B cmake-out && \
128+
cmake --build cmake-out --target install && \
129+
ldconfig && cd /var/tmp && rm -fr build
130+
131+
WORKDIR /var/tmp/build/protobuf
132+
RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \
133+
tar -xzf - --strip-components=1 && \
134+
cmake \
135+
-DCMAKE_BUILD_TYPE=Release \
136+
-DCMAKE_CXX_STANDARD=17 \
137+
-DBUILD_SHARED_LIBS=yes \
138+
-Dprotobuf_BUILD_TESTS=OFF \
139+
-Dprotobuf_ABSL_PROVIDER=package \
140+
-GNinja -S . -B cmake-out && \
141+
cmake --build cmake-out --target install && \
142+
ldconfig && cd /var/tmp && rm -fr build
143+
144+
WORKDIR /var/tmp/build/
145+
RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24.0.tar.gz | \
146+
tar -xzf - --strip-components=1 && \
147+
cmake \
148+
-DCMAKE_CXX_STANDARD=17 \
149+
-DCMAKE_BUILD_TYPE=Release \
150+
-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
151+
-DBUILD_SHARED_LIBS=ON \
152+
-DWITH_EXAMPLES=OFF \
153+
-DWITH_STL=CXX17 \
154+
-DBUILD_TESTING=OFF \
155+
-DOPENTELEMETRY_INSTALL=ON \
156+
-DOPENTELEMETRY_ABI_VERSION_NO=2 \
157+
-S . -B cmake-out -GNinja && \
158+
cmake --build cmake-out --target install && \
159+
ldconfig && cd /var/tmp && rm -fr build
160+
161+
# Use older version of gRPC that has demonstrated to encounter the gRPC+OpenSSL
162+
# double free issue in order to reduce flakes.
163+
WORKDIR /var/tmp/build/grpc
164+
RUN dnf makecache && dnf install -y c-ares-devel re2-devel
165+
RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \
166+
tar -xzf - --strip-components=1 && \
167+
cmake \
168+
-DCMAKE_BUILD_TYPE=Release \
169+
-DCMAKE_CXX_STANDARD=17 \
170+
-DBUILD_SHARED_LIBS=ON \
171+
-DgRPC_INSTALL=ON \
172+
-DgRPC_BUILD_TESTS=OFF \
173+
-DgRPC_ABSL_PROVIDER=package \
174+
-DgRPC_CARES_PROVIDER=package \
175+
-DgRPC_PROTOBUF_PROVIDER=package \
176+
-DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG \
177+
-DgRPC_RE2_PROVIDER=package \
178+
-DgRPC_SSL_PROVIDER=package \
179+
-DgRPC_ZLIB_PROVIDER=package \
180+
-DgRPC_OPENTELEMETRY_PROVIDER=package \
181+
-DgRPC_BUILD_GRPCPP_OTEL_PLUGIN=ON \
182+
-GNinja -S . -B cmake-out && \
183+
cmake --build cmake-out --target install && \
184+
ldconfig && cd /var/tmp && rm -fr build
185+
186+
# Installs Universal Ctags (which is different than the default "Exuberant
187+
# Ctags"), which is needed by the ABI checker. See https://ctags.io/
188+
WORKDIR /var/tmp/build
189+
RUN curl -fsSL https://github.com/universal-ctags/ctags/archive/refs/tags/p5.9.20210418.0.tar.gz | \
190+
tar -xzf - --strip-components=1 && \
191+
./autogen.sh && \
192+
./configure --prefix=/usr/local && \
193+
make && \
194+
make install && \
195+
cd /var/tmp && rm -fr build
196+
197+
# Installs the abi-dumper with the integer overflow fix from
198+
# https://github.com/lvc/abi-dumper/pull/29. We can switch back to `dnf install
199+
# abi-dumper` once it has the fix.
200+
WORKDIR /var/tmp/build
201+
RUN curl -fsSL https://github.com/lvc/abi-dumper/archive/16bb467cd7d343dd3a16782b151b56cf15509594.tar.gz | \
202+
tar -xzf - --strip-components=1 && \
203+
mv abi-dumper.pl /usr/local/bin/abi-dumper && \
204+
chmod +x /usr/local/bin/abi-dumper
205+
206+
# Install ctcache (with global caching support) to speed up our clang-tidy build
207+
WORKDIR /var/tmp/build
208+
RUN curl -fsSL https://github.com/matus-chochlik/ctcache/archive/62631eb1c05688f79f8cd652fe4d726f09bb1eb3.tar.gz | \
209+
tar -xzf - --strip-components=1 && \
210+
pip3 install --quiet --disable-pip-version-check google-cloud-storage && \
211+
pip3 install --quiet --disable-pip-version-check -r requirements.txt && \
212+
cp clang-tidy /usr/local/bin/clang-tidy-wrapper && \
213+
cp clang-tidy-cache /usr/local/bin/clang-tidy-cache && \
214+
cd /var/tmp && rm -fr build
215+
216+
WORKDIR /var/tmp/sccache
217+
RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.15.0/sccache-v0.15.0-x86_64-unknown-linux-musl.tar.gz | \
218+
tar -zxf - --strip-components=1 && \
219+
mkdir -p /usr/local/bin && \
220+
mv sccache /usr/local/bin/sccache && \
221+
chmod +x /usr/local/bin/sccache
222+
223+
# Update the ld.conf cache in case any libraries were installed in /usr/local/lib*
224+
RUN (echo /usr/local/lib; echo /usr/local/lib64) | tee /etc/ld.so.conf.d/local.conf
225+
RUN ldconfig /usr/local/lib*
226+
227+
# Install the Cloud SDK and some of the emulators. We use the emulators to run
228+
# integration tests for the client libraries.
229+
COPY . /var/tmp/ci
230+
WORKDIR /var/tmp/downloads
231+
# The Google Cloud CLI requires Python <= 3.10, Fedora defaults to 3.12.
232+
RUN dnf makecache && dnf install -y python3.10
233+
ENV CLOUDSDK_PYTHON=python3.10
234+
RUN /var/tmp/ci/install-cloud-sdk.sh
235+
ENV CLOUD_SDK_LOCATION=/usr/local/google-cloud-sdk
236+
ENV PATH=${CLOUD_SDK_LOCATION}/bin:${PATH}

ci/cloudbuild/triggers/quickstart-production-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS
2222
name: quickstart-production-ci
2323
substitutions:
2424
_BUILD_NAME: quickstart-production
25-
_DISTRO: fedora-latest-cmake
25+
_DISTRO: fedora-cmake-quickstart
2626
_TRIGGER_TYPE: ci
2727
tags:
2828
- ci

ci/cloudbuild/triggers/quickstart-production-pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS
2323
name: quickstart-production-pr
2424
substitutions:
2525
_BUILD_NAME: quickstart-production
26-
_DISTRO: fedora-latest-cmake
26+
_DISTRO: fedora-cmake-quickstart
2727
_TRIGGER_TYPE: pr
2828
tags:
2929
- pr

0 commit comments

Comments
 (0)