This repository was archived by the owner on Apr 14, 2023. It is now read-only.
Support worker autoscaling #8
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding autoscaling to ECS for the worker service requires a few changes
to how the cluster is redeployed. Previously, everything was stopped by
setting the desiredCount to 0 and then started back up by setting the
desiredCount to 1. With ECS controlling the scaling for the worker
service it's no longer possible to rely on the desiredCount of the
worker service remaining at 0 until things are ready to be started
again.
The change here sets the desiredCount of the scheduler to 0 first, then
does a --force-new-deployment for the web and worker services, then
finally does a --force-new-deployment for the scheduler. While
redeploying becomes more complicated, there's no need anymore to track
the current worker count. We can just set it to 1 and let ECS scale as
needed.
I've also added stop-scheduler and start-scheduler commands which can be
used in conjunction with deploying a new service definition with
Terraform.
How can a reviewer see these changes?
You can run:
$ pipenv run workflow redeployand verify that the command completes without blowing up.
Reviewer Checklist