Skip to content

feat: add autoscaler runner instance ready command option #1190

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

Merged
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
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ locals {
runners_update_interval = var.runner_worker_docker_autoscaler.update_interval
runners_update_interval_when_expecting = var.runner_worker_docker_autoscaler.update_interval_when_expecting

runners_instance_ready_command = var.runner_worker_docker_autoscaler.instance_ready_command

runners_autoscaling = [for config in var.runner_worker_docker_autoscaler_autoscaling_options : {
for key, value in config :
# Convert key from snake_case to PascalCase which is the casing for this section.
Expand Down
2 changes: 2 additions & 0 deletions template/runner-docker-autoscaler-config.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
max_use_count = ${runners_max_use_count}
max_instances = ${runners_max_instances}

instance_ready_command="${runners_instance_ready_command}"

[runners.autoscaler.plugin_config] # plugin specific configuration (see plugin documentation)
name = "${docker_autoscaling_name}" # AWS Autoscaling Group name

Expand Down
2 changes: 2 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ variable "runner_worker_docker_autoscaler" {
max_use_count = Max job number that can run on a worker
update_interval = The interval to check with the fleeting plugin for instance updates.
update_interval_when_expecting = The interval to check with the fleeting plugin for instance updates when expecting a state change.
instance_ready_command = Executes this command on each instance provisioned by the autoscaler to ensure that it is ready for use. A failure results in the instance being removed.
EOT
type = object({
fleeting_plugin_version = optional(string, "1.0.0")
Expand All @@ -619,6 +620,7 @@ variable "runner_worker_docker_autoscaler" {
max_use_count = optional(number, 100)
update_interval = optional(string, "1m")
update_interval_when_expecting = optional(string, "2s")
instance_ready_command = optional(string, "")
})
default = {}
}
Expand Down