Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 165256e

Browse files
authored
feat(cli-integ): speed up image pulls by logging into ECR public (#84)
When running the suite on CodeBuild, we are seeing timeout failures in the following tests: - `CDK synth add the metadata properties expected by sam` - `CDK synth bundled functions as expected` - `test resource import with construct that requires bundling` - `deploy new style synthesis to new style bootstrap (with docker image)` - `all calls from isolated container go through proxy` These are all tests that either directly pull from `public.ecr.gallery`, or do so as part of `cdk synth`. In both cases, the pull is unauthenticated, and is therefore susceptible to stricter throttling limits, which can significantly slow things down. Running the tests individually succeeds, so it must be something to do with the high concurrency introduced by atmosphere. Lets login to ECR public before every test. I'm not convinced this will solve the issue, but it can't hurt and worst case we eliminate that as a cause and continue investigating. **Why are we not seeing the same errors when running in GitHub?** My theory right now is that CodeBuild IP addresses are being throttled much more aggressively than Github ones.
1 parent 7afef9c commit 165256e

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export function withSpecificCdkApp(
4646
context.output,
4747
context.aws,
4848
context.randomString);
49+
await fixture.ecrPublicLogin();
4950

5051
let success = true;
5152
try {
@@ -119,6 +120,7 @@ export function withCdkMigrateApp(
119120
context.aws,
120121
context.randomString,
121122
);
123+
await fixture.ecrPublicLogin();
122124

123125
await ensureBootstrapped(fixture);
124126

packages/@aws-cdk-testing/cli-integ/lib/with-cli-lib.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export function withCliLibIntegrationCdkApp<A extends TestContext & AwsContext &
2727
context.output,
2828
context.aws,
2929
context.randomString);
30+
await fixture.ecrPublicLogin();
3031

3132
let success = true;
3233
try {

packages/@aws-cdk-testing/cli-integ/lib/with-sam.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export function withSamIntegrationCdkApp<A extends TestContext & AwsContext>(blo
3535
context.output,
3636
context.aws,
3737
context.randomString);
38+
await fixture.ecrPublicLogin();
3839

3940
let success = true;
4041
try {

0 commit comments

Comments
 (0)