-
Notifications
You must be signed in to change notification settings - Fork 4k
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
bundling - multiple docker image builds #9424
Comments
We need to cache during |
I do have an app with multiple stacks and I am facing a similar issue when bundling Lambda functions with the NodejsFunction class. Even though the functions are only used in one of the stacks, the assets bundling is still happening multiple times during a single deploy (number of NodejsFunction X number of stacks). I do have 11 stacks and 3 functions, so this is quite impacting. I'm thinking this might be linked to #8882 as well? |
@jogold yes we can probably avoid multiple builds if the exact same input is used. Wondering though why isn't docker doing that for us? |
Because we are |
Requires #9576 |
Cache asset hashes when staging. This avoids rebundling an asset with `AssetHashType.OUTPUT` when it is used in multiple stacks in an app. This also removes unnecessary file system operations for other asset hash types. Closes aws#9424
Cache asset hashes. This avoids file system and bundling operations when the same asset with the same configuration is used in multiple stacks in an app. Closes #9424 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
When use same Lambda for multiple places CDK builds same docker image for each case.
Use Case
We have 2 Custom Resources that are used in multiple places. So when doing synth for some stack there are 26 or so docker image builds happening for those Lambdas. We have devs, staging and production so for each place it is used image is built 3 times (not all services have all environments so not 3 * 2 * n)
When I tried to cache created Code objects that are generated only with input of path and runtime I get errors about cross stack referencing.
Proposed Solution
Build docker image only once per runtime & path combination. Also wouldn't mind if synth for one stack wouldn't build everything for all stacks.
Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: