From 1fd6dbe8d447e93f4928d1f4bd8eb33d29fbef1a Mon Sep 17 00:00:00 2001 From: Frank Dallezotte Date: Tue, 9 Apr 2024 10:17:07 -0700 Subject: [PATCH 1/6] update python, nodejs, and codebuild versions --- Cloud9Setup/pre-requisites.sh | 20 ++++---- .../lib/serverless-saas-stack.ts | 6 +-- .../bootstrap/lambdafunctions.yaml | 48 +++++++++---------- server/tenant-buildspec.yml | 2 +- server/tenant-template.yaml | 28 +++++------ 5 files changed, 51 insertions(+), 53 deletions(-) diff --git a/Cloud9Setup/pre-requisites.sh b/Cloud9Setup/pre-requisites.sh index b89ab8c6..3cf4394d 100755 --- a/Cloud9Setup/pre-requisites.sh +++ b/Cloud9Setup/pre-requisites.sh @@ -1,12 +1,10 @@ #!/bin/bash -x . /home/ec2-user/.nvm/nvm.sh -#Install python3.8 -sudo yum install -y amazon-linux-extras -sudo amazon-linux-extras enable python3.8 -sudo yum install -y python3.8 -sudo alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 -sudo alternatives --set python3 /usr/bin/python3.8 +# Install Python 3.11, available as a package on AL2023 +sudo yum install -y python3.11 +sudo alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 +sudo alternatives --set python3 /usr/bin/python3.11 # Uninstall aws cli v1 and Install aws cli version-2.3.0 sudo pip2 uninstall awscli -y @@ -41,13 +39,13 @@ rm get-pip.py python3 -m pip install git-remote-codecommit==1.15.1 -# Install node v16.20.0 -echo "Installing node v16.20.0" +# Install node v20.12.2 +echo "Installing node v20.12.2" nvm deactivate nvm uninstall node -nvm install v16.20.0 -nvm use v16.20.0 -nvm alias default v16.20.0 +nvm install v20.12.2 +nvm use v20.12.2 +nvm alias default v20.12.2 # Install cdk cli version ^2.0.0 echo "Installing cdk cli version ^2.0.0" diff --git a/server/TenantPipeline/lib/serverless-saas-stack.ts b/server/TenantPipeline/lib/serverless-saas-stack.ts index a7b5d6c4..0637e1c9 100644 --- a/server/TenantPipeline/lib/serverless-saas-stack.ts +++ b/server/TenantPipeline/lib/serverless-saas-stack.ts @@ -46,7 +46,7 @@ export class ServerlessSaaSStack extends cdk.Stack { const lambdaFunctionPrep = new Function(this, "prep-deploy", { handler: "lambda-prepare-deploy.lambda_handler", - runtime: Runtime.PYTHON_3_9, + runtime: Runtime.PYTHON_3_12, code: new AssetCode(`./resources`), memorySize: 512, timeout: Duration.seconds(10), @@ -131,7 +131,7 @@ export class ServerlessSaaSStack extends cdk.Stack { //Declare a new CodeBuild project const buildProject = new codebuild.PipelineProject(this, 'Build', { buildSpec : codebuild.BuildSpec.fromSourceFilename("server/tenant-buildspec.yml"), - environment: { buildImage: codebuild.LinuxBuildImage.AMAZON_LINUX_2_4 }, + environment: { buildImage: codebuild.LinuxBuildImage.AMAZON_LINUX_2_5 }, environmentVariables: { 'PACKAGE_BUCKET': { value: artifactsBucket.bucketName @@ -174,7 +174,7 @@ export class ServerlessSaaSStack extends cdk.Stack { const lambdaFunctionIterator = new Function(this, "WaveIterator", { handler: "iterator.lambda_handler", - runtime: Runtime.PYTHON_3_9, + runtime: Runtime.PYTHON_3_12, code: lambda.Code.fromAsset("resources", {exclude: ['*.json']}), memorySize: 512, timeout: Duration.seconds(10), diff --git a/server/nested_templates/bootstrap/lambdafunctions.yaml b/server/nested_templates/bootstrap/lambdafunctions.yaml index 54d4f40a..709772bc 100644 --- a/server/nested_templates/bootstrap/lambdafunctions.yaml +++ b/server/nested_templates/bootstrap/lambdafunctions.yaml @@ -58,11 +58,11 @@ Resources: Description: Utilities for project ContentUri: ../../layers/ CompatibleRuntimes: - - python3.9 + - python3.12 LicenseInfo: "MIT" RetentionPolicy: Retain Metadata: - BuildMethod: python3.9 + BuildMethod: python3.12 #Tenant Authorizer AuthorizerExecutionRole: @@ -135,7 +135,7 @@ Resources: Properties: CodeUri: ../../Resources/ Handler: shared_service_authorizer.lambda_handler - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt AuthorizerExecutionRole.Arn MemorySize: 256 Tracing: Active @@ -153,7 +153,7 @@ Resources: Properties: CodeUri: ../../Resources/ Handler: tenant_authorizer.lambda_handler - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt AuthorizerExecutionRole.Arn MemorySize: 256 Tracing: Active @@ -246,7 +246,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: user-management.create_tenant_admin_user - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt CreateUserLambdaExecutionRole.Arn Tracing: Active Layers: @@ -289,7 +289,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: user-management.create_user - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt CreateUserLambdaExecutionRole.Arn Tracing: Active Layers: @@ -328,7 +328,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: user-management.update_user - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantUserPoolLambdaExecutionRole.Arn Tracing: Active Layers: @@ -367,7 +367,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: user-management.disable_user - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantUserPoolLambdaExecutionRole.Arn Tracing: Active Layers: @@ -405,7 +405,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: user-management.disable_users_by_tenant - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantUserPoolLambdaExecutionRole.Arn Tracing: Active Layers: @@ -443,7 +443,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: user-management.enable_users_by_tenant - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantUserPoolLambdaExecutionRole.Arn Tracing: Active Layers: @@ -481,7 +481,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: user-management.get_user - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantUserPoolLambdaExecutionRole.Arn Tracing: Active Layers: @@ -519,7 +519,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: user-management.get_users - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantUserPoolLambdaExecutionRole.Arn Tracing: Active Layers: @@ -597,7 +597,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: tenant-management.create_tenant - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantManagementLambdaExecutionRole.Arn Tracing: Active Layers: @@ -635,7 +635,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: tenant-management.activate_tenant - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantManagementLambdaExecutionRole.Arn Tracing: Active Layers: @@ -675,7 +675,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: tenant-management.get_tenant - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantManagementLambdaExecutionRole.Arn Tracing: Active Layers: @@ -713,7 +713,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: tenant-management.deactivate_tenant - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantManagementLambdaExecutionRole.Arn Tracing: Active Layers: @@ -753,7 +753,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: tenant-management.update_tenant - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantManagementLambdaExecutionRole.Arn Tracing: Active Layers: @@ -795,7 +795,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: tenant-management.get_tenants - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantManagementLambdaExecutionRole.Arn Tracing: Active Layers: @@ -832,7 +832,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: tenant-management.load_tenant_config - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt TenantManagementLambdaExecutionRole.Arn Tracing: Active Layers: @@ -887,7 +887,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: tenant-registration.register_tenant - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt RegisterTenantLambdaExecutionRole.Arn Tracing: Active Layers: @@ -972,7 +972,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: tenant-provisioning.provision_tenant - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt ProvisionTenantLambdaExecutionRole.Arn Tracing: Active Layers: @@ -1038,7 +1038,7 @@ Resources: Properties: CodeUri: ../../TenantManagementService/ Handler: tenant-provisioning.deprovision_tenant - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt DeProvisionTenantLambdaExecutionRole.Arn Tracing: Active Layers: @@ -1103,7 +1103,7 @@ Resources: Properties: CodeUri: ../../custom_resources/ Handler: update_settings_table.handler - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt UpdateSettingsTableLambdaExecutionRole.Arn Layers: - !Ref ServerlessSaaSLayers @@ -1140,7 +1140,7 @@ Resources: Properties: CodeUri: ../../custom_resources/ Handler: update_tenantstackmap_table.handler - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt UpdateTenantStackMapTableLambdaExecutionRole.Arn Layers: - !Ref ServerlessSaaSLayers diff --git a/server/tenant-buildspec.yml b/server/tenant-buildspec.yml index 8f337ee7..54c4e983 100644 --- a/server/tenant-buildspec.yml +++ b/server/tenant-buildspec.yml @@ -5,7 +5,7 @@ version: 0.2 phases: install: runtime-versions: - python: 3.9 + python: 3.12 commands: # Install packages or any pre-reqs in this phase. # Upgrading SAM CLI to latest version diff --git a/server/tenant-template.yaml b/server/tenant-template.yaml index 04ab70f9..6f1c37b1 100644 --- a/server/tenant-template.yaml +++ b/server/tenant-template.yaml @@ -55,11 +55,11 @@ Resources: Description: Utilities for project ContentUri: layers/ CompatibleRuntimes: - - python3.9 + - python3.12 LicenseInfo: 'MIT' RetentionPolicy: Retain Metadata: - BuildMethod: python3.9 + BuildMethod: python3.12 ProductTable: Type: AWS::DynamoDB::Table @@ -147,7 +147,7 @@ Resources: Properties: CodeUri: ProductService/ Handler: product_service.get_product - Runtime: python3.9 + Runtime: python3.12 Tracing: Active Role: !GetAtt ProductFunctionExecutionRole.Arn ReservedConcurrentExecutions: !If [IsPooledDeploy, !Ref "AWS::NoValue" , !Ref LambdaReserveConcurrency] @@ -191,7 +191,7 @@ Resources: Properties: CodeUri: ProductService/ Handler: product_service.get_products - Runtime: python3.9 + Runtime: python3.12 Tracing: Active Role: !GetAtt ProductFunctionExecutionRole.Arn ReservedConcurrentExecutions: !If [IsPooledDeploy, !Ref "AWS::NoValue" , !Ref LambdaReserveConcurrency] @@ -235,7 +235,7 @@ Resources: Properties: CodeUri: ProductService/ Handler: product_service.create_product - Runtime: python3.9 + Runtime: python3.12 Tracing: Active Role: !GetAtt ProductFunctionExecutionRole.Arn Layers: @@ -278,7 +278,7 @@ Resources: Properties: CodeUri: ProductService/ Handler: product_service.update_product - Runtime: python3.9 + Runtime: python3.12 Tracing: Active Role: !GetAtt ProductFunctionExecutionRole.Arn Layers: @@ -321,7 +321,7 @@ Resources: Properties: CodeUri: ProductService/ Handler: product_service.delete_product - Runtime: python3.9 + Runtime: python3.12 Tracing: Active Role: !GetAtt ProductFunctionExecutionRole.Arn Layers: @@ -402,7 +402,7 @@ Resources: Properties: CodeUri: OrderService/ Handler: order_service.get_orders - Runtime: python3.9 + Runtime: python3.12 Tracing: Active Role: !GetAtt OrderFunctionExecutionRole.Arn ReservedConcurrentExecutions: !If [IsPooledDeploy, !Ref "AWS::NoValue" , !Ref LambdaReserveConcurrency] @@ -446,7 +446,7 @@ Resources: Properties: CodeUri: OrderService/ Handler: order_service.get_order - Runtime: python3.9 + Runtime: python3.12 Tracing: Active Role: !GetAtt OrderFunctionExecutionRole.Arn ReservedConcurrentExecutions: !If [IsPooledDeploy, !Ref "AWS::NoValue" , !Ref LambdaReserveConcurrency] @@ -490,7 +490,7 @@ Resources: Properties: CodeUri: OrderService/ Handler: order_service.create_order - Runtime: python3.9 + Runtime: python3.12 Tracing: Active Role: !GetAtt OrderFunctionExecutionRole.Arn Layers: @@ -533,7 +533,7 @@ Resources: Properties: CodeUri: OrderService/ Handler: order_service.update_order - Runtime: python3.9 + Runtime: python3.12 Tracing: Active Role: !GetAtt OrderFunctionExecutionRole.Arn Layers: @@ -576,7 +576,7 @@ Resources: Properties: CodeUri: OrderService/ Handler: order_service.delete_order - Runtime: python3.9 + Runtime: python3.12 Tracing: Active Role: !GetAtt OrderFunctionExecutionRole.Arn Layers: @@ -1254,7 +1254,7 @@ Resources: Properties: CodeUri: custom_resources/ Handler: update_usage_plan.handler - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt UpdateUsagePlanLambdaExecutionRole.Arn Layers: - !Ref ServerlessSaaSLayers @@ -1309,7 +1309,7 @@ Resources: Properties: CodeUri: custom_resources/ Handler: update_tenant_apigatewayurl.handler - Runtime: python3.9 + Runtime: python3.12 Role: !GetAtt UpdateTenantApiGatewayUrlLambdaExecutionRole.Arn Layers: - !Ref ServerlessSaaSLayers From bbde408fa9ce295cf48d1b5b452e7a920c2a03a9 Mon Sep 17 00:00:00 2001 From: Frank Dallezotte Date: Tue, 16 Apr 2024 22:28:27 -0700 Subject: [PATCH 2/6] update increase-disk-size.sh for AL2023, new default for Cloud9 --- Cloud9Setup/increase-disk-size.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Cloud9Setup/increase-disk-size.sh b/Cloud9Setup/increase-disk-size.sh index a2f5246f..6b749a9a 100755 --- a/Cloud9Setup/increase-disk-size.sh +++ b/Cloud9Setup/increase-disk-size.sh @@ -37,10 +37,11 @@ then sudo growpart /dev/xvda 1 # Expand the size of the file system. - # Check if we're on AL2 - STR=$(cat /etc/os-release) - SUB="VERSION_ID=\"2\"" - if [[ "$STR" == *"$SUB"* ]] + # Check if we're on AL2 or AL2023 + STR=$(cat /etc/os-release) + AL2="VERSION_ID=\"2\"" + AL2023="VERSION_ID=\"2023\"" + if [[ "$STR" =~ "$AL2"|"$AL2023" ]] then sudo xfs_growfs -d / else @@ -54,8 +55,9 @@ else # Expand the size of the file system. # Check if we're on AL2 STR=$(cat /etc/os-release) - SUB="VERSION_ID=\"2\"" - if [[ "$STR" == *"$SUB"* ]] + AL2="VERSION_ID=\"2\"" + AL2023="VERSION_ID=\"2023\"" + if [[ "$STR" =~ "$AL2"|"$AL2023" ]] then sudo xfs_growfs -d / else From 4131d425f6c623ab337d2f05295ccac0498f4428 Mon Sep 17 00:00:00 2001 From: Frank Dallezotte Date: Wed, 17 Apr 2024 07:56:19 -0700 Subject: [PATCH 3/6] add backward compatiblity for AL2 to pre-requisites.sh --- Cloud9Setup/pre-requisites.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Cloud9Setup/pre-requisites.sh b/Cloud9Setup/pre-requisites.sh index 3cf4394d..60a0aaf8 100755 --- a/Cloud9Setup/pre-requisites.sh +++ b/Cloud9Setup/pre-requisites.sh @@ -2,9 +2,19 @@ . /home/ec2-user/.nvm/nvm.sh # Install Python 3.11, available as a package on AL2023 -sudo yum install -y python3.11 -sudo alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 -sudo alternatives --set python3 /usr/bin/python3.11 +PYTHON_VERSION=python3.11 +sudo yum install -y "$PYTHON_VERSION" + +# Backwards compatible with AL2 +if [ $? -ne 0 ]; then + PYTHON_VERSION=python3.8 + sudo yum install -y amazon-linux-extras + sudo amazon-linux-extras enable "$PYTHON_VERSION" + sudo yum install -y "$PYTHON_VERSION" +fi + +sudo alternatives --install /usr/bin/python3 python3 /usr/bin/"$PYTHON_VERSION" 1 +sudo alternatives --set python3 /usr/bin/"$PYTHON_VERSION" # Uninstall aws cli v1 and Install aws cli version-2.3.0 sudo pip2 uninstall awscli -y From 519d8382bc25d2f6915b1d83b20123208043d973 Mon Sep 17 00:00:00 2001 From: Frank Dallezotte Date: Wed, 17 Apr 2024 11:21:07 -0700 Subject: [PATCH 4/6] more Cloud9 bootstrap updates for AL2023 --- Cloud9Setup/pre-requisites.sh | 38 +++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/Cloud9Setup/pre-requisites.sh b/Cloud9Setup/pre-requisites.sh index 60a0aaf8..78e97fc9 100755 --- a/Cloud9Setup/pre-requisites.sh +++ b/Cloud9Setup/pre-requisites.sh @@ -5,17 +5,33 @@ PYTHON_VERSION=python3.11 sudo yum install -y "$PYTHON_VERSION" -# Backwards compatible with AL2 +# Backward compatibility with AL2 if [ $? -ne 0 ]; then - PYTHON_VERSION=python3.8 - sudo yum install -y amazon-linux-extras - sudo amazon-linux-extras enable "$PYTHON_VERSION" - sudo yum install -y "$PYTHON_VERSION" + PYTHON_VERSION=python3.8 + sudo yum install -y amazon-linux-extras + sudo amazon-linux-extras enable "$PYTHON_VERSION" + sudo yum install -y "$PYTHON_VERSION" fi sudo alternatives --install /usr/bin/python3 python3 /usr/bin/"$PYTHON_VERSION" 1 sudo alternatives --set python3 /usr/bin/"$PYTHON_VERSION" +# Setting python3 breaks dnf and yum, check if we are using dnf +if [[ $(dnf --version) ]]; then + YUM_HEADER=$(head -1 /usr/bin/yum) + DNF_HEADER=$(head -1 /usr/bin/dnf) + PYTH3_HEADER=$'#!/usr/bin/python3' + if [[ "$YUM_HEADER" == "$PYTH3_HEADER" ]]; then + echo "Changing python interpreter for yum to system Python3.9" + sudo sed -i 's|#!/usr/bin/python3|#!/usr/bin/python3.9|g' /usr/bin/yum + fi + + if [[ "$DNF_HEADER" == "$PYTH3_HEADER" ]]; then + echo "Changing python interpreter for dnf to system Python3.9" + sudo sed -i 's|#!/usr/bin/python3|#!/usr/bin/python3.9|g' /usr/bin/dnf + fi +fi + # Uninstall aws cli v1 and Install aws cli version-2.3.0 sudo pip2 uninstall awscli -y @@ -24,19 +40,19 @@ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.3.0.zip" -o "awscli unzip awscliv2.zip sudo ./aws/install rm awscliv2.zip -rm -rf aws +rm -rf aws -# Install sam cli version 1.33.0 -echo "Installing sam cli version 1.33.0" -wget https://github.com/aws/aws-sam-cli/releases/download/v1.33.0/aws-sam-cli-linux-x86_64.zip +# Install sam cli version 1.115.0 +echo "Installing sam cli version 1.115.0" +wget https://github.com/aws/aws-sam-cli/releases/download/v1.115.0/aws-sam-cli-linux-x86_64.zip unzip aws-sam-cli-linux-x86_64.zip -d sam-installation sudo ./sam-installation/install if [ $? -ne 0 ]; then echo "Sam cli is already present, so deleting existing version" sudo rm /usr/local/bin/sam sudo rm -rf /usr/local/aws-sam-cli - echo "Now installing sam cli version 1.33.0" - sudo ./sam-installation/install + echo "Now installing sam cli version 1.115.0" + sudo ./sam-installation/install fi rm aws-sam-cli-linux-x86_64.zip rm -rf sam-installation From cf63aa4a7c37be784f13e9b370a872157b0b8431 Mon Sep 17 00:00:00 2001 From: Frank Dallezotte Date: Wed, 17 Apr 2024 13:25:20 -0700 Subject: [PATCH 5/6] more changes for AL2/AL2023 --- Cloud9Setup/pre-requisites.sh | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Cloud9Setup/pre-requisites.sh b/Cloud9Setup/pre-requisites.sh index 78e97fc9..e43c27b5 100755 --- a/Cloud9Setup/pre-requisites.sh +++ b/Cloud9Setup/pre-requisites.sh @@ -1,6 +1,15 @@ #!/bin/bash -x . /home/ec2-user/.nvm/nvm.sh +STR=$(cat /etc/os-release) +AL2023="VERSION_ID=\"2023\"" +IS_AL2023=false + +if [[ $STR == *"$AL2023"* ]]; then + echo "AL2023 detected" + IS_AL2023=true +fi + # Install Python 3.11, available as a package on AL2023 PYTHON_VERSION=python3.11 sudo yum install -y "$PYTHON_VERSION" @@ -16,8 +25,8 @@ fi sudo alternatives --install /usr/bin/python3 python3 /usr/bin/"$PYTHON_VERSION" 1 sudo alternatives --set python3 /usr/bin/"$PYTHON_VERSION" -# Setting python3 breaks dnf and yum, check if we are using dnf -if [[ $(dnf --version) ]]; then +# Check if we are using AL2023, setting python3 breaks dnf and yum +if [[ $IS_AL2023 == true ]]; then YUM_HEADER=$(head -1 /usr/bin/yum) DNF_HEADER=$(head -1 /usr/bin/dnf) PYTH3_HEADER=$'#!/usr/bin/python3' @@ -65,13 +74,15 @@ rm get-pip.py python3 -m pip install git-remote-codecommit==1.15.1 -# Install node v20.12.2 -echo "Installing node v20.12.2" -nvm deactivate -nvm uninstall node -nvm install v20.12.2 -nvm use v20.12.2 -nvm alias default v20.12.2 +if [[ $IS_AL2023 == true ]]; then + # Install node v20.12.2 + echo "Installing node v20.12.2" + nvm deactivate + nvm uninstall node + nvm install v20.12.2 + nvm use v20.12.2 + nvm alias default v20.12.2 +fi # Install cdk cli version ^2.0.0 echo "Installing cdk cli version ^2.0.0" From b0098937e9723fd38257252f0d7b58f03074a3db Mon Sep 17 00:00:00 2001 From: Frank Dallezotte Date: Wed, 17 Apr 2024 22:06:12 -0700 Subject: [PATCH 6/6] bump pylint to support python3.11 --- Cloud9Setup/increase-disk-size.sh | 2 +- Cloud9Setup/pre-requisites.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cloud9Setup/increase-disk-size.sh b/Cloud9Setup/increase-disk-size.sh index 6b749a9a..c637336b 100755 --- a/Cloud9Setup/increase-disk-size.sh +++ b/Cloud9Setup/increase-disk-size.sh @@ -53,7 +53,7 @@ else sudo growpart /dev/nvme0n1 1 # Expand the size of the file system. - # Check if we're on AL2 + # Check if we're on AL2 or AL2023 STR=$(cat /etc/os-release) AL2="VERSION_ID=\"2\"" AL2023="VERSION_ID=\"2023\"" diff --git a/Cloud9Setup/pre-requisites.sh b/Cloud9Setup/pre-requisites.sh index e43c27b5..634d80e5 100755 --- a/Cloud9Setup/pre-requisites.sh +++ b/Cloud9Setup/pre-requisites.sh @@ -92,7 +92,7 @@ npm install -g aws-cdk@"^2.0.0" #Install jq version 1.5 sudo yum -y install jq-1.5 -#Install pylint version 2.11.1 -python3 -m pip install pylint==2.11.1 +#Install pylint version 2.17.7 +python3 -m pip install pylint==2.17.7 python3 -m pip install boto3 \ No newline at end of file