buildkite / buildkite-agent-scaler

📈A lambda for scaling an AutoScalingGroup based on Buildkite metrics
MIT License
61 stars 27 forks source link

Add support for autoscaling periods #80

Open scadu opened 1 year ago

scadu commented 1 year ago

Hi,

I'm looking for a way to set number of idle instances in specific hours. That would be an alternative what Jenkins provides with minimumNumberOfInstancesTimeRangeConfig, or GitLab CI with runners.machine.autoscaling.Periods.

The idea is to keep pipeline waiting time short when in busy hours, let's say 9AM-6PM Monday-Friday. The current setting of idle instances does not provide such flexibility, leaving n instances running all the time.

Is that something you consider implementing, or are open to pull requests?

triarius commented 1 year ago

Hi @scadu, thanks for using the buildkite-agent-scaler.

This looks like a great feature to have, and we will gladly review a PR to implement it. You can @ me here or in the PR to review it.

By the way, are you using this as part of the elastic-ci-stack-for-aws? If so, then we can arrange to include this in a release to that too.

scadu commented 1 year ago

Hi @triarius, yes, we use buildkite-agent-scaler together with elastic-ci-stack-for-aws, so that would be required as well. Do you think this request is related to https://github.com/buildkite/buildkite-agent-scaler/issues/41? At least scheduling with EventBridge sounds like one of ways to implement it. What do you think?

triarius commented 1 year ago

@scadu We just merged something that is very close to what you want. I think you should be able to build on top of it.

Event bridge integration is an excellent idea, but it seems like a significant redesign of this lambda, so will require a significant time investment to implement.

scadu commented 1 year ago

@triarius sorry for the late reply. I will look into the new feature and see how we could incorporate it to handle the use case requested in this issue. I will post an update here when I have anything substantial.