Skip to content
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

feat(ecr-assets): Support docker outputs flag #23304

Merged
merged 19 commits into from
Jan 9, 2023

Conversation

jesse-peters
Copy link
Contributor

@jesse-peters jesse-peters commented Dec 9, 2022

This adds the --output flag as an option when building docker containers. This fixes #20566.


All Submissions:

Adding new Construct Runtime Dependencies:

  • This PR adds new construct runtime dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • 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

@gitpod-io
Copy link

gitpod-io bot commented Dec 9, 2022

@github-actions github-actions bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Dec 9, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team December 9, 2022 23:48
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

@github-actions github-actions bot added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. labels Dec 9, 2022
@jesse-peters
Copy link
Contributor Author

I think this should be ready for a review now? Happy to make any changes needed though!

@jesse-peters
Copy link
Contributor Author

Hi, this has been open for a few weeks (over the holidays I know) - I was just wondering if anyone might be able to provide feedback or help clear up the ci warning.

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@jesse-peters
Copy link
Contributor Author

Hello, is there anything I can do to make sure this PR doesnt get cleaned up by the bot as Im about to hit 4 weeks?
@aws-cdk-automation

@jesse-peters
Copy link
Contributor Author

Hey @mrgrain - sorry to bug you with a ping. I saw you've worked on some similar PRs on this repo, and I was hoping to get some feedback before the bot closes this PR. I'm sure you're pretty busy getting past the holidays, I just don't want to lose momentum here.

@mrgrain mrgrain self-assigned this Jan 3, 2023
@mrgrain
Copy link
Contributor

mrgrain commented Jan 3, 2023

All good @jesse-peters . I'm not back from annual leave yet, but assigned the PR to me. If it gets auto closed before I get to it, just reopen a new one and tag me .

@jesse-peters
Copy link
Contributor Author

Sounds great, thanks!

mrgrain
mrgrain previously requested changes Jan 4, 2023
Copy link
Contributor

@mrgrain mrgrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Just some very minor fixes. I also need to run the CLI tests then which might take a couple days for me to get to.


More generally speaking - would there be a way to detect if buildx is running and default the ouput to --output=type=docker in that case? Or maybe we really should have an image asset that explicitly uses buildx. 🤔

Comment on lines 84 to 87
/**
* Outputs
*
* @default - No outputs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's be a bit more descriptive here. It's also okay to link to the docker docs with @see

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jesse-peters Once you've update this doc block and re-generated the schema, the PR should be good to go.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrgrain I believe I pushed this last night?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I saw that. This is a different place that you've probably just missed. Unfortunately there's a lot of repetition with this. =/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, you're right! I just pushed an update.

packages/@aws-cdk/cx-api/lib/assets.ts Show resolved Hide resolved
…e-asset.ts

Co-authored-by: Momo Kornher <mail@moritzkornher.de>
@jesse-peters
Copy link
Contributor Author

I think if we were to default it to --output=type=docker that may be a breaking change to some folks who have had to engineer around it? I'm not certain though.

I think an image asset that's built for buildx would probably be the best in the long run. This flag exists on standard docker as well, but there are a number of new ones that are buildx specific.

@mrgrain
Copy link
Contributor

mrgrain commented Jan 6, 2023

I think an image asset that's built for buildx would probably be the best in the long run. This flag exists on standard docker as well, but there are a number of new ones that are buildx specific.

Interesting idea. I like it. It might require a lot of duplicated constructs and flags in various places. 🤔

@jesse-peters
Copy link
Contributor Author

Yea, there probably would be a fair bit of duplication between the two.

I think I hit the issues you pointed out on this PR. But I'll keep mulling over a new asset/how we might modify the current one to play nicer with buildx.

@mrgrain mrgrain added the pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested label Jan 6, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review January 6, 2023 17:34

✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.

@mergify mergify bot dismissed mrgrain’s stale review January 6, 2023 18:21

Pull request has been modified.

Copy link
Contributor

@mrgrain mrgrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@mergify
Copy link
Contributor

mergify bot commented Jan 9, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 5337a47
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 61e5495 into aws:main Jan 9, 2023
@mergify
Copy link
Contributor

mergify bot commented Jan 9, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@jesse-peters jesse-peters deleted the feat-docker-outputs-flag branch January 9, 2023 16:47
DerkSchooltink pushed a commit to DerkSchooltink/aws-cdk that referenced this pull request Jan 23, 2023
This adds the `--output` flag as an option when building docker containers. This fixes aws#20566.

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Construct Runtime Dependencies:

* [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] 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
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assets: allow passing --output flag to Docker build
3 participants