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(cli): add ability to configure hotswap properties for ECS #30511

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

atanaspam
Copy link

Issue #29618

Reason for this change

We aim to speed up deployment times in our development environment by using the hotswap feature. However, our services have dependencies on each other, and the current hotswap behavior is too disruptive.

Description of changes

We modified the hotswap implementation for ECS services to pass the minimumHealthyPercent and maximumHealthyPercent configurable parameters. These parameters are exposed to the cli and can be passed as --hotswap-ecs-minimum-healthy-percent <number> and --hotswap-ecs-maximum-healthy-percent <number>

The implementation is careful to maintain the existing behaviour. That is, if none of the new flags is used, the current minimumHealthyPercent = 0 and maximumHealthyPercent = undefined values are used.

Description of how you validated changes

We added a unit test validating that the correct values are passed to the task definition. We also executed using the locally built version of cdk validating that the behavior is as expected: the parameters are respected during hotswap deployments, and the existing API is maintained.

Checklist


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

@aws-cdk-automation aws-cdk-automation requested a review from a team June 10, 2024 16:21
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 labels Jun 10, 2024
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.

@aws-cdk-automation aws-cdk-automation added the pr/needs-cli-test-run This PR needs CLI tests run against it. label Jun 10, 2024
@atanaspam atanaspam changed the title feat: Add ability to configure hotswap properties for ECS feat: add ability to configure hotswap properties for ECS Jun 10, 2024
@atanaspam atanaspam marked this pull request as ready for review June 10, 2024 17:07
@atanaspam
Copy link
Author

Clarification Request

❌ Features must contain a change to an integration test file and the resulting snapshot.

I was able to execute the integration tests I added locally successfully, but there doesn't seem to be any snapshot changes for me to report.

@aws-cdk-automation aws-cdk-automation added pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Jun 10, 2024
@atanaspam atanaspam changed the title feat: add ability to configure hotswap properties for ECS feat(cli): add ability to configure hotswap properties for ECS Jun 11, 2024
Copy link
Contributor

@ahammond ahammond left a comment

Choose a reason for hiding this comment

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

This would have made it easier / more likely for us to stay on ECS instead of moving to EKS.

packages/aws-cdk/lib/cli.ts Outdated Show resolved Hide resolved
@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.

Co-authored-by: Andrew Hammond <445764+ahammond@users.noreply.github.com>
@aws-cdk-automation
Copy link
Collaborator

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

@aws-cdk-automation aws-cdk-automation added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label Jul 10, 2024
@atanaspam
Copy link
Author

Hey folks, can I have a review here please? I'd love to merge this soon as it has been hanging around for a while

Copy link
Contributor

@comcalvi comcalvi left a comment

Choose a reason for hiding this comment

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

Sorry for the delay on this one, this is a great change!

It's unfortunate that we chose to put the entire SDK call into the promises array, and not separated out the arguments...that would've prevented us from passing this thing throughout the entire code path, but it's fine as-is.

Minor comments only.

packages/aws-cdk/lib/cdk-toolkit.ts Outdated Show resolved Hide resolved
/**
* Represents configuration properties for hotswap deployments
*/
export class HotswapProperties {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export class HotswapProperties {
export class HotswapPropertyOverrides {

Copy link
Author

Choose a reason for hiding this comment

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

I have renamed the class and also all the variables as we propagate the properties throughout the code path to reflect the new name.

@comcalvi comcalvi added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Sep 26, 2024
comcalvi
comcalvi previously approved these changes Oct 3, 2024
@aws-cdk-automation
Copy link
Collaborator

➡️ PR build request submitted to test-main-pipeline ⬅️

A maintainer must now check the pipeline and add the pr-linter/cli-integ-tested label once the pipeline succeeds.

@kaizencc kaizencc added pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested and removed pr/needs-cli-test-run This PR needs CLI tests run against it. pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run labels Oct 3, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review October 3, 2024 19:00

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

Copy link
Contributor

mergify bot commented Oct 3, 2024

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).

@mergify mergify bot dismissed comcalvi’s stale review October 4, 2024 07:54

Pull request has been modified.

@atanaspam
Copy link
Author

@comcalvi @kaizencc I had to update the PR as mergify failed to merge this automatically due to what I assume is an incoming change.
https://github.com/aws/aws-cdk/pull/30511/checks?check_run_id=31046011303

Can you please review again?

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

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 p2 pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested pr-linter/do-not-close The PR linter will not close this PR while this label is present pr-linter/exempt-integ-test The PR linter will not require integ test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants