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

Update python, nodejs, and codebuild versions. Add AL2023 support #75

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

frank-aws
Copy link

@frank-aws frank-aws commented Apr 18, 2024

Issue #, if available:

Description of changes:

  • Update AWS Lambda runtimes to PYTHON_3_12, which uses AL2023 (ref)

  • Update CodeBuild image to AMAZON_LINUX_2_5, which is also based on AL2023, and supports python3.12 (ref)

  • Update Cloud9Setup scripts, since the default Cloud9 platform is now AL2023:

    • Use node v20.12.2 for AL2023.
    • Use Python 3.11 for AL2023. Unfortunately, setting python3 through alternatives breaks yum and dnf, unless you explicitly set the system Python 3.9 as the interpreter, so included logic for that step.
      • Note: the Python version in the Cloud9 environment is one minor version behind the runtimes on 3.11, but the Cloud9 environment was also one minor version behind previously - so hopefully this isn't an issue. AL2023 did not have a python3.12 package available at time of writing (ref).
    • Bump sam-cli version to 1.115.0 (latest) to support python3.12 container image (based on AL2023).
    • Include conditional logic in Cloud9Setup/pre-requisites.sh to ensure backward compatibility with AL2 for python3.8 and node, since I'm not sure how many users will select that platform instead, but LMK if we should assume AL2023 in all cases and remove.
  • Bootstrapping on Cloud9 has been tested for both the default Amazon Linux 2023 and Amazon Linux 2 platform on t3.large. Note for Amazon Linux 2, I did not change the default pre-loaded node version, since 16.X is EOL. Default node version through nvm on an Amazon Linux 2 Cloud9 instance below:

$ node --version
v18.17.1
$ npm --version
10.5.2

I can submit a PR for the associated workshop as well once changes are discussed and approved.

Manual e2e tests performed (based on workshop, lab 1 through 5):

  1. Add a Tenant (tenant1) through SaaS Admin.
  2. As Tenant Admin for tenant1, add product on SaaS Commerce Application. Add order for product.
  3. Add a Tenant (tenant2) through Landing page.
  4. As a Tenant Admin for tenant2, add product on SaaS Commerce Application. Add erder for product. Verify isolation from tenant1 in Application, and entries in the Product-pooled and Order-pooled DynamoDB tables.
  5. Add a Tenant (tenant3) through Landing page as Platinum tier.
  6. Verify the CodePipeline serverless-saas-pipeline workflow completes successfully, and a new environment for the platinum tenant is deployed through CloudFormation successfully (i.e. - stack-<tenantId>).
  7. As a Tenant Admin for tenant3, add Product on SaaS Commerce Application. Add order for product. Verify product and order items are added to their respective, isolated tenant3 DynamoDB tables.

I believe the client environment files are tracked in this repo intentionally. I did not remove and add them to .gitignore. On my local branch, I used git update-index to skip the respective clients/{Admin,Application,Landing}/environments/* files. I also skipped server/samconfig-boostrap.toml and clients/Admin/src/aws-exports.ts. This shouldn't have any effect on the remote branches, but JFYI and for posterity.
i.e. -
git update-index --skip-worktree clients/Admin/src/environments/*

Thanks!

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant