-
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
(cli): build+publish all assets used for all selected stacks before deploying any stacks #21511
Closed
1 of 2 tasks
Labels
@aws-cdk/assets
Related to the @aws-cdk/assets package
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p1
package/tools
Related to AWS CDK Tools or CLI
Comments
misterjoshua
added
feature-request
A feature should be added or improved.
needs-triage
This issue or PR still needs to be triaged.
labels
Aug 8, 2022
github-actions
bot
added
the
@aws-cdk/assets
Related to the @aws-cdk/assets package
label
Aug 8, 2022
4 tasks
misterjoshua
changed the title
(cdk-assets): build+publish all assets used for all selected stacks before deploying any stacks
(cli): build+publish all assets used for all selected stacks before deploying any stacks
Aug 8, 2022
rix0rrr
added
effort/small
Small work item – less than a day of effort
p2
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Aug 10, 2022
mergify bot
pushed a commit
that referenced
this issue
Aug 19, 2022
Changes the CDK CLI to build assets before deploying any stacks. This allows the CDK CLI to catch docker build errors, such as from rate limiting, before any stacks are deployed. Moving asset builds this early prevents these build failures from interrupting multi-stack deployments part way through. Fixes #21511 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
josephedward
pushed a commit
to josephedward/aws-cdk
that referenced
this issue
Aug 30, 2022
Changes the CDK CLI to build assets before deploying any stacks. This allows the CDK CLI to catch docker build errors, such as from rate limiting, before any stacks are deployed. Moving asset builds this early prevents these build failures from interrupting multi-stack deployments part way through. Fixes aws#21511 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/assets
Related to the @aws-cdk/assets package
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p1
package/tools
Related to AWS CDK Tools or CLI
Describe the feature
The AWS CDK should support building and publishing all relevant assets from all selected stacks before it deploys anything.
Use Case
When deploying more than one stack at a time, and when these stacks contain docker image assets,
docker build
can happen after you've already deployed a few stacks. But,docker build
can fail for many reasons, including unexpected rate limiting. When this happens, the CDK will deploy some stacks but not all. The CDK could prevent this failure state if it built and published all relevant assets before it deployed anything with CloudFormation.Proposed Solution
Publishing could be performed before
aws-cdk/packages/aws-cdk/lib/cdk-toolkit.ts
Line 169 in 220177f
Most of the code needed is already in
CloudFormationDeployments.publishStackAssets
:aws-cdk/packages/aws-cdk/lib/api/cloudformation-deployments.ts
Line 452 in 74318c7
Other Information
I've opened a PR with the relevant changes to enable this behaviour. #21513
Acknowledgements
CDK version used
2.35.0
Environment details (OS name and version, etc.)
Linux
The text was updated successfully, but these errors were encountered: