Skip to content

Add a retry decorator to the GitHub log downloader. #1387

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

Merged
merged 3 commits into from
Jul 14, 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
1 change: 1 addition & 0 deletions external/pip_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
absl-py
protobuf
retry
4 changes: 3 additions & 1 deletion scripts/gha/integration_testing/ftl_gha_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import subprocess
import shutil
import re
from retry import retry

GSUTIL = shutil.which("gsutil")

Expand Down Expand Up @@ -73,7 +74,7 @@ def _get_testapp_log_text_from_gcs(gcs_path):
logging.error("Unexpected error reading GCS log:\n%s", e)
return None


@retry(subprocess.CalledProcessError, tries=3, delay=10)
def _gcs_list_dir(gcs_path):
"""Recursively returns a list of contents for a directory on GCS."""
args = [GSUTIL, "ls", "-r", gcs_path]
Expand All @@ -82,6 +83,7 @@ def _gcs_list_dir(gcs_path):
return result.stdout.splitlines()


@retry(subprocess.CalledProcessError, tries=3, delay=10)
def _gcs_read_file(gcs_path):
"""Extracts the contents of a file on GCS."""
args = [GSUTIL, "cat", gcs_path]
Expand Down
1 change: 1 addition & 0 deletions scripts/gha/python_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ attrs
absl-py
pytz
requests
retry