feat: Simplify Lambda deployment with zip files instead of container images #18
feat: Simplify Lambda deployment with zip files instead of container images #18RayyanSeliya wants to merge 7 commits intopipe-cd:mainfrom
Conversation
|
hey @t-kikuc i have implemented this feature you can have a look and ping me if any changes needed i have also done some basic testing skipped the aws one coz dont have an account yet ! |
content/en/40-deploy/02-pipeline.md
Outdated
| - You will create a function using source code with Canary release strategy. | ||
| - Edit `lambda/canary/` as below. | ||
| - `function.yaml`: Copy from your `/src/deploy/lambda/simple/function.yaml`] and rename `name`. | ||
| - Build the canary function package: Run `./build.sh` (Linux/Mac) or `build.bat` (Windows) |
There was a problem hiding this comment.
Please make a procedure without building and pushing to s3. That's troublesome.
Use the zip packing feature of PipeCD Lambda.
There was a problem hiding this comment.
Sure will research on this through https://pipecd.dev/docs-v0.52.x/user-guide/managing-application/defining-app-configuration/lambda/ and implement it accordingly
|
hey @t-kikuc made necessary changes based on your feedback ! do let me know if any changes |
src/deploy/lambda/README.md
Outdated
There was a problem hiding this comment.
Users cannot find this file. Move to a better place.
Do you understand the tutorial flow?
There was a problem hiding this comment.
Thank you @t-kikuc for your feedback. I initially focused on the Lambda ZIP deployment itself, but after your comments, I reviewed the tutorial structure to ensure my changes fit the main flow. I’ve deleted the standalone Lambda README and moved the instructions into 01-simply.md and 02-pipeline.md for clarity. Thanks again for helping me see the tutorial from the user’s perspective!
src/deploy/lambda/README.md
Outdated
| ## 🎯 What's New (Issue #16) | ||
|
|
||
| Previously, the Lambda tutorial required: | ||
| - ❌ Building and pushing container images to ECR | ||
| - ❌ Complex Docker setup | ||
| - ❌ ECR repository management | ||
|
|
||
| Now it uses: | ||
| - ✅ Simple Python source code | ||
| - ✅ **Automatic packaging by PipeCD** | ||
| - ✅ **No manual zip building or S3 uploads** | ||
| - ✅ Minimal prerequisites (just an IAM role) |
content/ja/40-deploy/02-pipeline.md
Outdated
| - **AWS Lambda**向け: | ||
| - あなたのイメージを利用して関数をCanaryリリースしていきます。 | ||
| - `lambda/canary/`を以下のように編集してください。 | ||
| - Canaryデプロイ戦略を使用してあなた自身のPythonソースコードから関数を作成します。 |
There was a problem hiding this comment.
| - Canaryデプロイ戦略を使用してあなた自身のPythonソースコードから関数を作成します。 | |
| - Canaryデプロイ戦略を使用してPythonソースコードから関数を作成します。 |
content/en/40-deploy/01-simply.md
Outdated
| - You will create a function of your own image. | ||
| - Edit `lambda/simple/` as below. | ||
| - `function.yaml`: Edit `role` and `image`. | ||
| - You will create a function from your own Python source code. |
content/en/40-deploy/02-pipeline.md
Outdated
| - Edit `lambda/canary/` as below. | ||
| - `function.yaml`: Copy from your `/src/deploy/lambda/simple/function.yaml`] and rename `name`. | ||
| - You will create a function from your own Python source code using a canary deployment strategy. | ||
| - Edit `lambda/canary/function.yaml`: Copy from your `src/deploy/lambda/simple/function.yaml` and rename the `name`. |
| git: "" # Empty means same repository | ||
| ref: "" # Empty means current commit |
There was a problem hiding this comment.
how did you know this spec?
hey @t-kikuc I implemented this based on the code comments and the pattern I saw in other PipeCD resources. The Helm chart docs mention that 'Empty means the same repository' (https://pipecd.dev/docs-v0.52.x/user-guide/configuration-reference/#analysis-template-configuration:~:text=Empty%20means%20the%20same%20repository), and I assumed this convention applies to Lambda functions too.
If this approach isn't correct for Lambda functions, I'd appreciate your guidance on what values should be used instead for the tutorial. Should we use explicit git/ref values or is there a better way to reference the current repository?
There was a problem hiding this comment.
There was a problem hiding this comment.
This is not helm chart.
See https://pipecd.dev/docs-v0.52.x/user-guide/managing-application/defining-app-configuration/lambda/ and https://github.com/pipe-cd/pipecd/blob/0c999367d009c143baa72785d4ad6bd841bdb189/pkg/app/piped/platformprovider/lambda/function.go#L128-L142
@t-kikuc Thank you for pointing out my mistake with the empty git / ref fields. I've corrected both function.yaml files to align exactly with the documentation at https://pipecd.dev/docs-v0.52.x/user-guide/managing-application/defining-app-configuration/lambda/#:~:text=Deploy%20source%20code,Lambda%20function%20pattern. I've maintained the same comment style as the official example while using HTTPS URLs for GitHub repositories, which is more beginner-friendly for the tutorial. The [EDIT_HERE] markers will guide users to replace these values with their own repository information.
|
hey @t-kikuc i see that i have made several mistakes and thanks for pointing out me updated some of the mistakes you can have a look and discuss about this #18 (comment) |
Implements Issue #16 by replacing the complex container image approach with simple Python source code deployment for Lambda functions.
Core Implementation
index.py) for simple and canary deploymentsfunction.yamlfiles to use S3 zip deployment instead of ECR imagesbuild.shfor Linux/Mac,build.batfor Windows)Documentation Updates
Technical Improvements
Impact
Before: Users needed Docker, ECR repository, container building knowledge
After: Users only need Python 3.9+, S3 bucket, and basic IAM role
This dramatically reduces the barrier to entry for the Lambda tutorial, making it accessible to developers without container expertise.
Testing
See some screenshots of the implementation