aws / aws-parallelcluster-ui

Apache License 2.0
31 stars 20 forks source link

Added script for lambda code archive building + adapted main template for deployment #217

Closed BarcoMasile closed 1 year ago

BarcoMasile commented 1 year ago

Description

This PR introduces a script to package PCUI code as a zip archive for Lambda deployment. It also edits the main CloudFormation template parallelcluster-ui.yaml to allow the lambda deployment and correctly set everything up (otherwise it would have not been possible to test the changes). This assumes that the Lambda code archive is available in the same bucket where infrastructure CloudFormation templates are available.

Right now the script outputs all the info from the various commands it executes. The produced archive will be available at the path from the two specified mandatory parameters. Check the build_lambda_archive.sh top file comments for example on its usage.

NB: Right now only tests files are removed from the package. In a future PR we will separate dev dependencies and prod dependencies, so that Boto3 library and pytest (and other dev dependencies) will not be included in the bundle, making it lighter.

The main template has been stripped of several resources that are not needed anymore:

How Has This Been Tested?

This has been tested manually on my personal account, by generating the zip archive with the different options and by deploying the created archive using the edited CloudFormation template.

In order to increase the likelihood of your contribution being accepted, please make sure you have read both the Contributing Guidelines and the Project Guidelines

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