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

Support Canary for ECS without ELB or target groups #4690

Merged
merged 10 commits into from
Dec 1, 2023

Conversation

t-kikuc
Copy link
Member

@t-kikuc t-kikuc commented Nov 28, 2023

What this PR does / why we need it:

This is the simplest way to realize canary for ECS without target groups.

This PR supports the below stages (almost the same as the ELB case):

  • CanaryRollout
  • PrimaryRollout
  • CanaryClean
  • Rollback

NOTE: The TrafficRouting stage and Blue/Green Deployment are not supported due to ECS Service Discovery's constraints.

Which issue(s) this PR fixes:

Part of #4616
( or fixes )

Does this PR introduce a user-facing change?: no (new feature)

  • How are users affected by this change: no
  • Is this breaking change: no
  • How to migrate (if breaking change): no

@t-kikuc t-kikuc changed the title Support ECS canary deployment without target groups Support Canary for ECS without ELB or target groups Nov 28, 2023
Copy link

codecov bot commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e5d7b4b) 30.86% compared to head (584beef) 30.85%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4690      +/-   ##
==========================================
- Coverage   30.86%   30.85%   -0.02%     
==========================================
  Files         221      221              
  Lines       25975    25975              
==========================================
- Hits         8018     8014       -4     
- Misses      17307    17310       +3     
- Partials      650      651       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@t-kikuc
Copy link
Member Author

t-kikuc commented Nov 29, 2023

/review

Copy link
Contributor

PR Analysis

Main theme

type: Enhancement
description: Adds support for different access types (Load Balancer and Service Discovery) in the ECS deploy and rollback stages.

PR summary

This pull request introduces support for different access types (Load Balancer and Service Discovery) in the ECS deploy and rollback stages. It modifies the deploy.go and rollback.go files to handle the different access types and provide appropriate error messages when an unsupported access type is used.

Type of PR

Enhancement

PR Feedback:

General suggestions

The changes in this PR look good overall. The addition of support for different access types in the ECS deploy and rollback stages is a valuable enhancement. The code changes are clear and easy to understand.

Code feedback

pkg/app/piped/executor/ecs/deploy.go:13

This comment should be updated to reflect the new code changes. Instead of saying "Enables rolling out PRIMARY variant", it should say "Enables rolling out variants based on the specified access type".

pkg/app/piped/executor/ecs/deploy.go:32

The error message in this line should be updated to reflect the new code changes. Instead of saying "Unsupported access type ELB", it should say "Unsupported access type in stage for ECS application", where <accessType> is the value of e.appCfg.Input.AccessType and <stageName> is the name of the stage.

pkg/app/piped/executor/ecs/rollback.go:96

The comment in this line should be updated to reflect the new code changes. Instead of saying "Even if primary and canary target groups are not found, we can continue to rollback. So the accessType does not matter here.", it should say "Even if target groups are not found, we can continue to rollback. So the accessType does not matter here."

Documentation

There is no need to update the documentation for this PR.

Security concerns

No, this PR does not introduce any security concerns.

@t-kikuc
Copy link
Member Author

t-kikuc commented Nov 29, 2023

@khanhtc1202
Hi, I tested and it worked well.

Comment on lines 89 to 90
// Even if target groups are not found, we can continue to rollback.
// So the accessType does not matter here.
Copy link
Member

Choose a reason for hiding this comment

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

Should not mention unchanged thing here, let's not add confusing comments.

return model.StageStatus_STAGE_FAILURE
}

return model.StageStatus_STAGE_SUCCESS
}

