-
Notifications
You must be signed in to change notification settings - Fork 396
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
Fargate Spot Support #2162
Comments
@SoManyHs which milestone or configuration options are you implementing in your fargate-spot branch? I'll try to take it for a ride tomorrow. Never mind, I found it in the diff, https://github.com/SoManyHs/copilot-cli/blob/cbaf6b694f6576de50c83d436a0463f4d81ed971/internal/pkg/manifest/svc_test.go#L59-L67 |
Update: We are reworking the design for using spot with autoscaling. Right now the milestone in progress is supporting 100% spot without autoscaling:
|
Update:Manifest design:There will be a new subfield # Count can either be an integer p , representing desiredCount, or a map
count:
# Optional. Value is an integer p, representing desiredCount.
# NOTE: Mutually exclusive with range.
spot: p
# Optional. Can either be a range of form "n-m", where n is the minCapacity and
# m is the maxCapacity, or a map.
# Default - none
range:
# Optional. Value is integer n that correponds to
# `minCapacity` on AutoScalingTarget.
min: n
# Optional. Value is integer m that correponds to
# `maxCapacity` on AutoScalingTarget.
max: m
# Optional. Value is integer q that corresponds to the desiredCount after which
# new copies of the service will be launched on spot.
spot_from: q 100% spot without autoscaling:count:
spot: n
# no autoscaling fields specified For this case, desiredCount on the service will be set to n, and a Capacity Provider Strategy using FARGATE_SPOT would be specified on the Service with weight of 1, with no base. If range is specified, there will be a validation error. 📤 Output parameters:
100% spot with autoscaling:count:
range:
min: n
max: m
spot_from: n // NOTE: must be the same as min value 📤 Output parameters: (See CDK example)
Scale into spot:count:
range:
min: n
max: m
spot_from: q 📤 Output parameters:
|
This adds a new field, `spot` to the manifest as a subfield of `count`. First step of #2162 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Range can now either be a range string or a map containing the subfields "min", "max" and "spot_from". This allows customers to use Application Autoscaling with spot capacity. Part of aws#2162
Range can now either be a range string or a map containing the subfields "min", "max" and "spot_from". This allows customers to use Application Autoscaling with spot capacity. Part of aws#2162
Range can now either be a range string or a map containing the subfields "min", "max" and "spot_from". This allows customers to use Application Autoscaling with spot capacity. Part of aws#2162
Final part of #2162 NOTE: the new `Capacity Provider` column is placed before the `Health Status` column due to weird spacing issues caused by colorizing the status field. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
This adds a new field, `spot` to the manifest as a subfield of `count`. First step of aws#2162 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Final part of aws#2162 NOTE: the new `Capacity Provider` column is placed before the `Health Status` column due to weird spacing issues caused by colorizing the status field. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Description
Since the launch of ECS Capacity Providers (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html), Copilot customers have been asking for support for using Fargate Spot in order to take advantage of the benefit of cost savings that spot provides. Capacity Providers are used to manage the infrastructure the tasks in your clusters use. With Fargate Spot, you can run interruption-tolerant ECS tasks at a discounted rate compared to the Fargate price.
This issue tracks the milestones for supporting Fargate Spot in the Copilot CLI.
User Stories
Current scope
Out of current scope
desiredCount
.desiredCount
. (Related: [ECS] : Capacity Strategy to Fall back to OD only When No More Spot Capacity Available containers-roadmap#773 and [service] [request]: Fargate Spot failover to Fargate containers-roadmap#852)desiredCount
, but not necessarily prioritize one or the other (i.e. specify some percentage on each type of capacity).Milestone 1
Use case: 100% spot
Manifest schema:
Introduce
spot
as subfield ofcount
. Its value can either be an integer n, for specifying a fixed desired count of services launched on spot capacity, or a boolean, to specify intent to use 100% spot with application autoscaling.Without autoscaling:
With autoscaling:
Milestone 2
Use Case: Burst into spot
Several potential options for the manifest:
Option 1
Specify
spot
as a percentage. The main benefit here is that it would easily extend into other percentages in the case of scaling on both spot and Fargate capacity.Option 2
Specify
dedicated
as an integer p that represents the maximum number of tasks you want to scale your services on dedicated Fargate instances. There can also be aspot
flag to explicitly indicate that any other scaled services will be placed on spot capacity.Option 3
Another possibility, outlined in this proof of concept using the CDK, has the
dedicated
field as range n-p that is a subset of the autoscaling range n-m. This option is similar to Option 2, but makes the range of thededicated
capacity explicit; however, it does mean thatn
has to match on both ranges.Option 4
One of the original proposals for this use case is described here: #1586 (comment). Here, both
dedicated
andspot
accept ranges,n-p
andp-m
. This syntax assumes that the autoscaling range isn-m
, andp
would have to be the inflection point specified in both ranges. It is also meant to imply that services would first be placed on dedicated instances before scaling into spot, and would make extensibility to other use cases trickier.Option 5
Have
spot
as a top-level field, not undercount
, with a percentage and a minimum:Part of #1154
Related: #1586
The text was updated successfully, but these errors were encountered: