Skip to content

Commit

Permalink
Upgrade CodeBuild to support Node 18.x
Browse files Browse the repository at this point in the history
This fixes:
```
node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
```
  • Loading branch information
kichik committed Oct 16, 2023
1 parent 15f4d68 commit ea29f0d
Show file tree
Hide file tree
Showing 10 changed files with 777 additions and 782 deletions.
2 changes: 1 addition & 1 deletion .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .projenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const project = new awscdk.AwsCdkConstructLibrary({
author: 'Amir Szekely',
authorAddress: '[email protected]',
stability: Stability.EXPERIMENTAL,
cdkVersion: '2.77.0', // 2.54.0 for https://github.com/aws/aws-cdk/pull/22124, 2.77.0 for removing node 14
cdkVersion: '2.87.0', // 2.54.0 for https://github.com/aws/aws-cdk/pull/22124, 2.77.0 for removing node 14, 2.87.0 for node 18 on CodeBuild
defaultReleaseBranch: 'main',
name: '@cloudsnorkel/cdk-turbo-layers',
repositoryUrl: 'https://github.com/CloudSnorkel/cdk-turbo-layers.git',
Expand Down
4 changes: 2 additions & 2 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class BaseDependencyPackager extends Construct implements iam.IGrantable,
subnetSelection: internalProps.props?.subnetSelection,
environment: {
buildImage: this.architecture == lambda.Architecture.X86_64 ?
codebuild.LinuxBuildImage.AMAZON_LINUX_2_4 : codebuild.LinuxArmBuildImage.AMAZON_LINUX_2_STANDARD_2_0,
codebuild.LinuxBuildImage.AMAZON_LINUX_2_5 : codebuild.LinuxArmBuildImage.AMAZON_LINUX_2_STANDARD_2_0,
},
logging: {
cloudWatch: {
Expand Down
3 changes: 2 additions & 1 deletion src/package-nodejs.lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent
// setup home
try {
fs.mkdirSync('/tmp/home');
} catch (err: any) {
} catch (err) {
// @ts-ignore
if (err.code !== 'EEXIST') {
throw err;
}
Expand Down
24 changes: 12 additions & 12 deletions test/default.integ.snapshot/Turbo-Layer-Test.assets.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "31.0.0",
"version": "32.0.0",
"files": {
"40aa87cdf43c4095cec18bc443965f22ab2f8c1ace47e482a0ba4e35d83b0cc9": {
"d28a3fa64d0bd6c7c6f1d6fd707d3e6dc5c81fe8f47891b89459b6492586997f": {
"source": {
"path": "asset.40aa87cdf43c4095cec18bc443965f22ab2f8c1ace47e482a0ba4e35d83b0cc9",
"path": "asset.d28a3fa64d0bd6c7c6f1d6fd707d3e6dc5c81fe8f47891b89459b6492586997f",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "40aa87cdf43c4095cec18bc443965f22ab2f8c1ace47e482a0ba4e35d83b0cc9.zip",
"objectKey": "d28a3fa64d0bd6c7c6f1d6fd707d3e6dc5c81fe8f47891b89459b6492586997f.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand All @@ -27,15 +27,15 @@
}
}
},
"f5b6a6d08a8206e67d0b54e2a29abd7e0472d835abc71037de3a93545b5edacc": {
"5fa1330271b8967d9254ba2d4a07144f8acefe8b77e6d6bba38261373a50d5f8": {
"source": {
"path": "asset.f5b6a6d08a8206e67d0b54e2a29abd7e0472d835abc71037de3a93545b5edacc",
"path": "asset.5fa1330271b8967d9254ba2d4a07144f8acefe8b77e6d6bba38261373a50d5f8",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "f5b6a6d08a8206e67d0b54e2a29abd7e0472d835abc71037de3a93545b5edacc.zip",
"objectKey": "5fa1330271b8967d9254ba2d4a07144f8acefe8b77e6d6bba38261373a50d5f8.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand All @@ -53,15 +53,15 @@
}
}
},
"e6b302aaee9bb5261338cf6b21e540e805eeaf2c18eb3246f7556104f361f68d": {
"61b977bd2ad84e98e78440b618c2decfff23ec89f32908ad25d182c090bf6bec": {
"source": {
"path": "asset.e6b302aaee9bb5261338cf6b21e540e805eeaf2c18eb3246f7556104f361f68d",
"path": "asset.61b977bd2ad84e98e78440b618c2decfff23ec89f32908ad25d182c090bf6bec",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "e6b302aaee9bb5261338cf6b21e540e805eeaf2c18eb3246f7556104f361f68d.zip",
"objectKey": "61b977bd2ad84e98e78440b618c2decfff23ec89f32908ad25d182c090bf6bec.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down Expand Up @@ -235,15 +235,15 @@
}
}
},
"12fc37fe63c4e8c1cd414d9f88013e6fb727d50abee15fed3294a634b955ce38": {
"3a503d4db4e69346c332bfe77fce8ce0c794379d3af40b21131b92e270d6c489": {
"source": {
"path": "Turbo-Layer-Test.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "12fc37fe63c4e8c1cd414d9f88013e6fb727d50abee15fed3294a634b955ce38.json",
"objectKey": "3a503d4db4e69346c332bfe77fce8ce0c794379d3af40b21131b92e270d6c489.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
22 changes: 11 additions & 11 deletions test/default.integ.snapshot/Turbo-Layer-Test.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/amazonlinux2-x86_64-standard:4.0",
"Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0",
"ImagePullCredentialsType": "CODEBUILD",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
Expand Down Expand Up @@ -1192,18 +1192,18 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "40aa87cdf43c4095cec18bc443965f22ab2f8c1ace47e482a0ba4e35d83b0cc9.zip"
"S3Key": "d28a3fa64d0bd6c7c6f1d6fd707d3e6dc5c81fe8f47891b89459b6492586997f.zip"
},
"Timeout": 900,
"MemorySize": 128,
"Handler": "__entrypoint__.handler",
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
"Arn"
]
},
"Runtime": "nodejs16.x",
"Runtime": "nodejs18.x",
"Description": {
"Fn::Join": [
"",
Expand Down Expand Up @@ -1293,7 +1293,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "f5b6a6d08a8206e67d0b54e2a29abd7e0472d835abc71037de3a93545b5edacc.zip"
"S3Key": "5fa1330271b8967d9254ba2d4a07144f8acefe8b77e6d6bba38261373a50d5f8.zip"
},
"Role": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -1852,7 +1852,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "e6b302aaee9bb5261338cf6b21e540e805eeaf2c18eb3246f7556104f361f68d.zip"
"S3Key": "61b977bd2ad84e98e78440b618c2decfff23ec89f32908ad25d182c090bf6bec.zip"
},
"Timeout": 900,
"MemorySize": 128,
Expand All @@ -1863,7 +1863,7 @@
"Arn"
]
},
"Runtime": "nodejs16.x"
"Runtime": "nodejs18.x"
},
"DependsOn": [
"AWSCDKTriggerCustomResourceProviderCustomResourceProviderRoleE18FAF0A"
Expand Down Expand Up @@ -3111,7 +3111,7 @@
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/amazonlinux2-x86_64-standard:4.0",
"Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0",
"ImagePullCredentialsType": "CODEBUILD",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
Expand Down Expand Up @@ -4860,7 +4860,7 @@
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/amazonlinux2-x86_64-standard:4.0",
"Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0",
"ImagePullCredentialsType": "CODEBUILD",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
Expand Down Expand Up @@ -6609,7 +6609,7 @@
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/amazonlinux2-x86_64-standard:4.0",
"Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0",
"ImagePullCredentialsType": "CODEBUILD",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
Expand Down Expand Up @@ -7727,7 +7727,7 @@
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/amazonlinux2-x86_64-standard:4.0",
"Image": "aws/codebuild/amazonlinux2-x86_64-standard:5.0",
"ImagePullCredentialsType": "CODEBUILD",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
Expand Down
16 changes: 8 additions & 8 deletions test/default.integ.snapshot/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "31.0.0",
"version": "32.0.0",
"artifacts": {
"Turbo-Layer-Test.assets": {
"type": "cdk:asset-manifest",
Expand All @@ -17,7 +17,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/12fc37fe63c4e8c1cd414d9f88013e6fb727d50abee15fed3294a634b955ce38.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3a503d4db4e69346c332bfe77fce8ce0c794379d3af40b21131b92e270d6c489.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down Expand Up @@ -267,12 +267,6 @@
"data": "Python39CodeBuildPoetryCurrentVersionDBDF4A62bda03456dafba602c33723cecd0fc0f7"
}
],
"/Turbo-Layer-Test/DefaultCrNodeVersionMap": [
{
"type": "aws:cdk:logicalId",
"data": "DefaultCrNodeVersionMap"
}
],
"/Turbo-Layer-Test/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [
{
"type": "aws:cdk:logicalId",
Expand Down Expand Up @@ -303,6 +297,12 @@
"data": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A"
}
],
"/Turbo-Layer-Test/DefaultCrNodeVersionMap": [
{
"type": "aws:cdk:logicalId",
"data": "DefaultCrNodeVersionMap"
}
],
"/Turbo-Layer-Test/AWSCDK.TriggerCustomResourceProviderCustomResourceProvider/Role": [
{
"type": "aws:cdk:logicalId",
Expand Down
Loading

0 comments on commit ea29f0d

Please sign in to comment.