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

fix(ecs): Allow scheduling DAEMON services even if no EC2 capacity attached to cluster (#25306) #25328

Merged
merged 2 commits into from
May 3, 2023

Conversation

otterley
Copy link
Contributor

It can be useful to allow DAEMON services to be scheduled to a cluster even if there is no EC2 capacity attached to it yet, under the assumption that capacity will be attached to the cluster later. We no longer fail validation if this happens.

Fixes #25306


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 Apr 26, 2023

@github-actions github-actions bot added the valued-contributor [Pilot] contributed between 6-12 PRs to the CDK label Apr 26, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team April 26, 2023 23:58
@github-actions github-actions bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Apr 26, 2023
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.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@otterley otterley changed the title bug(ecs): Allow scheduling DAEMON services even if no EC2 capacity attached to cluster (#25306) fix(ecs): Allow scheduling DAEMON services even if no EC2 capacity attached to cluster (#25306) Apr 27, 2023
@otterley otterley force-pushed the fix-25306 branch 2 times, most recently from 483aabd to d55a338 Compare April 27, 2023 03:16
@otterley
Copy link
Contributor Author

Exemption Request - no integration test is needed here because this fix only addresses a compile-time validation issue. No changes to the rendered stack templates are made.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Apr 27, 2023
…tached to cluster (aws#25306)

It can be useful to allow DAEMON services to be scheduled to a cluster
even if there is no EC2 capacity attached to it yet, under the
assumption that capacity will be attached to the cluster later. We no
longer fail validation if this happens.
@@ -249,7 +249,7 @@ export class Ec2Service extends BaseService implements IEc2Service {
*/
private validateEc2Service(): string[] {
const ret = new Array<string>();
if (!this.cluster.hasEc2Capacity) {
if (!this.daemon && !this.cluster.hasEc2Capacity) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I see how this is any different from the closed issue that is related. The ask is to be able to add services to a cluster that don't have any capacity. Sounds like you are proposing that you found a loophole in the original issue because we never specifically mentioned daemon services 😁

I think what we need instead is a new way of managing capacity in clusters. You need capacity in a cluster so we don't want to remove that check, but we should have a way to tell the cluster that you have capacity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@corymhall I completely understand your point of view. As I said in #25306 (comment) - I don't necessarily believe we should fail validation for lack of capacity. I purposely kept this PR small in scope because I think it's more easily defensible, whereas the larger question still needs to be resolved.

Copy link
Contributor

Choose a reason for hiding this comment

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

@otterley I disagree with your comment. If we have reason to believe that a users configuration will fail once deployed we should fail synthesis.

The bottom line is that multiple CDK team members have said the type of change that we will support. This PR falls under the same use case.

@otterley
Copy link
Contributor Author

otterley commented May 3, 2023

@pahud are we good to merge?

@corymhall corymhall closed this May 3, 2023
@corymhall corymhall reopened this May 3, 2023
@corymhall corymhall added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label May 3, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review May 3, 2023 16:19

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

@mergify
Copy link
Contributor

mergify bot commented May 3, 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: 13afd19
  • 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 96bb8ce into aws:main May 3, 2023
@mergify
Copy link
Contributor

mergify bot commented May 3, 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. valued-contributor [Pilot] contributed between 6-12 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ecs: Don't error if cluster lacks EC2 capacity when adding an Ec2Service
3 participants