diff --git a/README.md b/README.md index c5a6eb058..f7580d6d2 100644 --- a/README.md +++ b/README.md @@ -218,7 +218,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file | [runner\_terminate\_ec2\_lifecycle\_timeout\_duration](#input\_runner\_terminate\_ec2\_lifecycle\_timeout\_duration) | Amount of time in seconds to wait for GitLab Runner to finish picked up jobs. Defaults to the `maximum_timeout` configured + `5m`. Maximum allowed is `7200` (2 hours) | `number` | `null` | no | | [runner\_terminate\_ec2\_timeout\_duration](#input\_runner\_terminate\_ec2\_timeout\_duration) | Timeout in seconds for the graceful terminate worker Lambda function. | `number` | `90` | no | | [runner\_terraform\_timeout\_delete\_asg](#input\_runner\_terraform\_timeout\_delete\_asg) | Timeout when trying to delete the Runner ASG. | `string` | `"10m"` | no | -| [runner\_worker](#input\_runner\_worker) | For detailed information, check https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runners-section.

environment\_variables = List of environment variables to add to the Runner Worker (environment).
max\_jobs = Number of jobs which can be processed in parallel by the Runner Worker.
output\_limit = Sets the maximum build log size in kilobytes. Default is 4MB (output\_limit).
request\_concurrency = Limit number of concurrent requests for new jobs from GitLab (default 1) (request\_concurrency).
ssm\_access = Allows to connect to the Runner Worker via SSM.
type = The Runner Worker type to use. Currently supports `docker+machine` or `docker` or `docker-autoscaler`.
use\_private\_key = Use a private key to connect the Runner Manager to the Runner Workers. Ignored when fleeting is enabled (defaults to `true`). |
object({
environment_variables = optional(list(string), [])
max_jobs = optional(number, 0)
output_limit = optional(number, 4096)
request_concurrency = optional(number, 1)
ssm_access = optional(bool, false)
type = optional(string, "docker+machine")
# false positive, use_private_key is not a secret
# kics-scan ignore-line
use_private_key = optional(bool, false)
})
| `{}` | no | +| [runner\_worker](#input\_runner\_worker) | For detailed information, check https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runners-section.

environment\_variables = List of environment variables to add to the Runner Worker (environment).
max\_jobs = Number of jobs which can be processed in parallel by the Runner Worker.
output\_limit = Sets the maximum build log size in kilobytes. Default is 4MB (output\_limit).
request\_concurrency = Limit number of concurrent requests for new jobs from GitLab (default 1) (request\_concurrency).
strict\_check\_interval = Enforces the `check_interval` instead of immediately re-polling after receiving jobs.
ssm\_access = Allows to connect to the Runner Worker via SSM.
type = The Runner Worker type to use. Currently supports `docker+machine` or `docker` or `docker-autoscaler`.
use\_private\_key = Use a private key to connect the Runner Manager to the Runner Workers. Ignored when fleeting is enabled (defaults to `true`). |
object({
environment_variables = optional(list(string), [])
max_jobs = optional(number, 0)
output_limit = optional(number, 4096)
request_concurrency = optional(number, 1)
strict_check_interval = optional(bool, false)
ssm_access = optional(bool, false)
type = optional(string, "docker+machine")
# false positive, use_private_key is not a secret
# kics-scan ignore-line
use_private_key = optional(bool, false)
})
| `{}` | no | | [runner\_worker\_cache](#input\_runner\_worker\_cache) | Configuration to control the creation of the cache bucket. By default the bucket will be created and used as shared
cache. To use the same cache across multiple Runner Worker disable the creation of the cache and provide a policy and
bucket name. See the public runner example for more details."

For detailed documentation check https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnerscaches3-section.

access\_log\_bucker\_id = The ID of the bucket where the access logs are stored.
access\_log\_bucket\_prefix = The bucket prefix for the access logs.
authentication\_type = A string that declares the AuthenticationType for [runners.cache.s3]. Can either be 'iam' or 'credentials'.
bucket = Name of the cache bucket. Requires `create = false`.
bucket\_prefix = Prefix for s3 cache bucket name. Requires `create = true`.
create = Boolean used to enable or disable the creation of the cache bucket.
create\_aws\_s3\_bucket\_public\_access\_block = Boolean used to enable or disable the creation of the public access block for the cache bucket. Useful when organizations do not allow the creation of public access blocks on individual buckets (e.g. public access is blocked on all buckets at the organization level).
expiration\_days = Number of days before cache objects expire. Requires `create = true`.
include\_account\_id = Boolean used to include the account id in the cache bucket name. Requires `create = true`.
policy = Policy to use for the cache bucket. Requires `create = false`.
random\_suffix = Boolean used to enable or disable the use of a random string suffix on the cache bucket name. Requires `create = true`.
shared = Boolean used to enable or disable the use of the cache bucket as shared cache.
versioning = Boolean used to enable versioning on the cache bucket. Requires `create = true`. |
object({
access_log_bucket_id = optional(string, null)
access_log_bucket_prefix = optional(string, null)
authentication_type = optional(string, "iam")
bucket = optional(string, "")
bucket_prefix = optional(string, "")
create = optional(bool, true)
create_aws_s3_bucket_public_access_block = optional(bool, true)
expiration_days = optional(number, 1)
include_account_id = optional(bool, true)
policy = optional(string, "")
random_suffix = optional(bool, false)
shared = optional(bool, false)
versioning = optional(bool, false)
})
| `{}` | no | | [runner\_worker\_docker\_add\_dind\_volumes](#input\_runner\_worker\_docker\_add\_dind\_volumes) | Add certificates and docker.sock to the volumes to support docker-in-docker (dind) | `bool` | `false` | no | | [runner\_worker\_docker\_autoscaler](#input\_runner\_worker\_docker\_autoscaler) | fleeting\_plugin\_version = The version of aws fleeting plugin.
connector\_config\_user = User to connect to worker machine.
key\_pair\_name = The name of the key pair used by the Runner to connect to the docker-machine Runner Workers. This variable is only supported when `enables` is set to `true`.
capacity\_per\_instance = The number of jobs that can be executed concurrently by a single instance.
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. |
object({
fleeting_plugin_version = optional(string, "1.0.0")
connector_config_user = optional(string, "ec2-user")
key_pair_name = optional(string, "runner-worker-key")
capacity_per_instance = optional(number, 1)
max_use_count = optional(number, 100)
update_interval = optional(string, "1m")
update_interval_when_expecting = optional(string, "2s")
instance_ready_command = optional(string, "")
})
| `{}` | no | diff --git a/main.tf b/main.tf index 9696c4538..48cb774ee 100644 --- a/main.tf +++ b/main.tf @@ -140,6 +140,7 @@ locals { runners_post_build_script = var.runner_worker_gitlab_pipeline.post_build_script runners_pre_clone_script = var.runner_worker_gitlab_pipeline.pre_clone_script runners_request_concurrency = var.runner_worker.request_concurrency + runners_strict_check_interval = var.runner_worker.strict_check_interval runners_output_limit = var.runner_worker.output_limit runners_check_interval = var.runner_manager.gitlab_check_interval runners_volumes_tmpfs = join("\n", [for v in var.runner_worker_docker_volumes_tmpfs : format("\"%s\" = \"%s\"", v.volume, v.options)]) diff --git a/template/runner-config.tftpl b/template/runner-config.tftpl index 50e897524..1585191f1 100644 --- a/template/runner-config.tftpl +++ b/template/runner-config.tftpl @@ -19,6 +19,7 @@ connection_max_age = "${connection_max_age}" pre_clone_script = ${runners_pre_clone_script} pre_get_sources_script = ${runners_pre_clone_script} request_concurrency = ${runners_request_concurrency} + strict_check_interval = ${runners_strict_check_interval} output_limit = ${runners_output_limit} limit = ${runners_limit} diff --git a/variables.tf b/variables.tf index b1c845706..8f4ef482e 100644 --- a/variables.tf +++ b/variables.tf @@ -534,6 +534,7 @@ variable "runner_worker" { max_jobs = Number of jobs which can be processed in parallel by the Runner Worker. output_limit = Sets the maximum build log size in kilobytes. Default is 4MB (output_limit). request_concurrency = Limit number of concurrent requests for new jobs from GitLab (default 1) (request_concurrency). + strict_check_interval = Enforces the `check_interval` instead of immediately re-polling after receiving jobs. ssm_access = Allows to connect to the Runner Worker via SSM. type = The Runner Worker type to use. Currently supports `docker+machine` or `docker` or `docker-autoscaler`. use_private_key = Use a private key to connect the Runner Manager to the Runner Workers. Ignored when fleeting is enabled (defaults to `true`). @@ -543,6 +544,7 @@ variable "runner_worker" { max_jobs = optional(number, 0) output_limit = optional(number, 4096) request_concurrency = optional(number, 1) + strict_check_interval = optional(bool, false) ssm_access = optional(bool, false) type = optional(string, "docker+machine") # false positive, use_private_key is not a secret