Skip to content

Commit 95da0df

Browse files
committed
tests: Authenticate to AWS Elastic Container Registry for docker pull
This should increase the rate limit from 1/s to 10/s. AWS credentials are obtained from environment variables in Azure pipelines, or the default AWS CLI profile. https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html (cherry picked from commit 0db7467)
1 parent 086a325 commit 95da0df

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

.ci/ansible_install.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
'-r tests/requirements.txt '
1313
'-r tests/ansible/requirements.txt',
1414
'pip install -q ansible=={0}'.format(ci_lib.ANSIBLE_VERSION)
15+
],
16+
[
17+
'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws',
1518
]
1619
]
1720

18-
batches.append(ci_lib.throttle(
21+
batches[-1].extend([
1922
'docker pull %s' % (ci_lib.image_for_distro(distro),)
2023
for distro in ci_lib.DISTROS
21-
))
24+
])
2225

2326
ci_lib.run_batches(batches)

.ci/azure-pipelines-steps.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ steps:
3939

4040
- script: .ci/$(MODE)_install.py
4141
displayName: "Run $(MODE)_install.py"
42+
env:
43+
AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
44+
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
45+
AWS_DEFAULT_REGION: $(AWS_DEFAULT_REGION)
4246

4347
- script: .ci/$(MODE)_tests.py
4448
displayName: "Run $(MODE)_tests.py"

.ci/debops_common_install.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
'pip install -qqqU debops==0.7.2 ansible==%s' % ci_lib.ANSIBLE_VERSION,
1414
],
1515
[
16+
'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws',
1617
'docker pull %s' % (ci_lib.image_for_distro('debian'),),
1718
],
1819
])

.ci/mitogen_install.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
if ci_lib.have_docker():
1313
batches.append([
14+
'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws',
1415
'docker pull %s' % (ci_lib.image_for_distro(ci_lib.DISTRO),),
1516
])
1617

.ci/mitogen_py24_install.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
batches = [
66
[
7+
'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws',
78
'docker pull %s' % (ci_lib.image_for_distro(ci_lib.DISTRO),),
89
],
910
[

0 commit comments

Comments
 (0)