Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Test Results✅ All tests passed! | 1016 tests in 152.327s |
|
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Summary
This PR adds an AWS ECS provider. Closes #116.
Sablier scales an ECS service between an idle desired count and an active desired count. The default values are 0 and 1. Sablier finds the services from their resource tags. The provider name is
ecs.Changes
pkg/provider/awsecs. The provider uses four ECS API calls:DescribeClusters,ListServices,DescribeServicesandUpdateService. TheAPIinterface holds these calls, and*ecs.Clientsatisfies it.NewcallsDescribeClustersone time. It stops with an error when the cluster does not exist or is notACTIVE.InstanceStartandInstanceStopset the desired count fromsablier.active.replicasandsablier.idle.replicas. When the service already has this count, the provider does not send the update.InstanceInspectuses the desired count, the running count, and the rollout state of the primary deployment. See the status table below. A service name or a full service ARN is accepted.InstanceListandInstanceGroupsread all pages of services in the cluster, and describe the services 10 at a time with their tags. They skip the services withoutsablier.enable=trueand theDAEMONservices.InstanceEventspolls the cluster every 10 seconds. It compares two snapshots and sends thecreated,updated,removed,startedandstoppedevents. After 5 failed polls in sequence, the stream stops with an error. The Proxmox LXC provider uses the same rule.provider.ecs.cluster(defaultdefault),provider.ecs.regionandprovider.ecs.endpoint. The credentials come from the default credential chain of the AWS SDK. The HTTP client of the AWS SDK usesotelhttpfor tracing.ecscolumn in the compatibility matrix, the provider notes in the label reference, the README, and the tracing page. The CLI reference, the label reference, the OpenAPI spec and the theme schema are regenerated.Integration test
TestECSProvider_Integrationruns the provider with the real*ecs.Clientagainst LocalStack in a container. It creates a cluster, a task definition that runssablierapp/mimic, and tagged services. Then it checks the missing cluster error, list, groups, inspect by ARN, start, stop, and thestartedandstoppedevents.LOCALSTACK_AUTH_TOKENis not set.Integration (ECS)workflow runs the test when theLOCALSTACK_AUTH_TOKENrepository secret exists. GitHub does not pass secrets to pull requests from forks, so for these the workflow shows a notice and does not run the test.Status mapping
stoppedFAILEDerror, with the rollout state reasonstartingIN_PROGRESSstartingreadyECS keeps the primary deployment
IN_PROGRESSuntil the new tasks pass their container health checks. Thus thereadystatus waits for the health check.Notes for review
REPLICAservices are managed. ADAEMONservice has no desired count. Standalone tasks are not managed, as agreed in the issue discussion.sablier.idle.cpu,sablier.idle.memory,sablier.active.cpuandsablier.active.memorytags and logs a warning.sablier.group,sablier.running-daysandsablier.anti-affinityuse a space between the values on ECS, for exampleteam-a team-b. The provider changes the spaces to commas before it parses the labels.InstanceListwithAllset to false returns the services with a desired count more than 0. The Kubernetes provider uses the same rule since fix(kubernetes): list only the running workloads when All is false #1112.2026.8.2. The testcontainers LocalStack module rejects the zero-padded tag2026.08.2, because that tag is not valid semver.Tests
TAGSfield, theMISSINGfailures and injected errors. The coverage ofpkg/provider/awsecsis 97.6%.LOCALSTACK_AUTH_TOKENsecret does not exist.go test -short ./...passes, exceptTestSetupTheme, which also fails onmainon Windows.go build ./...andgo vet ./...pass. gofmt reports no issue in the changed files. actionlint reports no issue in the new workflow.make check-generate.🤖 Generated with Claude Code