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

Commit 219cb9b

Browse files
committed
fix: Restore lost changes during merging next (#2824)
1 parent 56e04c9 commit 219cb9b

File tree

7 files changed

+53
-19
lines changed

7 files changed

+53
-19
lines changed

Diff for: CHANGELOG.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ See the [GitHub release](https://github.com/philips-labs/terraform-aws-github-ru
130130

131131
## [1.13.0](https://github.com/philips-labs/terraform-aws-github-runner/compare/v1.12.0...v1.13.0) (2022-10-14)
132132

133-
134133
### Features
135134

136135
* Experimental feature - Duplicate workflow job event to extra queue ([#2268](https://github.com/philips-labs/terraform-aws-github-runner/issues/2268)) ([985e722](https://github.com/philips-labs/terraform-aws-github-runner/commit/985e722229ce464235d206484df3d989db03e143))
@@ -836,7 +835,7 @@ See the [GitHub release](https://github.com/philips-labs/terraform-aws-github-ru
836835
- Fix missing permissions for CloudWatch Agent #445 @bennettp123
837836
- Swap scale up/scale down timeout description #468 @jonico
838837
- Fix for invalid configuration #466 @jonico
839-
- Add ssm:GetParameter to runner-ssm-parameters #446 @bennettp123
838+
- Add ssm:GetParameter to runner-ssm-parameters #446 @bennettp123
840839
- Replace crypto #429
841840
- Scale up lambda deprecated attribute #410
842841

@@ -873,17 +872,17 @@ terraform state rm $RESOURCE
873872
### Added
874873

875874
- Allow operator to pass in a list of managed IAM policy ARNs for the runner role #361 @jpalomaki
876-
- expand options for sourcing lambda to include S3 #292 @eky5006
875+
- expand options for sourcing lambda to include S3 #292 @eky5006
877876

878877
## [0.6.0] - 2020-10-10
879878

880879
### Added
881880

882-
- Only allow tagging and termination of runner instances #201 @jpalomaki
881+
- Only allow tagging and termination of runner instances #201 @jpalomaki
883882

884883
### Fixed
885884

886-
- Fix pagination with listing self-hosted runners #202 @HenryNguyen5
885+
- Fix pagination with listing self-hosted runners #202 @HenryNguyen5
887886

888887

889888
## [0.5.0] - 2020-08-25

Diff for: README.md

+6-3
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 `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_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,18 +455,21 @@ 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 |
458459
| <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 |
459460
| <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 |
460461
| <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 |
461462
| <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 |
462463
| <a name="input_enable_runner_binaries_syncer"></a> [enable\_runner\_binaries\_syncer](#input\_enable\_runner\_binaries\_syncer) | Option to disable the lambda to sync GitHub runner distribution, useful when using a pre-build AMI. | `bool` | `true` | no |
463464
| <a name="input_enable_runner_detailed_monitoring"></a> [enable\_runner\_detailed\_monitoring](#input\_enable\_runner\_detailed\_monitoring) | Should detailed monitoring be enabled for the runner. Set this to true if you want to use detailed monitoring. See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch-new.html for details. | `bool` | `false` | no |
465+
| <a name="input_enable_runner_workflow_job_labels_check_all"></a> [enable\_runner\_workflow\_job\_labels\_check\_all](#input\_enable\_runner\_workflow\_job\_labels\_check\_all) | If set to true all labels in the workflow job must match the GitHub labels (os, architecture and `self-hosted`). When false if __any__ label matches it will trigger the webhook. `runner_enable_workflow_job_labels_check` must be true for this to take effect. | `bool` | `true` | no |
464466
| <a name="input_enable_ssm_on_runners"></a> [enable\_ssm\_on\_runners](#input\_enable\_ssm\_on\_runners) | Enable to allow access the runner instances for debugging purposes via SSM. Note that this adds additional permissions to the runner instances. | `bool` | `false` | no |
465467
| <a name="input_enable_user_data_debug_logging_runner"></a> [enable\_user\_data\_debug\_logging\_runner](#input\_enable\_user\_data\_debug\_logging\_runner) | Option to enable debug logging for user-data, this logs all secrets as well. | `bool` | `false` | no |
466468
| <a name="input_enable_userdata"></a> [enable\_userdata](#input\_enable\_userdata) | Should the userdata script be enabled for the runner. Set this to false if you are using your own prebuilt AMI. | `bool` | `true` | no |
467469
| <a name="input_enable_workflow_job_events_queue"></a> [enable\_workflow\_job\_events\_queue](#input\_enable\_workflow\_job\_events\_queue) | Enabling this experimental feature will create a secondory sqs queue to wich a copy of the workflow\_job event will be delivered. | `bool` | `false` | no |
470+
| <a name="input_enabled_userdata"></a> [enabled\_userdata](#input\_enabled\_userdata) | DEPCRECATED: Replaced by `enable_userdata`. | `string` | `null` | no |
468471
| <a name="input_environment"></a> [environment](#input\_environment) | DEPRECATED, no longer used. See `prefix` | `string` | `null` | no |
469-
| <a name="input_fifo_build_queue"></a> [fifo\_build\_queue](#input\_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 |
472+
| <a name="input_fifo_build_queue"></a> [fifo\_build\_queue](#input\_fifo\_build\_queue) | DEPCRECATED: Replaced by `enable_fifo_build_queue`. | `string` | `null` | no |
470473
| <a name="input_ghes_ssl_verify"></a> [ghes\_ssl\_verify](#input\_ghes\_ssl\_verify) | GitHub Enterprise SSL verification. Set to 'false' when custom certificate (chains) is used for GitHub Enterprise Server (insecure). | `bool` | `true` | no |
471474
| <a name="input_ghes_url"></a> [ghes\_url](#input\_ghes\_url) | GitHub Enterprise Server URL. Example: https://github.internal.co - DO NOT SET IF USING PUBLIC GITHUB | `string` | `null` | no |
472475
| <a name="input_github_app"></a> [github\_app](#input\_github\_app) | GitHub app parameters, see your github app. Ensure the key is the base64-encoded `.pem` file (the output of `base64 app.private-key.pem`, not the content of `private-key.pem`). | <pre>object({<br> key_base64 = string<br> id = string<br> webhook_secret = string<br> })</pre> | n/a | yes |
@@ -512,7 +515,7 @@ We welcome any improvement to the standard module to make the default as secure
512515
| <a name="input_runner_boot_time_in_minutes"></a> [runner\_boot\_time\_in\_minutes](#input\_runner\_boot\_time\_in\_minutes) | The minimum time for an EC2 runner to boot and register as a runner. | `number` | `5` | no |
513516
| <a name="input_runner_ec2_tags"></a> [runner\_ec2\_tags](#input\_runner\_ec2\_tags) | Map of tags that will be added to the launch template instance tag specifications. | `map(string)` | `{}` | no |
514517
| <a name="input_runner_egress_rules"></a> [runner\_egress\_rules](#input\_runner\_egress\_rules) | List of egress rules for the GitHub runner instances. | <pre>list(object({<br> cidr_blocks = list(string)<br> ipv6_cidr_blocks = list(string)<br> prefix_list_ids = list(string)<br> from_port = number<br> protocol = string<br> security_groups = list(string)<br> self = bool<br> to_port = number<br> description = string<br> }))</pre> | <pre>[<br> {<br> "cidr_blocks": [<br> "0.0.0.0/0"<br> ],<br> "description": null,<br> "from_port": 0,<br> "ipv6_cidr_blocks": [<br> "::/0"<br> ],<br> "prefix_list_ids": null,<br> "protocol": "-1",<br> "security_groups": null,<br> "self": null,<br> "to_port": 0<br> }<br>]</pre> | no |
515-
| <a name="input_runner_enable_workflow_job_labels_check_all"></a> [runner\_enable\_workflow\_job\_labels\_check\_all](#input\_runner\_enable\_workflow\_job\_labels\_check\_all) | If set to true all labels in the workflow job must match the GitHub labels (os, architecture and `self-hosted`). When false if __any__ label matches it will trigger the webhook. `runner_enable_workflow_job_labels_check` must be true for this to take effect. | `bool` | `true` | no |
518+
| <a name="input_runner_enable_workflow_job_labels_check_all"></a> [runner\_enable\_workflow\_job\_labels\_check\_all](#input\_runner\_enable\_workflow\_job\_labels\_check\_all) | DEPCRECATED: Replaced by `enable_runner_workflow_job_labels_check_all`. | `string` | `null` | no |
516519
| <a name="input_runner_extra_labels"></a> [runner\_extra\_labels](#input\_runner\_extra\_labels) | Extra (custom) labels for the runners (GitHub). Separate each label by a comma. Labels checks on the webhook can be enforced by setting `enable_workflow_job_labels_check`. GitHub read-only labels should not be provided. | `string` | `""` | no |
517520
| <a name="input_runner_group_name"></a> [runner\_group\_name](#input\_runner\_group\_name) | Name of the runner group. | `string` | `"Default"` | no |
518521
| <a name="input_runner_iam_role_managed_policy_arns"></a> [runner\_iam\_role\_managed\_policy\_arns](#input\_runner\_iam\_role\_managed\_policy\_arns) | Attach AWS or customer-managed IAM policies (by ARN) to the runner IAM role | `list(string)` | `[]` | 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-
fifo_build_queue = true
73+
enable_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-
fifo_build_queue = true
82+
enable_enable_fifo_build_queue = true
8383

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

Diff for: main.tf

+7-7
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.fifo_build_queue ? ".fifo" : ""}"
62+
name = "${var.prefix}-queued-builds${var.enable_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.fifo_build_queue
66+
fifo_queue = var.enable_enable_fifo_build_queue
6767
receive_wait_time_seconds = 0
68-
content_based_deduplication = var.fifo_build_queue
68+
content_based_deduplication = var.enable_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.fifo_build_queue ? ".fifo" : ""}"
107+
name = "${var.prefix}-queued-builds_dead_letter${var.enable_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.fifo_build_queue
112+
fifo_queue = var.enable_enable_fifo_build_queue
113113
tags = var.tags
114114
}
115115

@@ -133,10 +133,10 @@ 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.fifo_build_queue
136+
fifo : var.enable_enable_fifo_build_queue
137137
matcherConfig : {
138138
labelMatchers : [split(",", local.runner_labels)]
139-
exactMatch : var.runner_enable_workflow_job_labels_check_all
139+
exactMatch : var.enable_runner_workflow_job_labels_check_all
140140
}
141141
}
142142
}

Diff for: variables.deprecated.tf

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
variable "enabled_userdata" {
2+
description = "DEPCRECATED: Replaced by `enable_userdata`."
3+
type = string
4+
default = null
5+
6+
validation {
7+
condition = anytrue([var.enabled_userdata == null])
8+
error_message = "DEPCRECATED, replaced by `enable_userdata`."
9+
}
10+
}
11+
12+
variable "runner_enable_workflow_job_labels_check_all" {
13+
description = "DEPCRECATED: Replaced by `enable_runner_workflow_job_labels_check_all`."
14+
type = string
15+
default = null
16+
17+
validation {
18+
condition = anytrue([var.runner_enable_workflow_job_labels_check_all == null])
19+
error_message = "DEPCRECATED, replaced by `enable_runner_workflow_job_labels_check_all`."
20+
}
21+
}
22+
23+
variable "fifo_build_queue" {
24+
description = "DEPCRECATED: Replaced by `enable_fifo_build_queue`."
25+
type = string
26+
default = null
27+
28+
validation {
29+
condition = anytrue([var.fifo_build_queue == null])
30+
error_message = "DEPCRECATED, replaced by `enable_fifo_build_queue`."
31+
}
32+
}

Diff for: variables.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ variable "log_level" {
534534
}
535535
}
536536

537-
variable "runner_enable_workflow_job_labels_check_all" {
537+
variable "enable_runner_workflow_job_labels_check_all" {
538538
description = "If set to true all labels in the workflow job must match the GitHub labels (os, architecture and `self-hosted`). When false if __any__ label matches it will trigger the webhook. `runner_enable_workflow_job_labels_check` must be true for this to take effect."
539539
type = bool
540540
default = true
@@ -595,7 +595,7 @@ variable "lambda_principals" {
595595
default = []
596596
}
597597

598-
variable "fifo_build_queue" {
598+
variable "enable_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)