From d462bd9949feb0eb1f1ec23e70903c51b79c22be Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Tue, 26 Sep 2023 10:12:45 -0700 Subject: [PATCH] More network flake improvements (#30) * Increase docker retries * Add debug logging for failed docker pull * Add retryable sccache warm up --- internal/docker-run/action.yml | 10 ++++++++-- sccache/action.yml | 11 +++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/internal/docker-run/action.yml b/internal/docker-run/action.yml index fe1c5df..cc0c842 100644 --- a/internal/docker-run/action.yml +++ b/internal/docker-run/action.yml @@ -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 diff --git a/sccache/action.yml b/sccache/action.yml index 4e565b4..7ee9be7 100644 --- a/sccache/action.yml +++ b/sccache/action.yml @@ -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 @@ -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: |