Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 455e272

Browse files
fix: Correction enable_enable_fifo_build_queue (#2857)
fix: Variable enable_enable_fifo_build_queue -> enable_enable_fifo_build_queue Co-authored-by: GuptaNavdeep1983 <[email protected]>
1 parent 84411cb commit 455e272

File tree

6 files changed

+23
-11
lines changed

6 files changed

+23
-11
lines changed

Diff for: README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ You can configure runners to be ephemeral, runners will be used only for one job
325325
- The scale down lambda is still active, and should only remove orphan instances. But there is no strict check in place. So ensure you configure the `minimum_running_time_in_minutes` to a value that is high enough to got your runner booted and connected to avoid it got terminated before executing a job.
326326
- The messages sent from the webhook lambda to scale-up lambda are by default delayed delayed by SQS, to give available runners to option to start the job before the decision is made to scale more runners. For ephemeral runners there is no need to wait. Set `delay_webhook_event` to `0`.
327327
- All events on the queue will lead to a new runner crated by the lambda. By setting `enable_job_queued_check` to `true` you can enforce only create a runner if the event has a correlated queued job. Setting this can avoid creating useless runners, for example whn jobs got cancelled before a runner is created. We suggest to use this in combination with a pool.
328-
- To ensure runners are created in the same order GitHub sends the events we use by default a FIFO queue, this is mainly relevant for repo level runners. For ephemeral runners you can set `enable_enable_fifo_build_queue` to `false`.
328+
- To ensure runners are created in the same order GitHub sends the events we use by default a FIFO queue, this is mainly relevant for repo level runners. For ephemeral runners you can set `enable_fifo_build_queue` to `false`.
329329
- Error related to scaling should be retried via SQS. You can configure `job_queue_retention_in_seconds` `redrive_build_queue` to tune the behavior. We have no mechanism to avoid events will never processed, which means potential no runner could be created and the job in GitHub can time out in 6 hours.
330330

331331
The example for [ephemeral runners](./examples/ephemeral) is based on the [default example](./examples/default). Have look on the diff to see the major configuration differences.
@@ -455,8 +455,9 @@ We welcome any improvement to the standard module to make the default as secure
455455
| <a name="input_delay_webhook_event"></a> [delay\_webhook\_event](#input\_delay\_webhook\_event) | The number of seconds the event accepted by the webhook is invisible on the queue before the scale up lambda will receive the event. | `number` | `30` | no |
456456
| <a name="input_disable_runner_autoupdate"></a> [disable\_runner\_autoupdate](#input\_disable\_runner\_autoupdate) | Disable the auto update of the github runner agent. Be-aware there is a grace period of 30 days, see also the [GitHub article](https://github.blog/changelog/2022-02-01-github-actions-self-hosted-runners-can-now-disable-automatic-updates/) | `bool` | `false` | no |
457457
| <a name="input_enable_cloudwatch_agent"></a> [enable\_cloudwatch\_agent](#input\_enable\_cloudwatch\_agent) | Enabling the cloudwatch agent on the ec2 runner instances, the runner contains default config. Configuration can be overridden via `cloudwatch_config`. | `bool` | `true` | no |
458-
| <a name="input_enable_enable_fifo_build_queue"></a> [enable\_enable\_fifo\_build\_queue](#input\_enable\_enable\_fifo\_build\_queue) | Enable a FIFO queue to remain the order of events received by the webhook. Suggest to set to true for repo level runners. | `bool` | `false` | no |
458+
| <a name="input_enable_enable_fifo_build_queue"></a> [enable\_enable\_fifo\_build\_queue](#input\_enable\_enable\_fifo\_build\_queue) | DEPCRECATED: Replaced by `enable_fifo_build_queue` / `fifo_build_queue`. | `string` | `null` | no |
459459
| <a name="input_enable_ephemeral_runners"></a> [enable\_ephemeral\_runners](#input\_enable\_ephemeral\_runners) | Enable ephemeral runners, runners will only be used once. | `bool` | `false` | no |
460+
| <a name="input_enable_fifo_build_queue"></a> [enable\_fifo\_build\_queue](#input\_enable\_fifo\_build\_queue) | Enable a FIFO queue to remain the order of events received by the webhook. Suggest to set to true for repo level runners. | `bool` | `false` | no |
460461
| <a name="input_enable_job_queued_check"></a> [enable\_job\_queued\_check](#input\_enable\_job\_queued\_check) | Only scale if the job event received by the scale up lambda is is in the state queued. By default enabled for non ephemeral runners and disabled for ephemeral. Set this variable to overwrite the default behavior. | `bool` | `null` | no |
461462
| <a name="input_enable_managed_runner_security_group"></a> [enable\_managed\_runner\_security\_group](#input\_enable\_managed\_runner\_security\_group) | Enabling the default managed security group creation. Unmanaged security groups can be specified via `runner_additional_security_group_ids`. | `bool` | `true` | no |
462463
| <a name="input_enable_organization_runners"></a> [enable\_organization\_runners](#input\_enable\_organization\_runners) | Register runners to organization, instead of repo level | `bool` | `false` | no |

Diff for: examples/arm64/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module "runners" {
7070
runners_maximum_count = 1
7171

7272
# set up a fifo queue to remain order
73-
enable_enable_fifo_build_queue = true
73+
enable_fifo_build_queue = true
7474

7575
# override scaling down
7676
scale_down_schedule_expression = "cron(* * * * ? *)"

Diff for: examples/default/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module "runners" {
7979
runners_maximum_count = 1
8080

8181
# set up a fifo queue to remain order
82-
enable_enable_fifo_build_queue = true
82+
enable_fifo_build_queue = true
8383

8484
# override scaling down
8585
scale_down_schedule_expression = "cron(* * * * ? *)"

Diff for: main.tf

+6-6
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ resource "aws_sqs_queue_policy" "webhook_events_workflow_job_queue_policy" {
5959
}
6060

6161
resource "aws_sqs_queue" "queued_builds" {
62-
name = "${var.prefix}-queued-builds${var.enable_enable_fifo_build_queue ? ".fifo" : ""}"
62+
name = "${var.prefix}-queued-builds${var.enable_fifo_build_queue ? ".fifo" : ""}"
6363
delay_seconds = var.delay_webhook_event
6464
visibility_timeout_seconds = var.runners_scale_up_lambda_timeout
6565
message_retention_seconds = var.job_queue_retention_in_seconds
66-
fifo_queue = var.enable_enable_fifo_build_queue
66+
fifo_queue = var.enable_fifo_build_queue
6767
receive_wait_time_seconds = 0
68-
content_based_deduplication = var.enable_enable_fifo_build_queue
68+
content_based_deduplication = var.enable_fifo_build_queue
6969
redrive_policy = var.redrive_build_queue.enabled ? jsonencode({
7070
deadLetterTargetArn = aws_sqs_queue.queued_builds_dlq[0].arn,
7171
maxReceiveCount = var.redrive_build_queue.maxReceiveCount
@@ -104,12 +104,12 @@ resource "aws_sqs_queue_policy" "build_queue_dlq_policy" {
104104

105105
resource "aws_sqs_queue" "queued_builds_dlq" {
106106
count = var.redrive_build_queue.enabled ? 1 : 0
107-
name = "${var.prefix}-queued-builds_dead_letter${var.enable_enable_fifo_build_queue ? ".fifo" : ""}"
107+
name = "${var.prefix}-queued-builds_dead_letter${var.enable_fifo_build_queue ? ".fifo" : ""}"
108108

109109
sqs_managed_sse_enabled = var.queue_encryption.sqs_managed_sse_enabled
110110
kms_master_key_id = var.queue_encryption.kms_master_key_id
111111
kms_data_key_reuse_period_seconds = var.queue_encryption.kms_data_key_reuse_period_seconds
112-
fifo_queue = var.enable_enable_fifo_build_queue
112+
fifo_queue = var.enable_fifo_build_queue
113113
tags = var.tags
114114
}
115115

@@ -133,7 +133,7 @@ module "webhook" {
133133
(aws_sqs_queue.queued_builds.id) = {
134134
id : aws_sqs_queue.queued_builds.id
135135
arn : aws_sqs_queue.queued_builds.arn
136-
fifo : var.enable_enable_fifo_build_queue
136+
fifo : var.enable_fifo_build_queue
137137
matcherConfig : {
138138
labelMatchers : [split(",", local.runner_labels)]
139139
exactMatch : var.enable_runner_workflow_job_labels_check_all

Diff for: variables.deprecated.tf

+11
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,14 @@ variable "fifo_build_queue" {
3030
error_message = "DEPCRECATED, replaced by `enable_fifo_build_queue`."
3131
}
3232
}
33+
34+
variable "enable_enable_fifo_build_queue" {
35+
description = "DEPCRECATED: Replaced by `enable_fifo_build_queue` / `fifo_build_queue`."
36+
type = string
37+
default = null
38+
39+
validation {
40+
condition = anytrue([var.enable_enable_fifo_build_queue == null])
41+
error_message = "DEPCRECATED, replaced by `enable_fifo_build_queue`."
42+
}
43+
}

Diff for: variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ variable "lambda_principals" {
595595
default = []
596596
}
597597

598-
variable "enable_enable_fifo_build_queue" {
598+
variable "enable_fifo_build_queue" {
599599
description = "Enable a FIFO queue to remain the order of events received by the webhook. Suggest to set to true for repo level runners."
600600
type = bool
601601
default = false

0 commit comments

Comments
 (0)