Skip to content

ci: use older version of gRPC for quickstart-production#16155

Merged
scotthart merged 1 commit into
googleapis:mainfrom
scotthart:ci_quickstart_production_grpc
Jun 12, 2026
Merged

ci: use older version of gRPC for quickstart-production#16155
scotthart merged 1 commit into
googleapis:mainfrom
scotthart:ci_quickstart_production_grpc

Conversation

@scotthart

Copy link
Copy Markdown
Member

There's an outstanding issue on program exit with certain versions of gRPC + OpenSSL that results in a double free or other alloc error. Until there is a fix, use an older version of gRPC where the issue appears less often.

@scotthart scotthart requested a review from a team as a code owner June 12, 2026 15:11

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Dockerfile fedora-cmake-quickstart.Dockerfile to set up a Fedora 40-based build environment with various dependencies, and updates the Cloud Build triggers to use this new image. The review feedback focuses on optimizing the Dockerfile to reduce image size and build times. Key recommendations include consolidating dnf package installations, configuring ldconfig earlier in the build process so dependencies can locate libraries, enabling parallel compilation for Universal Ctags, cleaning up temporary build directories, and removing redundant commands.

Comment on lines +51 to +52
RUN echo "root:cloudcxx" | chpasswd

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Configure /etc/ld.so.conf.d/local.conf and run ldconfig before building any dependencies. Since intermediate build steps (like gRPC) run ldconfig and rely on previously installed libraries in /usr/local/lib or /usr/local/lib64 (such as protobuf or abseil), having this configuration set up early ensures that those libraries are correctly cached and discoverable during the build process.

RUN echo "root:cloudcxx" | chpasswd

# Configure ldconfig to search /usr/local/lib and /usr/local/lib64 before building dependencies
RUN (echo /usr/local/lib; echo /usr/local/lib64) | tee /etc/ld.so.conf.d/local.conf && ldconfig

Comment on lines +22 to +45
RUN dnf makecache && \
dnf install -y abi-compliance-checker autoconf automake \
clang clang-analyzer clang-tools-extra \
cmake diffutils findutils gcc-c++ git \
libcurl-devel llvm make ninja-build \
openssl-devel patch python python3 \
python-pip tar unzip w3m wget which zip zlib-devel

# Install the Python modules needed to run the storage emulator
RUN dnf makecache && dnf install -y python3-devel
RUN pip3 install --upgrade pip
RUN pip3 install setuptools wheel

# The Cloud Pub/Sub emulator needs Java :shrug:
RUN dnf makecache && dnf install -y java-latest-openjdk

# This is used to improve the output in check-api builds
RUN dnf makecache && dnf install -y "dnf-command(debuginfo-install)"
RUN dnf makecache && dnf debuginfo-install -y libstdc++

# These are used by the docfx tool.
RUN dnf makecache && dnf install -y pugixml-devel

RUN dnf install -y valgrind

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consolidate the multiple dnf install and dnf makecache runs into a single RUN instruction. This reduces the number of intermediate layers, avoids redundant metadata downloads, and significantly decreases the final image size. We can also append dnf clean all at the end to clean up the package manager cache. Additionally, we can include c-ares-devel and re2-devel here to avoid installing them later.

RUN dnf makecache && \
    dnf install -y abi-compliance-checker autoconf automake \
        clang clang-analyzer clang-tools-extra \
        cmake diffutils findutils gcc-c++ git \
        libcurl-devel llvm make ninja-build \
        openssl-devel patch python python3 \
        python-pip tar unzip w3m wget which zip zlib-devel \
        python3-devel java-latest-openjdk "dnf-command(debuginfo-install)" \
        pugixml-devel valgrind c-ares-devel re2-devel && \
    dnf debuginfo-install -y libstdc++ && \
    dnf clean all

# Use older version of gRPC that has demonstrated to encounter the gRPC+OpenSSL
# double free issue in order to reduce flakes.
WORKDIR /var/tmp/build/grpc
RUN dnf makecache && dnf install -y c-ares-devel re2-devel

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since c-ares-devel and re2-devel are now installed in the consolidated package installation block at the top of the Dockerfile, this redundant step can be removed.

Comment on lines +191 to +195
./autogen.sh && \
./configure --prefix=/usr/local && \
make && \
make install && \
cd /var/tmp && rm -fr build

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Use parallel compilation with make -j ${NCPU:-4} to speed up the build of Universal Ctags.

    ./autogen.sh && \
    ./configure --prefix=/usr/local && \
    make -j ${NCPU:-4} && \
    make install && \
    cd /var/tmp && rm -fr build

Comment on lines +201 to +204
RUN curl -fsSL https://github.com/lvc/abi-dumper/archive/16bb467cd7d343dd3a16782b151b56cf15509594.tar.gz | \
tar -xzf - --strip-components=1 && \
mv abi-dumper.pl /usr/local/bin/abi-dumper && \
chmod +x /usr/local/bin/abi-dumper

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Clean up the /var/tmp/build directory after installing abi-dumper to avoid leaving leftover files that can pollute subsequent builds in the same directory and bloat the image size.

RUN curl -fsSL https://github.com/lvc/abi-dumper/archive/16bb467cd7d343dd3a16782b151b56cf15509594.tar.gz | \
    tar -xzf - --strip-components=1 && \
    mv abi-dumper.pl /usr/local/bin/abi-dumper && \
    chmod +x /usr/local/bin/abi-dumper && \
    cd /var/tmp && rm -fr build

Comment on lines +217 to +221
RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.15.0/sccache-v0.15.0-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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Clean up the /var/tmp/sccache directory after installing sccache to reduce the final Docker image size.

RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.15.0/sccache-v0.15.0-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 && \
    cd /var/tmp && rm -fr sccache

Comment on lines +224 to +225
RUN (echo /usr/local/lib; echo /usr/local/lib64) | tee /etc/ld.so.conf.d/local.conf
RUN ldconfig /usr/local/lib*

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the ld.so.conf.d configuration is now set up early in the Dockerfile, we only need to run a final ldconfig here to ensure the cache is fully updated.

RUN ldconfig

COPY . /var/tmp/ci
WORKDIR /var/tmp/downloads
# The Google Cloud CLI requires Python <= 3.10, Fedora defaults to 3.12.
RUN dnf makecache && dnf install -y python3.10

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Remove the redundant dnf makecache call to speed up the build.

RUN dnf install -y python3.10

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.20%. Comparing base (e908d88) to head (4ae9c12).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16155      +/-   ##
==========================================
- Coverage   92.20%   92.20%   -0.01%     
==========================================
  Files        2264     2264              
  Lines      209084   209084              
==========================================
- Hits       192791   192786       -5     
- Misses      16293    16298       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scotthart scotthart merged commit 2b28e0d into googleapis:main Jun 12, 2026
65 of 71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants