chore(ecs): describe job and generate run task request from job workload#2246
chore(ecs): describe job and generate run task request from job workload#2246mergify[bot] merged 20 commits intoaws:mainlinefrom
Conversation
| taskImageTagFlagDescription = `Optional. The container image tag in addition to "latest".` | ||
| taskImageTagFlagDescription = `Optional. The container image tag in addition to "latest".` | ||
| generateCommandFlagDescription = `Optional. Generate a command with a pre-filled value for each flag. | ||
| To use a non-Copilot ECS service, specify --generate-cmd <cluster name>/<service name>. |
There was a problem hiding this comment.
Q: we have fully surfaced the term "workload" to users at this point, right? If so, use "workload" here and in the next line instead of "service"?
There was a problem hiding this comment.
Good catch. I should update the flag description in this PR. I'd refrain from using the keyword workload because it doesn't appear anywhere formally in our doc site. I will just say "service or job".
The changes to flag.go in this PR is a result of #2201. I will rebase this branch to mainline once that one is merged.
The real changes in this PR are located at ecs/run_task_request.go and aws/stepfunctions.
| return nil, fmt.Errorf("generate task run command from service: %w", err) | ||
| } | ||
| default: | ||
| return nil, errors.New("invalid input to --generate-cmd: must be of the form <cluster>/<service> or <app>/<env>/<workload>") |
There was a problem hiding this comment.
same as above: "workload" instead of "service" for the non-Copilot part of the error message?
Proceeding PR: aws#2266 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
<!-- Provide summary of changes --> This PR is a continued work from aws#2225 by @efekarakus, and adds localized docs for Japanese language in our docs 🚀 Note that the localized docs are translated from the v1.6 Copilot docs - https://github.com/aws/copilot-cli/tree/v1.6.0/site, and are not from the mainline branch. <!-- Issue number, if available. E.g. "Fixes aws#31", "Addresses aws#42, 77" --> By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.11.0 to 1.12.0. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](onsi/gomega@v1.11.0...v1.12.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.30 to 1.38.36. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md) - [Commits](aws/aws-sdk-go@v1.38.30...v1.38.36) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
bvtujo
left a comment
There was a problem hiding this comment.
This is looking really good! Some nits about the custom unmarshaler for that deeply nested struct, however!
| taskImageTagFlagDescription = `Optional. The container image tag in addition to "latest".` | ||
| generateCommandFlagDescription = `Optional. Generate a command with a pre-filled value for each flag. | ||
| To use a non-Copilot ECS service, specify --generate-cmd <cluster name>/<service name>. | ||
| To use a Copilot service, specify --generate-cmd <application>/<environment>/<service>. |
There was a problem hiding this comment.
nit: can we update this language to include jobs?
There was a problem hiding this comment.
Will address in next PR!
|
|
||
| type NetworkConfiguration ecs.NetworkConfiguration | ||
|
|
||
| func (n *NetworkConfiguration) UnmarshalJSON(b []byte) error { |
There was a problem hiding this comment.
Can we edit this comment to make sure that it clarifies what kind of byte stream we expect? Because this unmarshaling logic is quite deeply nested we should be careful to clarify that this unmarshals just the network configuration from inside the DescribeStateMachineDefinition response.
| ecsClient ecsClient | ||
| rgGetter resourceGetter | ||
| ecsClient ecsClient | ||
| StepFuncClient stepFunctionsClient |
There was a problem hiding this comment.
Does this client need to be exported?
There was a problem hiding this comment.
They don't since they will be initialized by New(sess) so that the caller do not need to initialize these fields individually across package.
Although I think we could probably refactor this such that the clients are initialized from the caller (seems like a better approach to me) - in which case they will need to be exported.
…oad (aws#2246) This PR implement the function to generate a run task request from a deployed job, and the functions to support it. This PR is rebased from aws#2201 (which is not merged yet). The real changes to this PR are at - `ecs/run_task_request.go` (where the information needed to generated a `task run` command is grabbed from a Copilot job) - `ecs/run_task_request_test.go` - `aws/stepfunctions/*` (where the client to make API calls to stepfunctions is implemented) By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
This PR enables generating a task run command from a Copilot job. Manually tested. Preceding PR: #2246 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
…oad (aws#2246) This PR implement the function to generate a run task request from a deployed job, and the functions to support it. This PR is rebased from aws#2201 (which is not merged yet). The real changes to this PR are at - `ecs/run_task_request.go` (where the information needed to generated a `task run` command is grabbed from a Copilot job) - `ecs/run_task_request_test.go` - `aws/stepfunctions/*` (where the client to make API calls to stepfunctions is implemented) By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
This PR enables generating a task run command from a Copilot job. Manually tested. Preceding PR: aws#2246 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
This PR implement the function to generate a run task request from a deployed job, and the functions to support it.
This PR is rebased from #2201 (which is not merged yet). The real changes to this PR are at
ecs/run_task_request.go(where the information needed to generated atask runcommand is grabbed from a Copilot job)ecs/run_task_request_test.goaws/stepfunctions/*(where the client to make API calls to stepfunctions is implemented)By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.