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

cdk-assets: publish assets in parallel #23657

Open
1 of 2 tasks
Hi-Fi opened this issue Jan 12, 2023 · 1 comment
Open
1 of 2 tasks

cdk-assets: publish assets in parallel #23657

Hi-Fi opened this issue Jan 12, 2023 · 1 comment
Labels
@aws-cdk/assets Related to the @aws-cdk/assets package @aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. p2

Comments

@Hi-Fi
Copy link
Contributor

Hi-Fi commented Jan 12, 2023

Describe the feature

Currently pipelines module uses cdk-assets CLI command to make the publishing of assets to needed accounts. Current approach works fine for Lambdas that go to S3 and for cases where single assets manifest contains only few assets.

There seems to be prop in publishing to publish assets in parallel, but that's not published through CLI.

Use Case

We're using pipelines module to deploy lambdas (both container and file based) to around 70 target accounts. With just file based lambda's FileAsset's build phase on single job takes around 38 seconds, but at same stage DockerAsset build phase takes around 9 minutes.

If there would be possibility to make image pushes in parallel, it would save quite a lot of our time.

Proposed Solution

It seems that

/**
* Whether to publish in parallel
*
* @default false
*/
readonly publishInParallel?: boolean;
has already possibility to parallelize the publishing, but option is not published within CLI at
export async function publish(args: {
path: string;
assets?: string[];
profile?: string;
}) {
.

Other Information

One possible issue that comes to mind is building, as if publishing is done on parallel (https://github.com/aws/aws-cdk/blob/main/packages/cdk-assets/lib/publishing.ts#L138), also build seems to be included to each one (https://github.com/aws/aws-cdk/blob/main/packages/cdk-assets/lib/publishing.ts#L163-L165). So maybe some refactoring for that part is needed to prevent multiple publishing for making same thing (building) that results same output.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.60.0

Environment details (OS name and version, etc.)

Linux b67dca3f6fa1 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 GNU/Linux

@Hi-Fi Hi-Fi added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jan 12, 2023
@github-actions github-actions bot added the @aws-cdk/assets Related to the @aws-cdk/assets package label Jan 12, 2023
@pahud pahud added p2 and removed needs-triage This issue or PR still needs to be triaged. labels Feb 16, 2023
@pahud
Copy link
Contributor

pahud commented Feb 16, 2023

Thank you! This seems to be an interesting idea. I will share with the team for more awareness. Any PR contribution would be appreciated.

@khushail khushail added the @aws-cdk/core Related to core CDK functionality label Jun 4, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
@aws-cdk/assets Related to the @aws-cdk/assets package @aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

3 participants