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: BundlingOptions/Bundling Props interface mismatch #29697

Closed
automartin5000 opened this issue Apr 2, 2024 · 6 comments
Closed
Assignees
Labels
@aws-cdk/aws-lambda-python bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@automartin5000
Copy link

Describe the bug

In the PythonFunction construct, bundling expects BundlingOptions. However, the actual bundle method expects BundleProps.

Expected Behavior

I think the expected behavior of this code, is that the spread operator will allow you specify whatever additional options you want.

Current Behavior

Given the type mismatch, I believe it then resolves any missing props from BundlingProps to never. For example, this means that if you give any value for bundling, that it's impossible to specify Architecture, as that doesn't exist on BundlingOptions.

Reproduction Steps

Set a new image for a PythonFunction in bundling, set Architecture to Architecture.ARM64. Set the platform value to linux/arm64. Docker still attempts to build with x86.

Possible Solution

The expected type for bundling should be BundlingProps, not BundlingOptions.

Additional Information/Context

No response

CDK CLI Version

2.135.0

Framework Version

No response

Node.js Version

20

OS

macOS Sonoma

Language

Python

Language Version

3.12

Other information

No response

@automartin5000 automartin5000 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 2, 2024
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Apr 5, 2024
@khushail khushail self-assigned this Apr 5, 2024
@khushail khushail added p2 effort/small Small work item – less than a day of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels May 23, 2024
@khushail khushail assigned Leo10Gama and unassigned khushail May 23, 2024
@Leo10Gama
Copy link
Member

I'm not too sure what the source of the issue is here. The parameters you've mentioned such as architecture are passed in when bundle() is called via the PythonFunctionProps constructor itself, and it's not possible to pass in that value via bundling for it to get overwritten, since BundlingOptions doesn't expect that value.

If you could provide a full snippet showing where you're running into problems, I can help resolve things better.

@Leo10Gama Leo10Gama added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 24, 2024
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label May 27, 2024
@automartin5000
Copy link
Author

I'll work on trying to replicate this issue this week.

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels May 28, 2024
@automartin5000
Copy link
Author

Ok, this looks like it might be a bug on our side, so I'm gonna close for now.

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@aws-cdk-automation
Copy link
Collaborator

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-lambda-python bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

No branches or pull requests

4 participants