-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Simplify Lambda deployment with zip files instead of container images #18
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
base: main
Are you sure you want to change the base?
feat: Simplify Lambda deployment with zip files instead of container images #18
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
- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users cannot find this file. Move to a better place.
Do you understand the tutorial flow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary
content/ja/40-deploy/02-pipeline.md
Outdated
@@ -21,8 +21,9 @@ _手順は[1. シンプルなデプロイ](01-simply.md)とほとんど同じで | |||
- `servicedef.yaml`: `/src/deploy/ecs/simple/servicedef.yaml`からコピーして、`serviceName`を変更 | |||
- `taskdef.yaml`: `/src/deploy/ecs/simple/taskdef.yaml`からコピーして、`family`を変更 | |||
- **AWS Lambda**向け: | |||
- あなたのイメージを利用して関数をCanaryリリースしていきます。 | |||
- `lambda/canary/`を以下のように編集してください。 | |||
- Canaryデプロイ戦略を使用してあなた自身のPythonソースコードから関数を作成します。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not 'your own 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`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you gonna copy??
git: "" # Empty means same repository | ||
ref: "" # Empty means current commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how did you know this spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.yaml
files to use S3 zip deployment instead of ECR imagesbuild.sh
for Linux/Mac,build.bat
for 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