Skip to content

Keep gpu_4_queue at 10 minimum with demand scaling to 40 - #471

Draft
khluu wants to merge 3 commits into
mainfrom
codex/pin-gpu-4-queue-20
Draft

Keep gpu_4_queue at 10 minimum with demand scaling to 40#471
khluu wants to merge 3 commits into
mainfrom
codex/pin-gpu-4-queue-20

Conversation

@khluu

@khluu khluu commented Aug 13, 2026

Copy link
Copy Markdown
Member

What changed

  • keep gpu_4_queue at MinSize = 10 with MaxSize = 40
  • disable BuildkiteTerminateInstanceAfterJob so scarce g6.12xlarge capacity is retained between jobs
  • enable the standard Buildkite queue autoscaler by making the stack variable-sized
  • use a content-addressed copy of the exact Buildkite v6.21.0 template for this stack only; it removes forced blue/green ASG replacement and the fixed-size creation-signal wait

Behavior

  • ten instances are the protected baseline and desired capacity remains 10 without additional demand
  • the queue autoscaler polls Buildkite every minute and may increase desired capacity up to 40
  • automatic scale-in remains disabled for persistent agents, so reducing capacity above 10 is an explicit drain and scale-down operation

Why

AWS was returning InsufficientInstanceCapacity for g6.12xlarge across all four us-west-2 availability zones. Recycling each instance after one job lost capacity that could not reliably be reacquired. The upstream v6.21.0 template also forces a second ASG for parameter changes, which cannot converge while existing scarce capacity remains allocated.

The patched template keeps the existing physical ASG and prevents the baseline capacity from disappearing, while still allowing demand-based scale-out when more agents are needed.

Validation

  • terraform validate
  • git diff --check
  • CloudFormation change set reports AgentAutoScaleGroup as Modify with Replacement: False and MaxSize requiring no recreation
  • the only added resource is the standard Autoscaling nested stack
  • retained bk-gpu-4-queue-ci-AgentAutoScaleGroup-OEQAPNeflt32
  • CloudFormation reached UPDATE_COMPLETE with MinSize=10, MaxSize=40, and BuildkiteTerminateInstanceAfterJob=false
  • live ASG initially remained desired/in-service 10 with all ten instances protected from scale-in
  • autoscaler EventBridge rule is enabled at rate(1 minute) and its first polls capped desired capacity at the ten-instance minimum
  • targeted Terraform plan reports 0 to add, 1 to change, 0 to destroy; the remaining in-place change is the known template URL state drift

@khluu
khluu force-pushed the codex/pin-gpu-4-queue-20 branch from d74ea96 to ea90602 Compare August 13, 2026 22:42
@khluu khluu changed the title Pin gpu_4_queue at 20 persistent instances Pin gpu_4_queue at 40 persistent instances Aug 13, 2026
@khluu khluu changed the title Pin gpu_4_queue at 40 persistent instances Pin gpu_4_queue at 10 persistent instances Aug 14, 2026
@khluu khluu changed the title Pin gpu_4_queue at 10 persistent instances Keep gpu_4_queue at 10 minimum with demand scaling to 40 Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant