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

Add retries on multi-platform image builds #71

Merged
merged 1 commit into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions buildrunner/docker/multiplatform_image_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import python_on_whales
from python_on_whales import docker
from retry import retry

from buildrunner.docker import get_dockerfile

Expand Down Expand Up @@ -212,6 +213,7 @@ def _stop_local_registry(self):
LOGGER.warning("Local registry is not running when attempting to stop it")

# pylint: disable=too-many-arguments
@retry(python_on_whales.exceptions.DockerException, tries=5, delay=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

seems a bit high to me, but it'll work for now

def _build_single_image(self,
name: str,
platform: str,
Expand Down
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ timeout-decorator>=0.5.0
python-on-whales>=0.61.0
# python-on-whales requires pydantic 1.10.11 08/2023
pydantic>=1.10.11
retry2>=0.9.5
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ decorator==5.1.1
# via
# -r requirements.in
# fabric
# retry2
docker==6.1.3
# via -r requirements.in
docutils==0.20.1
Expand Down Expand Up @@ -97,6 +98,8 @@ requests==2.31.0
# twine
requests-toolbelt==1.0.0
# via twine
retry2==0.9.5
# via -r requirements.in
rfc3986==2.0.0
# via twine
rich==13.4.1
Expand Down
Loading