aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.61k stars 3.9k forks source link

Publish public Docker image containing the CDK CLI #1302

Open clareliguori opened 5 years ago

clareliguori commented 5 years ago

Some of the newer CI/CD tools out there (Bitbucket Pipelines, GitHub Actions) use Docker images as the environment for each step of the pipeline. Packaging the CDK CLI as a public Docker image would be a convenient way to integrate releasing CDK-based apps into these types of CI/CD tools.

moofish32 commented 5 years ago

@clareliguori -- what would you think about also publishing a lambda layers artifact? I've hacked some examples together, but lambda enables a much faster execution and integration with step functions. Yes we could do this with ECS and Fargate now, but that execution was taking about 60 seconds in us-west-2 when I tested a very basic invocation. Lambda is significantly quicker.

clareliguori commented 5 years ago

@moofish32 I haven't seen many examples of off-the-shelf or managed CI/CD tools built on functions, so I'd personally probably prioritize container image over Lambda layer (but I'll defer to the CDK team on priority calls). Sounds like you might be rolling your own with Step Functions? Neat!

clareliguori commented 5 years ago

I don't think this is resolved. The ask here is for a public Docker image, for example published into the amazon DockerHub namespace. Also, the current Dockerfile is not suitable for publishing publicly: it's multiple GBs with cruft like devDependencies and the .git folder, whereas the GitHub release archives are < 200 MB.

ScottBrenner commented 5 years ago

Kind of related -

I made a GitHub Action for the CDK https://github.com/ScottBrenner/aws-cdk-action .. then I realized that for people to be able to use it, it needs to have all the CDK packages/dependencies installed in it, like @aws-cdk/aws-s3 etc .. and maybe even compile the code too ..

Guess it's not feasible? :sob:

cristianrat commented 5 years ago

@ScottBrenner Very easy to build your own. I've done just that with only the packages I need. There are also a couple people who made them public on docker hub.

stefanx-amazon commented 2 years ago

While I agree that this is easy to build for anybody, wouldn't it be desirable to have an official CDK Docker image available on Docker Hub and also e.g. https://gallery.ecr.aws/aws-cdk/aws-cdk that all CDK users can use and rely on rather than everybody building their own CDK Docker images? If that existed, we could also update e.g. the documentation for CDK Pipelines to use the official CDK Docker image rather than including npm install -g cdk, which would speed up pipelines of users that don't bother creating their own CDK Docker image quite a bit.

github-actions[bot] commented 1 year ago

This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue.

gliptak commented 1 year ago

Published my Python construct image at https://github.com/gliptak/aws-cdk-python

14821

RajasGujarathi commented 1 year ago

This is the need of the hour. An official docker image will be beneficial with CI/CD tools like GitLab and others mentioned above.