Skip to content

Commit

Permalink
Network flake improvements (#29)
Browse files Browse the repository at this point in the history
* Retry failed docker pulls up to 3 times

* Add a shared checkout action
  • Loading branch information
mkruskal-google authored Sep 25, 2023
1 parent bd23c7e commit 14f2b47
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
42 changes: 42 additions & 0 deletions checkout/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Github Checkout'
description: 'Check out a Github repository'
inputs:
ref:
required: true
description: "The branch, tag or SHA to checkout"
submodules:
required: false
description: "Whether or not to checkout submodules"

runs:
using: 'composite'
steps:
- name: Checkout pending changes
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ inputs.ref }}

- name: Checkout submodules
if: ${{ inputs.submodules }}
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3
with:
timeout_seconds: 30
retry_wait_seconds: 30
max_attempts: 5
shell: bash
command: |
git submodule update --init ${{ inputs.submodules == 'recursive' && '--recursive' || '' }}
9 changes: 7 additions & 2 deletions internal/docker-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,14 @@ runs:
run: time docker image load --input ./ci/docker/${{ inputs.image }}.tar

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

- name: Forward sccache arguments
shell: bash
Expand Down

0 comments on commit 14f2b47

Please sign in to comment.