Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Spike: How to Speed up CDK deployment? #194

Closed
3 tasks done
l0b0 opened this issue Jan 26, 2021 · 0 comments · Fixed by #579
Closed
3 tasks done

Spike: How to Speed up CDK deployment? #194

l0b0 opened this issue Jan 26, 2021 · 0 comments · Fixed by #579
Assignees
Labels
enabler story Enable to team to improve enhancement New feature or request spike

Comments

@l0b0
Copy link
Contributor

l0b0 commented Jan 26, 2021

Look into possibilities for speeding up the CDK deployment, which currently takes quite a long time. Options include:

  • Caching pip downloads (find some way to avoid "WARNING: The directory '/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag." when synthesizing)
  • Build a Lambda layer with botocore, the biggest package by far
  • 'New' synthesize method (didn't speed up things)

Non-options:

  • Contrary to AWS recommendations it looks like using the bundled boto3 might not be a good idea.
  • I tried using the Dockerfile for both the ECS container image for the batch jobs and for the Lambdas, but it seems they work very differently. For example, I can only pass a single argument as the CMD, and I don't think I can do that and also reuse code which is in the parent directory of the job code.
  • I tried the experimental aws_lambda_python.PythonFunction, but found two issues: the runtime is not respected and it generates requirements files which pip doesn't understand (which should've been fixed in the current version of Poetry, 1.1.6).
  • See if anything more can be excluded from cdk.out (ncdu cdk.out) - No, the vast majority of the space is taken up by the botocore package now.
  • Caching CDK outputs - CDK already does this by default
  • Making Docker builds reproducible, by checking that repeated builds of each step results in the same hash. Docker already does this. Also, most of the time-consuming builds are not within Docker.
@l0b0 l0b0 added enhancement New feature or request Epic This is a Zenhub label and can be ignored and removed Epic This is a Zenhub label and can be ignored labels Jan 27, 2021
@imincik imincik removed the Epic This is a Zenhub label and can be ignored label Jan 27, 2021
@billgeo billgeo added enabler story Enable to team to improve spike labels Mar 25, 2021
@l0b0 l0b0 self-assigned this Apr 14, 2021
@billgeo billgeo changed the title Speed up CDK deployment Spike: How to Speed up CDK deployment? Apr 15, 2021
@kodiakhq kodiakhq bot closed this as completed in #579 Apr 20, 2021
@billgeo billgeo reopened this Apr 21, 2021
@billgeo billgeo closed this as completed Apr 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enabler story Enable to team to improve enhancement New feature or request spike
Development

Successfully merging a pull request may close this issue.

3 participants