Skip to content

[CI] Fix flaky prod:grpc/core/master/linux/grpc_docker_build - Add retry to ccache download#42180

Closed
asheshvidyut wants to merge 4 commits into
grpc:masterfrom
asheshvidyut:fixit/fix-flake
Closed

[CI] Fix flaky prod:grpc/core/master/linux/grpc_docker_build - Add retry to ccache download#42180
asheshvidyut wants to merge 4 commits into
grpc:masterfrom
asheshvidyut:fixit/fix-flake

Conversation

@asheshvidyut

Copy link
Copy Markdown
Member

Description

Fix flaky tests for the log, looks like a network issue.

#18 [15/18] RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz     && tar -zxf ccache.tar.gz     && cd ccache-4.11.3     && mkdir build && cd build     && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON ..     && make -j4 && make install     && cd ../..     && rm -rf ccache-4.11.3 ccache.tar.gz
#18 11.37 
#18 11.37 gzip: stdin: not in gzip format
#18 11.37 tar: Child returned status 1
#18 11.37 tar: Error is not recoverable: exiting now
#18 ERROR: process "/bin/sh -c curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz     && tar -zxf ccache.tar.gz     && cd ccache-4.11.3     && mkdir build && cd build     && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON ..     && make -j4 && make install     && cd ../..     && rm -rf ccache-4.11.3 ccache.tar.gz" did not complete successfully: exit code: 2
------

Added retry to ccache install.

@asheshvidyut asheshvidyut marked this pull request as ready for review April 20, 2026 06:30
@asheshvidyut asheshvidyut requested a review from sergiitk as a code owner April 20, 2026 06:30
@asheshvidyut asheshvidyut added the release notes: no Indicates if PR should not be in release notes label Apr 20, 2026
@asheshvidyut asheshvidyut changed the title Add retry to ccache download [CI] Add retry to ccache download - Part 1 - Fix flaky prod:grpc/core/master/linux/grpc_docker_build Apr 20, 2026
@asheshvidyut asheshvidyut changed the title [CI] Add retry to ccache download - Part 1 - Fix flaky prod:grpc/core/master/linux/grpc_docker_build [CI] Part 1 - Fix flaky prod:grpc/core/master/linux/grpc_docker_build. Add retry to ccache download Apr 20, 2026
@asheshvidyut asheshvidyut changed the title [CI] Part 1 - Fix flaky prod:grpc/core/master/linux/grpc_docker_build. Add retry to ccache download [CI] Part 1 - Fix flaky prod:grpc/core/master/linux/grpc_docker_build - Add retry to ccache download Apr 20, 2026
@asheshvidyut asheshvidyut marked this pull request as draft April 20, 2026 06:47
@asheshvidyut asheshvidyut changed the title [CI] Part 1 - Fix flaky prod:grpc/core/master/linux/grpc_docker_build - Add retry to ccache download [CI] Fix flaky prod:grpc/core/master/linux/grpc_docker_build - Add retry to ccache download Apr 20, 2026
@asheshvidyut asheshvidyut marked this pull request as ready for review April 20, 2026 12:26
@asheshvidyut asheshvidyut requested review from rishesh007 and removed request for sergiitk and tanvi-jagtap April 20, 2026 12:27
@pawbhard

Copy link
Copy Markdown
Contributor

/gemini review

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

Copy link
Copy Markdown
Contributor

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 improves the reliability of Docker image builds by incorporating --fail and --retry flags into curl commands for ccache downloads and updates numerous Docker image versions and hashes. The review feedback recommends adding the --retry-connrefused flag to these curl commands to further mitigate transient network failures during the build process.

# Install ccache from source since ccache 3.x packaged with most linux distributions
# does not support Redis backend for caching.
RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz \
RUN curl -sSL --fail --retry 5 -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To further improve the robustness of the download against transient network issues, consider adding the --retry-connrefused flag. This ensures that curl also retries when the connection is refused, which is a common occurrence during temporary server outages or network glitches in CI environments.

RUN curl -sSL --fail --retry 5 --retry-connrefused -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz \

# does not support Redis backend for caching.
RUN unset CMAKE_TOOLCHAIN_FILE && unset AS AR CC CPP CXX LD STRIP OBJCOPY \
&& curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz \
&& curl -sSL --fail --retry 5 -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Similar to other templates, adding --retry-connrefused here would make the download more resilient to transient connection failures.

    && curl -sSL --fail --retry 5 --retry-connrefused -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz \

# Install ccache from source since ccache 3.x packaged with most linux distributions
# does not support Redis backend for caching.
RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
RUN curl -sSL --fail --retry 5 -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Consider adding --retry-connrefused to this template as well for consistent robustness across all ccache versions.

RUN curl -sSL --fail --retry 5 --retry-connrefused -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \

asheshvidyut added a commit to asheshvidyut/grpc that referenced this pull request Apr 23, 2026
…try to ccache download (grpc#42180)

### Description

Fix flaky tests for the log, looks like a network issue.

```
#18 [15/18] RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz     && tar -zxf ccache.tar.gz     && cd ccache-4.11.3     && mkdir build && cd build     && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON ..     && make -j4 && make install     && cd ../..     && rm -rf ccache-4.11.3 ccache.tar.gz
#18 11.37
#18 11.37 gzip: stdin: not in gzip format
#18 11.37 tar: Child returned status 1
#18 11.37 tar: Error is not recoverable: exiting now
#18 ERROR: process "/bin/sh -c curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz     && tar -zxf ccache.tar.gz     && cd ccache-4.11.3     && mkdir build && cd build     && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON ..     && make -j4 && make install     && cd ../..     && rm -rf ccache-4.11.3 ccache.tar.gz" did not complete successfully: exit code: 2
------
```

Added retry to ccache install.

Closes grpc#42180

COPYBARA_INTEGRATE_REVIEW=grpc#42180 from asheshvidyut:fixit/fix-flake 33a66ed
PiperOrigin-RevId: 902683742
asheshvidyut added a commit to a-detiste/grpc that referenced this pull request Jun 10, 2026
…try to ccache download (grpc#42180)

### Description

Fix flaky tests for the log, looks like a network issue.

```
grpc#18 [15/18] RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz     && tar -zxf ccache.tar.gz     && cd ccache-4.11.3     && mkdir build && cd build     && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON ..     && make -j4 && make install     && cd ../..     && rm -rf ccache-4.11.3 ccache.tar.gz
grpc#18 11.37
grpc#18 11.37 gzip: stdin: not in gzip format
grpc#18 11.37 tar: Child returned status 1
grpc#18 11.37 tar: Error is not recoverable: exiting now
grpc#18 ERROR: process "/bin/sh -c curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz     && tar -zxf ccache.tar.gz     && cd ccache-4.11.3     && mkdir build && cd build     && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON ..     && make -j4 && make install     && cd ../..     && rm -rf ccache-4.11.3 ccache.tar.gz" did not complete successfully: exit code: 2
------
```

Added retry to ccache install.

Closes grpc#42180

COPYBARA_INTEGRATE_REVIEW=grpc#42180 from asheshvidyut:fixit/fix-flake 33a66ed
PiperOrigin-RevId: 902683742
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants