Skip to content
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

feat(codebuild): add support for small ARM machine type #16635

Merged
merged 5 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1656,8 +1656,8 @@ class ArmBuildImage implements IBuildImage {
public validate(buildEnvironment: BuildEnvironment): string[] {
const ret = [];
if (buildEnvironment.computeType &&
buildEnvironment.computeType !== ComputeType.LARGE) {
ret.push(`ARM images only support ComputeType '${ComputeType.LARGE}' - ` +
buildEnvironment.computeType !== (ComputeType.SMALL || ComputeType.LARGE)) {
grusy marked this conversation as resolved.
Show resolved Hide resolved
ret.push(`ARM images only support ComputeTypes '${ComputeType.SMALL}' and '${ComputeType.LARGE}' - ` +
`'${buildEnvironment.computeType}' was given`);
}
return ret;
Expand Down
17 changes: 2 additions & 15 deletions packages/@aws-cdk/aws-codebuild/test/codebuild.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1590,19 +1590,6 @@ describe('ARM image', () => {
});
});

test('cannot be used in conjunction with ComputeType SMALL', () => {
grusy marked this conversation as resolved.
Show resolved Hide resolved
const stack = new cdk.Stack();

expect(() => {
new codebuild.PipelineProject(stack, 'Project', {
environment: {
buildImage: codebuild.LinuxBuildImage.AMAZON_LINUX_2_ARM,
computeType: codebuild.ComputeType.SMALL,
},
});
}).toThrow(/ARM images only support ComputeType 'BUILD_GENERAL1_LARGE' - 'BUILD_GENERAL1_SMALL' was given/);
});

test('cannot be used in conjunction with ComputeType MEDIUM', () => {
const stack = new cdk.Stack();

Expand All @@ -1613,7 +1600,7 @@ describe('ARM image', () => {
computeType: codebuild.ComputeType.MEDIUM,
},
});
}).toThrow(/ARM images only support ComputeType 'BUILD_GENERAL1_LARGE' - 'BUILD_GENERAL1_MEDIUM' was given/);
}).toThrow(/ARM images only support ComputeTypes 'BUILD_GENERAL1_SMALL' and 'BUILD_GENERAL1_LARGE' - 'BUILD_GENERAL1_MEDIUM' was given/);
});

grusy marked this conversation as resolved.
Show resolved Hide resolved
test('cannot be used in conjunction with ComputeType X2_LARGE', () => {
Expand All @@ -1626,7 +1613,7 @@ describe('ARM image', () => {
computeType: codebuild.ComputeType.X2_LARGE,
},
});
}).toThrow(/ARM images only support ComputeType 'BUILD_GENERAL1_LARGE' - 'BUILD_GENERAL1_2XLARGE' was given/);
}).toThrow(/ARM images only support ComputeTypes 'BUILD_GENERAL1_SMALL' and 'BUILD_GENERAL1_LARGE' - 'BUILD_GENERAL1_2XLARGE' was given/);
});
});
});
Expand Down