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

PythonFunction additional build options #609

Open
1 of 11 tasks
CoreOxide opened this issue Jan 2, 2024 · 6 comments
Open
1 of 11 tasks

PythonFunction additional build options #609

CoreOxide opened this issue Jan 2, 2024 · 6 comments
Labels
status/proposed Newly proposed RFC

Comments

@CoreOxide
Copy link

CoreOxide commented Jan 2, 2024

Description

Today, CDK deploy uses docker as it's backend to collect and install dependencies. I'm proposing a way to do that without using Docker. It will also allow building for different OS targets and Lambda runtimes.

There are 2 ways to build without docker:

  • Using native dependency resolution using PIP flags.
  • Using AWS CloudShell (most useful for building Lambda Layers).

As @evgenyka suggested in #579, I want to inherit from PythonFunction and intorucde building backend options to the new class.

Looking for your approval before going forward.

Roles

Role User
Proposed by @CoreOxide
Author(s) @alias, @alias, @alias
API Bar Raiser @alias
Stakeholders @alias, @alias, @alias

See RFC Process for details

Workflow

  • Tracking issue created (label: status/proposed)
  • API bar raiser assigned (ping us at #aws-cdk-rfcs if needed)
  • Kick off meeting
  • RFC pull request submitted (label: status/review)
  • Community reach out (via Slack and/or Twitter)
  • API signed-off (label status/api-approved applied to pull request)
  • Final comments period (label: status/final-comments-period)
  • Approved and merged (label: status/approved)
  • Execution plan submitted (label: status/planning)
  • Plan approved and merged (label: status/implementing)
  • Implementation complete (label: status/done)

Author is responsible to progress the RFC according to this checklist, and
apply the relevant labels to this issue so that the RFC table in README gets
updated.

@CoreOxide CoreOxide added the status/proposed Newly proposed RFC label Jan 2, 2024
@ran-isenberg
Copy link

nice one, would really help me to remove docker dependency in my open source project that use cdk and Lambda.
@evgenyka please approve this approach :)

@alexpulver
Copy link

alexpulver commented Jan 9, 2024

The aws-cdk-lib.aws_lambda.Function construct allows to perform local bundling, see the "Building locally" section in Building, bundling, and deploying applications with the AWS CDK blog post.

@evgenyka is there a reason aws-cdk.aws-lambda-python-alpha.PythonFunction can't support local bundling?

@ran-isenberg
Copy link

@evgenyka bump? :)

@CoreOxide
Copy link
Author

@evgenyka pls advise 👍

@evgenyka
Copy link

evgenyka commented Feb 26, 2024

@alexpulver Local bundling supported in Go and NodeJS (esbuild) at the moment,
@CoreOxide similar to: https://github.com/1davidmichael/cdk-local-bundling-example?
You can get your PR against aws/aws-cdk#18290

@CoreOxide
Copy link
Author

@evgenyka it is similar, however my solution is more robust. my code will allow building for Lambda natively from MacOS and Windows, installing the correct packages for Linux instead of the OS you're running on (which is what will happen here -> https://github.com/1davidmichael/cdk-local-bundling-example).

I will open a PR under aws/aws-cdk#18290.

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

No branches or pull requests

4 participants