Skip to content

Commit

Permalink
Merge pull request #128 from basepair/feature/added-retry-option-to-s…
Browse files Browse the repository at this point in the history
…3-ec2-iam

Feature/added retry option to s3 ec2 iam
  • Loading branch information
SamkeetJain authored Sep 3, 2024
2 parents c6e78e9 + 05ab1b5 commit 18f0157
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion basepair/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Exposing the storage wrapper

__title__ = 'basepair'
__version__ = '2.1.9'
__version__ = '2.1.10'
__copyright__ = 'Copyright [2017] - [2024] Basepair INC'


Expand Down
2 changes: 1 addition & 1 deletion basepair/modules/aws/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class EC2(Service):
def __init__(self, cfg):
super().__init__(cfg, 'EC2')
self.client = self.session.client(**{
'config': Config(retries={'max_attempts': 0, 'mode': 'standard'}),
'config': Config(retries={'max_attempts': 10, 'mode': 'standard'}),
'service_name': 'ec2',
})
self.default = {
Expand Down
2 changes: 1 addition & 1 deletion basepair/modules/aws/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class IAM(Service):
def __init__(self, cfg):
super().__init__(cfg, 'IAM')
self.client = self.session.client(**{
'config': Config(retries={'max_attempts': 0, 'mode': 'standard'}),
'config': Config(retries={'max_attempts': 10, 'mode': 'standard'}),
'service_name': 'iam',
})
# Reminder: Update __bp_tmp_user__ will require to update boundary policy for the role
Expand Down
18 changes: 18 additions & 0 deletions basepair/modules/aws/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@ def ecr_bio_modules(repository_settings):
'aws:ResourceTag/Type': 'Bio'
}
}
}, {
'Effect': 'Allow',
'Action': [
'ecr:BatchCheckLayerAvailability',
'ecr:GetDownloadUrlForLayer',
'ecr:GetRepositoryPolicy',
'ecr:DescribeRepositories',
'ecr:ListImages',
'ecr:DescribeImages',
'ecr:BatchGetImage',
'ecr:GetLifecyclePolicy',
'ecr:GetLifecyclePolicyPreview',
'ecr:ListTagsForResource',
'ecr:DescribeImageScanFindings'
],
'Resource': [
f"arn:aws:ecr:*:{repository_settings.get('account')}:repository/worker*",
]
}, {
'Effect': 'Allow',
'Action': 'ecr:GetAuthorizationToken',
Expand Down
2 changes: 1 addition & 1 deletion basepair/modules/aws/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, cfg):
self.bucket = cfg.get('bucket')
client_vars = {
'config': Config(
retries={'max_attempts': 0, 'mode': 'standard'},
retries={'max_attempts': 10, 'mode': 'standard'},
signature_version='s3v4',
),
'service_name': 's3',
Expand Down

0 comments on commit 18f0157

Please sign in to comment.