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(deploy): deploy workloads with entrypoint and command overrides #1999

Merged
merged 9 commits into from
Mar 3, 2021

Conversation

Lou1415926
Copy link
Contributor

@Lou1415926 Lou1415926 commented Mar 2, 2021

This PR deploys workloads given entrypoint and command overrides read from manifest.yml.

Preceding PR: #1998
Resolves #1950

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@efekarakus efekarakus added do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. and removed do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. labels Mar 2, 2021
mergify bot pushed a commit that referenced this pull request Mar 2, 2021
This PR implements the functionality to unify entrypoint and command, which can be either type string or type slice of strings, to type slice of strings. 

In CloudFormation template the fields "EntryPoint" and "Command" need to be of type list of strings ([see here](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-entrypoint)). Given inputs of `entrypoint` and `command` from `manifest.yml`, which can be type string or type slice of strings, unifying their data types to slice of strings makes it easier to execute the data into CloudFormation templates.

Usage of the function can be found [here in #1999](https://github.com/aws/copilot-cli/pull/1999/files#diff-ef96052956ce8fb054feb98cffccafb463a32941e692eb3164b89330fd9d9ab8).

Preceding PR: #1976 

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
@Lou1415926 Lou1415926 marked this pull request as ready for review March 2, 2021 20:18
@Lou1415926 Lou1415926 requested a review from a team as a code owner March 2, 2021 20:18
Copy link
Contributor

@iamhopaul123 iamhopaul123 left a comment

Choose a reason for hiding this comment

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

The code looks good to me! nit: do we need unit test for those two new fields?

@efekarakus efekarakus changed the title chore(deploy): deploy workloads with entrypoint and command overrides feat(deploy): deploy workloads with entrypoint and command overrides Mar 2, 2021
Copy link
Contributor

@efekarakus efekarakus left a comment

Choose a reason for hiding this comment

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

Looks good to me too! +1 to PH's comment maybe we can add EntryPoint and Command to TestTemplate_ParseLoadBalancedWebService in template_integration_test.go

templates/workloads/partials/cf/image-overrides.yml Outdated Show resolved Hide resolved
@Lou1415926
Copy link
Contributor Author

The code looks good to me! nit: do we need unit test for those two new fields?
@iamhopaul123

I saw that in your PR #1997 you modified the tests by having individual testLBWebServiceManifest for each unit test instead of a shared one.

I think in order to include entrypoint/command in the unit tests inside deploy/cfn/stack, I need to do the same thing. What do you think I include the tests after your PR gets merged?

@iamhopaul123
Copy link
Contributor

iamhopaul123 commented Mar 3, 2021

The code looks good to me! nit: do we need unit test for those two new fields?
@iamhopaul123

I saw that in your PR #1997 you modified the tests by having individual testLBWebServiceManifest for each unit test instead of a shared one.

I think in order to include entrypoint/command in the unit tests inside deploy/cfn/stack, I need to do the same thing. What do you think I include the tests after your PR gets merged?

Sounds good to me! Would you mind to review it?

Edit: Looks like it is about to be merged. But still feel free to leave any comment!

@@ -179,6 +179,7 @@ type WorkloadOpts struct {
Network *NetworkOpts
EntryPoint []string
Command []string
DomainAlias string
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this for 🤔 Oh nvm it's because of the commit

Copy link
Contributor

@iamhopaul123 iamhopaul123 left a comment

Choose a reason for hiding this comment

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

LGTM! Ship it 🚢

@mergify mergify bot merged commit 79b0e80 into aws:mainline Mar 3, 2021
Sprint 🏃‍♀️ automation moved this from In review to Pending release Mar 3, 2021
mergify bot pushed a commit that referenced this pull request Mar 4, 2021
This PR refactors the manifest setup in stack for backend svc tests.

In addition, it adds entrypoint/command fields for backend svc and scheduled job (as a follow up on #1999).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
mergify bot pushed a commit that referenced this pull request Mar 4, 2021
Adds docs on `entrypoint` and `command` fields in manifest files.

Preceding PR: #1999 

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
@efekarakus efekarakus mentioned this pull request Mar 8, 2021
thrau pushed a commit to localstack/copilot-cli-local that referenced this pull request Dec 9, 2022
This PR implements the functionality to unify entrypoint and command, which can be either type string or type slice of strings, to type slice of strings. 

In CloudFormation template the fields "EntryPoint" and "Command" need to be of type list of strings ([see here](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-entrypoint)). Given inputs of `entrypoint` and `command` from `manifest.yml`, which can be type string or type slice of strings, unifying their data types to slice of strings makes it easier to execute the data into CloudFormation templates.

Usage of the function can be found [here in aws#1999](https://github.com/aws/copilot-cli/pull/1999/files#diff-ef96052956ce8fb054feb98cffccafb463a32941e692eb3164b89330fd9d9ab8).

Preceding PR: aws#1976 

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
thrau pushed a commit to localstack/copilot-cli-local that referenced this pull request Dec 9, 2022
…ws#1999)

This PR deploys workloads given entrypoint and command overrides read from `manifest.yml`.

Preceding PR: aws#1998 
Resolves aws#1950 

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
thrau pushed a commit to localstack/copilot-cli-local that referenced this pull request Dec 9, 2022
This PR refactors the manifest setup in stack for backend svc tests.

In addition, it adds entrypoint/command fields for backend svc and scheduled job (as a follow up on aws#1999).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
thrau pushed a commit to localstack/copilot-cli-local that referenced this pull request Dec 9, 2022
Adds docs on `entrypoint` and `command` fields in manifest files.

Preceding PR: aws#1999 

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Sprint 🏃‍♀️
  
Pending release
Development

Successfully merging this pull request may close these issues.

support ENTRYPOINT override - allow the use of a single image for multiple workload types
3 participants