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

[WIP] Support for canary releases with EXTERNAL deployments #231

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3c29320
tag only: applying to main image only (first one)
jfranzoi Apr 5, 2021
8ed1af7
updated image to 3.10.1
jfranzoi Apr 5, 2021
3a78fe8
describe services, uniformed command line (to support testing & troub…
jfranzoi Apr 6, 2021
6aead56
tag only: updated README and help message, with better explanation
jfranzoi Apr 6, 2021
9074556
README, better arguments format
jfranzoi Apr 6, 2021
d4a5360
README, parameters to arguments
jfranzoi Apr 6, 2021
7190072
help, parameters to arguments
jfranzoi Apr 6, 2021
a7210be
Merge branch 'tag-only_on-first-image-only' of https://github.com/jfr…
jfranzoi Apr 6, 2021
98d485e
Deployment controller: skip on non-ECS
jfranzoi Apr 11, 2021
64888cc
Deployment controller: isolated service-related code
jfranzoi Apr 11, 2021
8f1e694
Deployment controller: skip on unsupported EXTERNAL and CODE_DEPLOY
jfranzoi Apr 11, 2021
69c6728
Deployment controller: isolated service-related code -- even rollback
jfranzoi Apr 11, 2021
a8dacb4
Deployment controller: EXTERNAL, supporting force new deployment
jfranzoi Apr 11, 2021
a550471
Deployment controller: EXTERNAL, refactored force new deployment
jfranzoi Apr 13, 2021
a100317
Deployment controller: EXTERNAL, force new deployment within timeout,…
jfranzoi Apr 13, 2021
9faf501
Deployment controller: ECS, dots while waiting for service update or …
jfranzoi Apr 14, 2021
f8674b6
Deployment controller: EXTERNAL, refactored bash command execution
jfranzoi Apr 14, 2021
e37089a
Deployment controller: ECS, dots while waiting for service update or …
jfranzoi Apr 14, 2021
af7ac47
Deployment controller: EXTERNAL, update service with canary + stable
jfranzoi Apr 21, 2021
0feaed3
Deployment controller: EXTERNAL, update service with canary + stable …
jfranzoi Apr 21, 2021
6377e13
Deployment controller: EXTERNAL, external id with timestamps
jfranzoi Apr 22, 2021
a669291
Deployment controller: EXTERNAL, refactored update service
jfranzoi Apr 24, 2021
9efb42d
Deployment controller: EXTERNAL, introducing rollout strategies, inte…
jfranzoi Apr 24, 2021
bc42b21
Deployment controller: EXTERNAL, refactored active to primary task sets
jfranzoi Apr 24, 2021
7fce4d0
Deployment controller: EXTERNAL, refactored create task set
jfranzoi Apr 25, 2021
5574bbd
Deployment controller: EXTERNAL, extracted deployment modifiers for l…
jfranzoi Apr 25, 2021
afc7a76
Deployment controller: EXTERNAL, simplified canary deployment creatio…
jfranzoi Apr 26, 2021
7f1abff
Deployment controller: EXTERNAL, simpler deployment status
jfranzoi Apr 26, 2021
e992273
canary releases: added size and strategies as arguments; added wait t…
jfranzoi Apr 26, 2021
22be48d
canary releases: added proceed confirmation strategy
jfranzoi Apr 26, 2021
6fdbe41
Deployment controller: EXTERNAL, refactored force new deployment
jfranzoi Apr 26, 2021
c93587c
Deployment controller: EXTERNAL, optional task set file
jfranzoi Apr 28, 2021
c3dcafb
Deployment controller: EXTERNAL, canary confirmation as custom script
jfranzoi Apr 28, 2021
eb55b22
Deployment controller: EXTERNAL, canary confirmation as custom script…
jfranzoi Apr 28, 2021
c6d8934
Deployment controller: EXTERNAL, support for creating original PRIMAR…
jfranzoi Apr 28, 2021
2932c50
Deployment controller: EXTERNAL, task-set file with taskSet root node
jfranzoi-gucci Jan 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apk --no-cache add ca-certificates curl bash jq py3-pip && \
COPY ecs-deploy /ecs-deploy
RUN chmod a+x /ecs-deploy

COPY test.bats /test.bats
COPY test /test
COPY run-tests.sh /run-tests.sh
RUN chmod a+x /run-tests.sh

Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Usage
-M | --max maximumPercent: The upper limit on the number of running tasks during a deployment. (default: 200)
-t | --timeout Default is 90s. Script monitors ECS Service for new task definition to be running.
-e | --tag-env-var Get image tag name from environment variable. If provided this will override value specified in image name argument.
-to | --tag-only New tag to apply to all images defined in the task (multi-container task). If provided this will override value specified in image name argument.
-to | --tag-only New tag to apply to 'main' image (first one) defined in the task (multi-container task). If provided this will override value specified in image name argument.
--max-definitions Number of Task Definition Revisions to persist before deregistering oldest revisions.
Note: This number must be 1 or higher (i.e. keep only the current revision ACTIVE).
Max definitions causes all task revisions not matching criteria to be deregistered, even if they're created manually.
Expand All @@ -46,10 +46,14 @@ Usage
--wait-for-success Wait for task execution to complete and to receive the exitCode 0.
--launch-type The launch type on which to run your task. (https://docs.aws.amazon.com/cli/latest/reference/ecs/run-task.html)
--platform-version The Fargate platform version on which to run your task. (https://docs.aws.amazon.com/cli/latest/reference/ecs/run-task.html)
--network-configuration The network configuration for the task. This parameter is required for task definitions that use
--network-configuration The network configuration for the task. This argument is required for task definitions that use
the awsvpc network mode to receive their own elastic network interface, and it is not supported
for other network modes. (https://docs.aws.amazon.com/cli/latest/reference/ecs/run-task.html)
--copy-task-definition-tags Copy the existing task definition tags to the new task definition revision
--task-set-file (EXTERNAL deployment only) File used as task set to deploy.
--canary-percent (EXTERNAL deployment only) Size for canary deployment (default: 25).
--canary-confirmation (EXTERNAL deployment only) Strategy for confirming deployment from canary to stable.
Supported: interactive wait_timeout proceed, or path to any existing script. (default: interactive).
-v | --verbose Verbose output
--version Display the version

Expand All @@ -74,7 +78,7 @@ Usage

ecs-deploy -p PROFILE -c production1 -n doorman-service -i docker.repo.com/doorman -t 240 -e CI_TIMESTAMP -v

Update just the tag on whatever image is found in ECS Task (supports multi-container tasks):
Update just the tag on 'main' image (first one) found in ECS Task (supports multi-container tasks):

ecs-deploy -c staging -n core-service -to 0.1.899 -i ignore

Expand Down Expand Up @@ -105,7 +109,7 @@ The Task Definition then acts a sort of template for actually running the contai
containers is known as a Task. Due to the way docker implements networking, generally you can only run one Task per Task
Definition per Container Instance (the virtual machines providing the cluster infrastructure).

Task Definitions are automatically version controlled---the actual name of a Task Definition is composed of two parts, the
Task Definitions are automatically version controlled. The actual name of a Task Definition is composed of two parts, the
Family name, and a version number, like so: `phpMyAdmin:3`

Since a Task is supposed to be a fully self-contained "worker unit" of a broader application, Amazon uses another configuration
Expand Down Expand Up @@ -135,13 +139,14 @@ but identical version of a Task Definition, and the Service will still do a blue

Nevertheless, since the system uses docker, the assumption is that improvements to the application are built into
its container images, which are then pushed into a repository (public or private), to then be pulled down for use by ECS. This
script therefore uses the specified `image` parameter as a modification key to change the tag used by a container's image. It
looks for images with the same repository name as the specified parameter, and updates its tag to the one in the specified
parameter.
script therefore uses the specified `--image` argument as a modification key to change the tag used by a container's image. It
looks for images with the same repository name as the specified argument, and updates its tag to the one in the specified
argument.

_A direct consequence of this is that if you define more than one container in your Task Definition to use the same image, all
of them will be updated to the specified tag, even if you set them to use different tags initially. But this is considered to
be an unlikely use case._
be an unlikely use case. This is not the case when using `--tag-only` argument instead of `--image` argument, since the only
updated image would be the one on the 'main' container only, the first one._

This behavior allows two possible process to specify which images, and therefore which configurations, to deploy. First, you
may set the tag to always be `latest` (or some other static value), like so:
Expand Down
Loading