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(aws-ecs): add ECS/Fargate QueueWorkerService constructs #2568

Merged
merged 3 commits into from
May 23, 2019

Conversation

piradeepk
Copy link
Contributor

@piradeepk piradeepk commented May 16, 2019

Implement an ECS and Fargate Queue worker that creates an sqs queue and fixes Step Scaling implementation to add ScalingTargetId and default AdjustmentType

Fixes #2396


Pull Request Checklist

  • Testing
    • Unit test added (prefer not to modify an existing test, otherwise, it's probably a breaking change)
    • CLI change?: coordinate update of integration tests with team
    • cdk-init template change?: coordinated update of integration tests with team
  • Docs
    • jsdocs: All public APIs documented
    • README: README and/or documentation topic updated
    • Design: For significant features, design document added to design folder
  • Title and Description
    • Change type: title prefixed with fix, feat and module name in parens, which will appear in changelog
    • Title: use lower-case and doesn't end with a period
    • Breaking?: last paragraph: "BREAKING CHANGE: <describe what changed + link for details>"
    • Issues: Indicate issues fixed via: "Fixes #xxx" or "Closes #xxx"
  • Sensitive Modules (requires 2 PR approvers)
    • IAM Policy Document (in @aws-cdk/aws-iam)
    • EC2 Security Groups and ACLs (in @aws-cdk/aws-ec2)
    • Grant APIs (only if not based on official documentation with a reference)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.

@piradeepk piradeepk requested review from SoManyHs and a team as code owners May 16, 2019 18:07
packages/@aws-cdk/aws-ecs/lib/queue-worker-service-base.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-ecs/test/test.ecs-worker-service.ts Outdated Show resolved Hide resolved
design/aws-ecs-autoscaling-queue-worker.md Outdated Show resolved Hide resolved
design/aws-ecs-autoscaling-queue-worker.md Show resolved Hide resolved
packages/@aws-cdk/aws-ecs/lib/queue-worker-service-base.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-ecs/lib/queue-worker-service-base.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-ecs/lib/queue-worker-service-base.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-ecs/lib/queue-worker-service-base.ts Outdated Show resolved Hide resolved
@SoManyHs SoManyHs changed the title feat(aws-ecs): define the ecs/fargate queue worker service constructs feat(aws-ecs): add ECS/Fargate QueueWorkerService constructs May 17, 2019
@piradeepk
Copy link
Contributor Author

Addressed all PR comments, and updated revision.

design/aws-ecs-autoscaling-queue-worker.md Outdated Show resolved Hide resolved
memoryLimitMiB: props.memoryLimitMiB,
memoryReservationMiB: props.memoryReservationMiB,
cpu: props.cpu,
command: props.command !== undefined ? cdk.Fn.split(",", props.command) : undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

Really, split on comma? Doesn't seem idiomatic to have to pass "my,command,with,args".

Why not define command as command?: string[] and let the caller worry on how to make a list of strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was previously discussed: #2363 (comment), and @clareliguori had mentioned that the console currently supports comma delimited strings as command inputs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, I have to disagree with Clare there, sorry.

If there is structure to be had, I'd rather maintain it. I feel like the console decision to split on commas is because a list of input boxes are a more unfriendly UI than a single input box (for copy/pasting etc). We have no such problem though, everything is text.

If a user REALLY REALLY wants to split a comma-separated string, they can type:

"my,command,with,args".split(",")

themselves.

IOW, string[] leaves all options open, whereas an implicitly ,-split string precludes using commas in the command, for example.

I'm going to have to insist you change this back.

packages/@aws-cdk/aws-ecs/lib/queue-worker-service-base.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-ecs/lib/queue-worker-service-base.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-ecs/lib/queue-worker-service-base.ts Outdated Show resolved Hide resolved
@rix0rrr
Copy link
Contributor

rix0rrr commented May 21, 2019

Modulo the type of command: string[] and the build failures, I feel comfortable merging this.

piradeepk added 2 commits May 21, 2019 10:21
…ing implementation to add ScalingTargetId and default AdjustmentType
@piradeepk
Copy link
Contributor Author

piradeepk commented May 21, 2019

Update command to string[]. Rebasing again, to try to resolve these build issues.

@piradeepk
Copy link
Contributor Author

piradeepk commented May 22, 2019

Resolved build failures. @rix0rrr can you merge this in? I'll refactor this into the new module as a separate PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

L3 Construct for creating a ECS/Fargate Service that processes from SQS Queue
3 participants