Skip to content
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

ENGOPS-1634: Custom bk-agent-scaller that runs on funnel agent medium… #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Buildkite Agent Scaler

# Nestio ORG changes
Please refer to Notion documentation:
[Buildkite Agent Scaler Nestio](https://www.notion.so/funnelleasing/Buildkite-Agent-Scaler-Lambda-Function-Update-Version-1-9-0-11abeed2aafd8094b76df77632a69d68)

# Offiacial Readme
An AWS lambda function that handles the scaling of an
[Amazon Autoscaling Group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html)
(ASG) based on metrics provided by the Buildkite Agent Metrics API.
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import (
func main() {
var (
// aws params
asgName = flag.String("asg-name", "", "The name of the autoscaling group")
asgName = flag.String("asg-name", "ci-docker-medium-agent", "The name of the autoscaling group")
agentsPerInstance = flag.Int("agents-per-instance", 1, "The number of agents per instance")
cwMetrics = flag.Bool("cloudwatch-metrics", false, "Whether to publish cloudwatch metrics")
ssmTokenKey = flag.String("agent-token-ssm-key", "", "The AWS SSM Parameter Store key for the agent token")

// buildkite params
buildkiteQueue = flag.String("queue", "default", "The queue to watch in the metrics")
buildkiteQueue = flag.String("queue", "docker-medium", "The queue to watch in the metrics")
buildkiteAgentToken = flag.String("agent-token", "", "A buildkite agent registration token")
includeWaiting = flag.Bool("include-waiting", false, "Whether to include jobs behind a wait step for scaling")

Expand Down
2 changes: 2 additions & 0 deletions scaler/scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ func (s *Scaler) Run() (time.Duration, error) {
}

func (s *Scaler) scaleIn(desired int64, current AutoscaleGroupDetails) error {
s.scaleInParams.Disable = true
log.Print("Scale in disable is set to:", s.scaleInParams.Disable)
if s.scaleInParams.Disable {
return nil
}
Expand Down