From 665d467ce64cfd710bb60ef6614a054b277da906 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Fri, 20 Dec 2024 11:05:06 +0000 Subject: [PATCH] fixup! fixup! fixup! fixup! Ensure that jobs run with the controller service account if no service account is specified. --- docker-image-worker/cleanup.py | 2 ++ docker-image-worker/export.py | 2 ++ docker-image-worker/requirements.txt | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docker-image-worker/cleanup.py b/docker-image-worker/cleanup.py index d35be32..5d08026 100755 --- a/docker-image-worker/cleanup.py +++ b/docker-image-worker/cleanup.py @@ -3,11 +3,13 @@ import os import sys import argparse from botocore.exceptions import ClientError +from tenacity import retry, stop_after_attempt, wait_fixed sys.path.append(os.path.dirname(os.path.abspath(__file__))) from s3_utils import get_s3_client, parse_s3_path, add_common_arguments, validate_args +@retry(stop=stop_after_attempt(5), wait=wait_fixed(5)) def remove_directory(destination, use_role=False, role_name=None, aws_access_key_id=None, aws_secret_access_key=None, endpoint_url=None, region=None): """ Remove a directory recursively, either local or in an S3 bucket diff --git a/docker-image-worker/export.py b/docker-image-worker/export.py index 18d61c0..a7dd63b 100755 --- a/docker-image-worker/export.py +++ b/docker-image-worker/export.py @@ -3,10 +3,12 @@ import os import sys import argparse from botocore.exceptions import ClientError +from tenacity import retry, stop_after_attempt, wait_fixed sys.path.append(os.path.dirname(os.path.abspath(__file__))) from s3_utils import get_s3_client, parse_s3_path, add_common_arguments, validate_args +@retry(stop=stop_after_attempt(5), wait=wait_fixed(5)) def transfer_file(source, destination, use_role=False, role_name=None, aws_access_key_id=None, aws_secret_access_key=None, endpoint_url=None, region=None): """ Transfer a file from a local source to either a local destination or an S3 bucket diff --git a/docker-image-worker/requirements.txt b/docker-image-worker/requirements.txt index dd20b13..709f80d 100644 --- a/docker-image-worker/requirements.txt +++ b/docker-image-worker/requirements.txt @@ -1,3 +1,4 @@ boto3 botocore -jmespath \ No newline at end of file +jmespath +tenacity \ No newline at end of file