func (e *deployExecutor) ensureTrafficRouting(ctx context.Context) model.StageStatus {
// Traffic Routing is not supported for ECS Service Discovery.
Copy link
Member

@khanhtc1202 khanhtc1202 Dec 1, 2023

Choose a reason for hiding this comment

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

Suggested change
// Traffic Routing is not supported for ECS Service Discovery.
// Traffic Routing is not supported for other kinds than ELB.

Comment on lines 89 to 90
// Even if target groups are not found, we can continue to rollback.
// So the accessType does not matter here.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Even if target groups are not found, we can continue to rollback.
// So the accessType does not matter here.

@t-kikuc
Copy link
Member Author

t-kikuc commented Dec 1, 2023

@khanhtc1202
Thank you for your comments, and I fixed them.

Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

great, thank you 🫡

@khanhtc1202 khanhtc1202 merged commit d12bf7d into master Dec 1, 2023
13 of 14 checks passed
@khanhtc1202 khanhtc1202 deleted the ecs-service-discovery-canary-simple branch December 1, 2023 12:34
sZma5a pushed a commit to sZma5a/pipecd that referenced this pull request Dec 17, 2023
* Support ECS CanaryRollout without TargetGroups

Signed-off-by: t-kikuc <[email protected]>

* Support ECS PrimaryRollout without TargetGroups

Signed-off-by: t-kikuc <[email protected]>

* Refuse ECS TrafficRouting stage for ServiceDiscovery

Signed-off-by: t-kikuc <[email protected]>

* Add a comment for ECS Rollback for ServiceDiscovery

Signed-off-by: t-kikuc <[email protected]>

* Add comments

Signed-off-by: t-kikuc <[email protected]>

* Removed unnecessary comments

Signed-off-by: t-kikuc <[email protected]>

---------

Signed-off-by: t-kikuc <[email protected]>
Co-authored-by: Khanh Tran <[email protected]>
sZma5a pushed a commit to sZma5a/pipecd that referenced this pull request Dec 17, 2023
* Support ECS CanaryRollout without TargetGroups

Signed-off-by: t-kikuc <[email protected]>

* Support ECS PrimaryRollout without TargetGroups

Signed-off-by: t-kikuc <[email protected]>

* Refuse ECS TrafficRouting stage for ServiceDiscovery

Signed-off-by: t-kikuc <[email protected]>

* Add a comment for ECS Rollback for ServiceDiscovery

Signed-off-by: t-kikuc <[email protected]>

* Add comments

Signed-off-by: t-kikuc <[email protected]>

* Removed unnecessary comments

Signed-off-by: t-kikuc <[email protected]>

---------

Signed-off-by: t-kikuc <[email protected]>
Co-authored-by: Khanh Tran <[email protected]>
sZma5a pushed a commit to sZma5a/pipecd that referenced this pull request Dec 17, 2023
* Support ECS CanaryRollout without TargetGroups

Signed-off-by: t-kikuc <[email protected]>

* Support ECS PrimaryRollout without TargetGroups

Signed-off-by: t-kikuc <[email protected]>

* Refuse ECS TrafficRouting stage for ServiceDiscovery

Signed-off-by: t-kikuc <[email protected]>

* Add a comment for ECS Rollback for ServiceDiscovery

Signed-off-by: t-kikuc <[email protected]>

* Add comments

Signed-off-by: t-kikuc <[email protected]>

* Removed unnecessary comments

Signed-off-by: t-kikuc <[email protected]>

---------

Signed-off-by: t-kikuc <[email protected]>
Co-authored-by: Khanh Tran <[email protected]>
Signed-off-by: sZma5a <[email protected]>
@github-actions github-actions bot mentioned this pull request Feb 6, 2024
sZma5a pushed a commit to sZma5a/pipecd that referenced this pull request Feb 12, 2024
* Support ECS CanaryRollout without TargetGroups

Signed-off-by: t-kikuc <[email protected]>

* Support ECS PrimaryRollout without TargetGroups

Signed-off-by: t-kikuc <[email protected]>

* Refuse ECS TrafficRouting stage for ServiceDiscovery

Signed-off-by: t-kikuc <[email protected]>

* Add a comment for ECS Rollback for ServiceDiscovery

Signed-off-by: t-kikuc <[email protected]>

* Add comments

Signed-off-by: t-kikuc <[email protected]>

* Removed unnecessary comments

Signed-off-by: t-kikuc <[email protected]>

---------

Signed-off-by: t-kikuc <[email protected]>
Co-authored-by: Khanh Tran <[email protected]>
Signed-off-by: 鈴木 優耀 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants