Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

(aws-cdk): CDK 2.79.0 size above 300 MB #25588

Open
ermanno opened this issue May 15, 2023 · 9 comments
Open

(aws-cdk): CDK 2.79.0 size above 300 MB #25588

ermanno opened this issue May 15, 2023 · 9 comments
Labels
aws-cdk-lib Related to the aws-cdk-lib package bug This issue is a bug. effort/medium Medium work item – several days of effort p1

Comments

@ermanno
Copy link
Contributor

ermanno commented May 15, 2023

Describe the bug

The Python CDK 2.79.0 package is above 300 MB. From past interactions we were informed that this should have been caused by a bug introduced in 2.73.0 which would have been fixed in more current versions. This is an issue for our use case (use CDKv2 from a lambda layer, which has a 265 MB size limit).

Expected Behavior

The CDKv2 size should be around 100 MB like in versions prior to 2.73.0.

Current Behavior

The latest CDKv2 version (2.79.0)'s size is above 300 MB.

Reproduction Steps

  • pip install aws-cdk-lib==2.79.0
  • List the size of cdk dirs in site packages:
(venv) ➜  site-packages du -hd1 | grep cdk
 36K    ./aws_cdk.asset_node_proxy_agent_v5-2.0.142.dist-info
 36K    ./aws_cdk.asset_awscli_v1-2.2.169.dist-info
 36K    ./aws_cdk.asset_kubectl_v20-2.1.1.dist-info
168K    ./aws_cdk_lib-2.79.0.dist-info
346M    ./aws_cdk

Possible Solution

No response

Additional Information/Context

This is a problem for us because we plan use it from a Lambda layer and there we have a 256 MB size limit.

CDK CLI Version

2.79.0

Framework Version

No response

Node.js Version

20

OS

Mac

Language

Python

Language Version

No response

Other information

No response

@ermanno ermanno added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 15, 2023
@github-actions github-actions bot added the aws-cdk-lib Related to the aws-cdk-lib package label May 15, 2023
@pahud pahud added p1 needs-review effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels May 15, 2023
@pahud
Copy link
Contributor

pahud commented May 15, 2023

Thank you for your report. Will bring this up to the team for review.

@peterwoodworth
Copy link
Contributor

Might be related aws/jsii#4066

@mrgrain
Copy link
Contributor

mrgrain commented Jun 12, 2023

Might be related aws/jsii#4066

It's certainly a contributing factor.

@otaviomacedo otaviomacedo removed their assignment Jun 13, 2023
@tgmedia-nz
Copy link

We face the same problem, and I can see that the following modules are also massive, and I can't see the need for them:

29592 asset_awscli_v1
49664 asset_kubectl_v20

With quicksight, I've removed it from the import in init.py and done a rm -rf aws_quicksight, but it still leaves the aws-cdk-lib module at around 171MB - yikes.

Ideas how to remove those above?

@tgmedia-nz
Copy link

@ermanno - did you find a solution?

@ermanno
Copy link
Contributor Author

ermanno commented Jul 4, 2023

@tgmedia-nz Unfortunately, no. For the moment we are using an older version which didn't have this problem, but of course going forward we will need to be able to update this dependency.

@tgmedia-nz
Copy link

Hi @pahud - sorry to raise this again but would someone be able to point into the right direction on how to remove the dependency of asset_awscli_v1 and asset_kubectl_v20?

@tgmedia-nz
Copy link

Any help please?

@tgmedia-nz
Copy link

Just in case anyone else comes across this - we've shifted to use CDK v2 via CodeBuild where we have a ecr repo with pre-built CDK and all requirements installed, then just calling CB via event bridge.

@MrArnoldPalmer MrArnoldPalmer removed their assignment Nov 14, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
aws-cdk-lib Related to the aws-cdk-lib package bug This issue is a bug. effort/medium Medium work item – several days of effort p1
Projects
None yet
Development

No branches or pull requests

8 participants