Skip to content

Commit ed9989c

Browse files
PirminTapkenVolker Gropp
and
Volker Gropp
authoredDec 3, 2021
feat: Make check interval configurable for the runner (#402)
* Make check interval configurable for the runner in order to reduce load on gitlab API * fix formatting * default to 3 seconds to align with documentation Co-authored-by: Volker Gropp <[email protected]>
1 parent 3ea16b0 commit ed9989c

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed
 

‎.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.52.0
3+
rev: v1.55.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_tflint

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ terraform destroy
387387
| <a name="input_runner_root_block_device"></a> [runner\_root\_block\_device](#input\_runner\_root\_block\_device) | The EC2 instance root block device configuration. Takes the following keys: `device_name`, `delete_on_termination`, `volume_type`, `volume_size`, `encrypted`, `iops`, `throughput`, `kms_key_id` | `map(string)` | `{}` | no |
388388
| <a name="input_runner_tags"></a> [runner\_tags](#input\_runner\_tags) | Map of tags that will be added to runner EC2 instances. | `map(string)` | `{}` | no |
389389
| <a name="input_runners_additional_volumes"></a> [runners\_additional\_volumes](#input\_runners\_additional\_volumes) | Additional volumes that will be used in the runner config.toml, e.g Docker socket | `list(any)` | `[]` | no |
390+
| <a name="input_runners_check_interval"></a> [runners\_check\_interval](#input\_runners\_check\_interval) | defines the interval length, in seconds, between new jobs check. | `number` | `0` | no |
390391
| <a name="input_runners_concurrent"></a> [runners\_concurrent](#input\_runners\_concurrent) | Concurrent value for the runners, will be used in the runner config.toml. | `number` | `10` | no |
391392
| <a name="input_runners_disable_cache"></a> [runners\_disable\_cache](#input\_runners\_disable\_cache) | Runners will not use local cache, will be used in the runner config.toml | `bool` | `false` | no |
392393
| <a name="input_runners_add_dind_volumes"></a> [runners\_add\_dind\_volumes](#input\_runners\_add\_dind\_volumes) | Add certificates and docker.sock to the volumes to support docker-in-docker (dind) | `bool` | `false` | no |

‎main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ locals {
148148
runners_pre_clone_script = var.runners_pre_clone_script
149149
runners_request_concurrency = var.runners_request_concurrency
150150
runners_output_limit = var.runners_output_limit
151+
runners_check_interval = var.runners_check_interval
151152
runners_volumes_tmpfs = join(",", [for v in var.runners_volumes_tmpfs : format("\"%s\" = \"%s\"", v.volume, v.options)])
152153
runners_services_volumes_tmpfs = join(",", [for v in var.runners_services_volumes_tmpfs : format("\"%s\" = \"%s\"", v.volume, v.options)])
153154
bucket_name = local.bucket_name

‎template/runner-config.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
concurrent = ${runners_concurrent}
2-
check_interval = 0
2+
check_interval = ${runners_check_interval}
33
sentry_dsn = "${sentry_dsn}"
44

55
[[runners]]

‎variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ variable "runners_request_spot_instance" {
314314
default = true
315315
}
316316

317+
variable "runners_check_interval" {
318+
description = "defines the interval length, in seconds, between new jobs check."
319+
type = number
320+
default = 3
321+
}
322+
317323
variable "cache_bucket_prefix" {
318324
description = "Prefix for s3 cache bucket name."
319325
type = string

0 commit comments

Comments
 (0)