LPX-620: ECS web autoscaling + yolo scale command#64
Open
stevethomas wants to merge 2 commits into
Open
Conversation
Adds Application Auto Scaling for the web ECS service (target tracking) and a `yolo scale` command for out-of-band capacity changes. Phases 1-4 of LPX-620; Phase 5 (load-test tuning of the request-count target) is deferred. - Aws/ApplicationAutoScaling wrapper; ScalableTarget + ScalingPolicy reconcilers (QueueAlarm/Dashboard-style, dry-run honest) - sync:app SyncScalableTargetStep + SyncScalingPoliciesStep, gated on a tasks.web.autoscaling manifest block (inert without it) - yolo scale command mirroring env:push's compare->confirm UX, autoscaling-aware (desired count vs scalable-target min capacity) - CPU policy always on; ALBRequestCountPerTarget added once request-count-per-target is set - retired the dead EC2 AutoScalingClient + aws.autoscaling.combine - deployer IAM (application-autoscaling, cloudwatch alarms, scoped CreateServiceLinkedRole) gated on autoscaling being configured - scheduler safety via docs + a soft sync-time advisory (onOneServer recommended; service separation tracked in LPX-649) - docs: yolo scale + tasks.web.autoscaling reference, new Scaling guide Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploy never touches autoscaling — it rolls a task-def revision and calls UpdateService without desiredCount, so the scalable target and its policies are untouched and App Auto Scaling keeps owning capacity across the rollout. The scaling APIs are exercised only by `yolo sync` / `yolo scale`, which run with admin creds, not the GitHub Actions deployer role. Granting them here contradicted the policy's "exactly what deploy exercises" doctrine. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Hey, I made a thing! 🥳
Implements Phases 1–4 of LPX-620 — target-tracking autoscaling for the web ECS service plus a
yolo scalecommand. Phase 5 (seeding/tuning the request-count target from a load test) is intentionally deferred.What problems are you solving?
desired-countis create-only — leaving a real gap once traffic grows.What's in it
Aws/ApplicationAutoScalingwrapper +ScalableTarget/ScalingPolicyreconcilers — QueueAlarm/Dashboard-style standalone reconcilers (not theResourcecontract, since App Auto Scaling isn't RGT-taggable), dry-run honest (diff live state, only write on drift).sync:appstepsSyncScalableTargetStep+SyncScalingPoliciesStep, wired right afterSyncEcsServiceStepand gated on atasks.web.autoscalingblock — completely inert without it (today's single-task behaviour preserved).yolo scale <env> [count]— mirrorsenv:push'snote → table → confirm → 🐥 yoloUX. Autoscaling-aware: no scalable target → sets ECS desired count; target registered → raises the target's min capacity (a raw desired set is overridden on the next evaluation) and renders desired as— (autoscaling-managed).ECSServiceAverageCPUUtilization) is always on and needs no tuning;ALBRequestCountPerTargetis added only oncerequest-count-per-targetis set (the leading indicator — its target comes from a load test, Phase 5). Both predefined → no custom metrics, no scaling-role IAM.Aws\AutoScaling\AutoScalingClient(EC2 ASG) registration/accessor and theaws.autoscaling.combine/ServerGroupbranch.yolo deploynever touches autoscaling (it rolls a task-def revision + UpdateService without desiredCount; App Auto Scaling keeps owning capacity across the rollout). The scaling APIs are exercised only byyolo sync/yolo scale, which run with admin creds — so the deployer role needs nothing.->onOneServer(); separate the scheduler if needed). No Redis lock, no hard guard. Service separation is the follow-up, LPX-649.yolo scale+tasks.web.autoscalingreference, new Scaling guide (covers the metric choice, choosing the request-count target, and the scheduler caveat).Is there anything the reviewer needs to know to deploy this?
tasks.web.autoscalingmanifest block; no current manifest has one, so sync/deploy/scale behave exactly as today until someone opts in.desired-countstays create-only — autoscaling takes ownership of capacity only after a scalable target is registered; sync/deploy never fight it.yolo audit; teardown mustDeregisterScalableTarget.sync/scalewas run against a real account. First real run will be CL with atasks.web.autoscalingblock once Phase 5 has a load-test number forrequest-count-per-target. (Provisioning runs under admin/local creds, not CI.)🤖 Generated with Claude Code