Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement retry logic in Docker workflow to handle network failures #374

Open
ThomasSanson opened this issue Jun 9, 2023 · 0 comments
Open

Comments

@ThomasSanson
Copy link
Sponsor Contributor

Hello,

We have been experiencing occasional failures in our Docker GitHub Actions workflow due to network issues. These failures usually occur in the "Run Docker tests" steps of the workflow.

To mitigate this, I would like to implement a retry mechanism in our workflow. The idea is to retry these steps a few times (let's say 3 times) before marking the workflow as failed. This should help us handle transient network issues.

Considering using the nick-invision/retry@v2 action for this, which would modify our workflow file to look like this:

name: "Docker"

on:  
  push:  
    branches:  
    - master  
  pull_request:  
    branches:  
    - master  

jobs:  
  build:  
    runs-on: ubuntu-latest  
    steps:  
    - name: Set TERM environment variable  
      run: echo "TERM=xterm" >> $GITHUB_ENV  

    - name: Checkout  
      uses: actions/checkout@v3  

    - name: Set up Python 3.10  
      uses: actions/setup-python@v4  
      with:  
        python-version: "3.10"  

    - name: Install dependencies  
       run: make bootstrap-dev  

    - name: Run Docker tests  
      uses: nick-invision/retry@v2
      with:
        max_attempts: 3
        timeout_minutes: 10
        command: make docker-tests

https://github.com/vitabaks/postgresql_cluster/actions/runs/5224946567/jobs/9433782895?pr=373#step:6:999

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

No branches or pull requests

1 participant