Skip to content

Commit

Permalink
More network flake improvements (#30)
Browse files Browse the repository at this point in the history
* Increase docker retries

* Add debug logging for failed docker pull

* Add retryable sccache warm up
  • Loading branch information
mkruskal-google authored Sep 26, 2023
1 parent 14f2b47 commit d462bd9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/docker-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,20 @@ runs:

- name: Pull fresh docker image
if: ${{ !inputs.docker-cache }}
id: docker-pull
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3
with:
timeout_minutes: 5
retry_wait_seconds: 30
max_attempts: 3
retry_wait_seconds: 60
max_attempts: 5
shell: bash
command: time docker pull -q ${{ inputs.image }}

- name: Report docker pull failures
if: ${{ steps.docker-pull.outputs.exit_code }}
shell: bash
run: echo ${{ steps.docker-pull.exit_error }}

- name: Forward sccache arguments
shell: bash
id: sccache
Expand Down
11 changes: 11 additions & 0 deletions sccache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ runs:
echo "SCCACHE_GCS_KEY_PATH=${{ steps.auth.outputs.credentials-file }}" >> $GITHUB_ENV
echo "SCCACHE_GCS_BUCKET=protobuf-sccache" >> $GITHUB_ENV
echo "SCCACHE_GCS_KEY_PREFIX=${{ inputs.cache-prefix }}" >> $GITHUB_ENV
echo "SCCACHE_IDLE_TIMEOUT=0" >> $GITHUB_ENV
# Only trusted runs should have write access to our caches.
- name: Enable sccache cache writing
Expand All @@ -72,6 +73,16 @@ runs:
with:
version: ${{ inputs.version }}

- name: Warm-up sccache server (non-docker)
if: ${{ runner.os != 'Linux' }}
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3
with:
timeout_minutes: 5
retry_wait_seconds: 60
max_attempts: 5
shell: bash
command: sccache --start-server

- name: Configure sccache cmake arguments
shell: bash
run: |
Expand Down

0 comments on commit d462bd9

Please sign in to comment.