Skip to content

feat(cli): concurrent asset builds#983

Merged
mrgrain merged 12 commits intoaws:mainfrom
go-to-k:asset-build-conc
Mar 4, 2026
Merged

feat(cli): concurrent asset builds#983
mrgrain merged 12 commits intoaws:mainfrom
go-to-k:asset-build-conc

Conversation

@go-to-k
Copy link
Copy Markdown
Contributor

@go-to-k go-to-k commented Dec 7, 2025

Fixes #226

This PR adds the --asset-build-concurrency option to cdk deploy to parallelize asset build.

cdk deploy --asset-build-concurrency 4

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@go-to-k go-to-k marked this pull request as ready for review December 7, 2025 05:01
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.78%. Comparing base (c8f40dc) to head (dccb3d1).
⚠️ Report is 79 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #983      +/-   ##
==========================================
+ Coverage   87.75%   87.78%   +0.02%     
==========================================
  Files          72       72              
  Lines       10136    10148      +12     
  Branches     1339     1340       +1     
==========================================
+ Hits         8895     8908      +13     
  Misses       1216     1216              
+ Partials       25       24       -1     
Flag Coverage Δ
suite.unit 87.78% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@go-to-k go-to-k marked this pull request as draft December 7, 2025 05:12
@go-to-k go-to-k marked this pull request as ready for review December 7, 2025 05:35
@go-to-k go-to-k marked this pull request as draft December 7, 2025 07:02
tweak

tweak
@go-to-k go-to-k marked this pull request as ready for review December 7, 2025 13:00
@mrgrain mrgrain changed the title feat(cli): allow to parallelize asset build feat(cli): support for concurrent asset builds Mar 4, 2026
@mrgrain mrgrain changed the title feat(cli): support for concurrent asset builds feat(cli): concurrent asset builds Mar 4, 2026
@mrgrain mrgrain added this pull request to the merge queue Mar 4, 2026
Merged via the queue into aws:main with commit 3a415c7 Mar 4, 2026
51 of 52 checks passed
@go-to-k go-to-k deleted the asset-build-conc branch March 4, 2026 10:35
@xrn
Copy link
Copy Markdown

xrn commented Mar 5, 2026

@go-to-k one more time thank you for this PR but --asset-build-concurrency does not apply to ILocalBundling that can be missleading

TryBundle is called synchronously during synthesis inside the app process, before the CLI's work graph executes. Assets built locally via ILocalBundling are already resolved by the time --asset-build-concurrency takes effect. This means the flag only helps Docker-based bundling. Go/Rust CDK apps that use ILocalBundling (the recommended approach to avoid Docker overhead) cannot benefit from parallel asset builds. Could the framework defer local bundling to the work graph as well?

@go-to-k
Copy link
Copy Markdown
Contributor Author

go-to-k commented Mar 5, 2026

@xrn
You're right that --asset-build-concurrency only applies to Docker-based asset builds in the CLI's work graph, not to ILocalBundling.

Deferring local bundling to the work graph is a very appealing idea. However, ILocalBundling.tryBundle() is called synchronously during synthesis inside the CDK app process, which is a completely separate phase from the CLI's work graph execution. This would require changes on both the framework side (aws-cdk-lib) and the CLI side, which is a significant architectural change beyond the scope of this PR.

It might be worth opening a separate feature request issue for that so the maintainers can weigh in on the approach. In the meantime, a note in the documentation clarifying that this flag applies to Docker-based builds only could also help avoid confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: allow to parallelize asset build

4 participants