Skip to content

chore: Release #2191

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
merged 23 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ca11f6b
docs: Add feedback request to readme (#2165)
npalm Jun 20, 2022
c5e3c21
feat: Add option to match some of the labes instead of all #2122 (#2123)
sblack4 Jun 23, 2022
9b9da03
fix: Remove asterik in permission for runner lambda to describe insta…
julada Jun 23, 2022
c0b11bb
fix: don't apply extra labels unless defined (#2181)
jonohill Jun 23, 2022
1680f04
chore: Bump prettier (#2167)
dependabot[bot] Jun 23, 2022
8224b2d
chore: Bump prettier in /modules/runners/lambdas/runners (#2168)
dependabot[bot] Jun 23, 2022
63e5cae
chore: Bump @types/node in /modules/runners/lambdas/runners (#2169)
dependabot[bot] Jun 23, 2022
5752026
chore: Bump @types/aws-lambda in /modules/webhook/lambdas/webhook (#2…
dependabot[bot] Jun 23, 2022
f53b1d4
chore: Bump aws-sdk in /modules/webhook/lambdas/webhook (#2177)
dependabot[bot] Jun 23, 2022
e383748
chore: Bump typescript (#2172)
dependabot[bot] Jun 23, 2022
120d984
chore: Bump typescript in /modules/runners/lambdas/runners (#2175)
dependabot[bot] Jun 23, 2022
f844e90
chore: Bump nock in /modules/webhook/lambdas/webhook (#2180)
dependabot[bot] Jun 23, 2022
466b279
chore: Bump nock in /modules/runners/lambdas/runners (#2170)
dependabot[bot] Jun 23, 2022
5eeacb7
chore: Bump @types/node (#2173)
dependabot[bot] Jun 23, 2022
3d99e14
chore: Bump aws-sdk in /modules/webhook/lambdas/webhook (#2185)
dependabot[bot] Jun 23, 2022
2ea22f8
chore: Bump aws-sdk in /modules/runners/lambdas/runners (#2184)
dependabot[bot] Jun 23, 2022
55319bd
chore: Bump @aws-sdk/client-ssm in /modules/webhook/lambdas/webhook (…
dependabot[bot] Jun 23, 2022
642af04
chore: Bump prettier in /modules/webhook/lambdas/webhook (#2176)
dependabot[bot] Jun 23, 2022
5a33bf2
chore: Bump @octokit/types in /modules/runners/lambdas/runners (#2188)
dependabot[bot] Jun 23, 2022
4ed59b6
chore: Bump @types/aws-lambda in /modules/runners/lambdas/runners (#2…
dependabot[bot] Jun 23, 2022
cd41726
chore: Bump aws-sdk (#2187)
dependabot[bot] Jun 23, 2022
9424c62
chore: Bump @aws-sdk/client-ssm in /modules/runners/lambdas/runners (…
dependabot[bot] Jun 23, 2022
a81786c
chore: Bump typescript in /modules/webhook/lambdas/webhook (#2179)
dependabot[bot] Jun 23, 2022
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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

This [Terraform](https://www.terraform.io/) module creates the required infrastructure needed to host [GitHub Actions](https://github.com/features/actions) self-hosted, auto-scaling runners on [AWS spot instances](https://aws.amazon.com/ec2/spot/). It provides the required logic to handle the life cycle for scaling up and down using a set of AWS Lambda functions. Runners are scaled down to zero to avoid costs when no workflows are active.

> BREAKING CHANGE: The module is upgraded to Terraform AWS provider 4.x. All new development will only support the new AWS Terraform provider. We keep a branch `terraform-aws-provider-3` to witch we welcome backports to AWS Terraform 3.x provider. Besides reviewing PR's we will do not any active checking on maintance on this branch. We strongly advise to update your deployment to the new provider version. For more details about upgrading see the [upgrade guide](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-4-upgrade).
> 📢 HELP WANTED: We are running the AWS self-hosted GitHub runners OS project in Philips Labs for over two years! And we are incredibly happy with all the feedback and contribution of the open-source community. In the next months we will speak at some conferences to share the solution and story of running this open-source project. Via [this questionaire](https://forms.office.com/r/j03CUzdLFp) we would like to gather feedback from the community to use in our talks.

- [Motivation](#motivation)
- [Overview](#overview)
- [Major configuration options.](#major-configuration-options)
Expand Down Expand Up @@ -426,9 +426,9 @@ In case the setup does not work as intended follow the trace of events:
| <a name="input_job_queue_retention_in_seconds"></a> [job\_queue\_retention\_in\_seconds](#input\_job\_queue\_retention\_in\_seconds) | The number of seconds the job is held in the queue before it is purged | `number` | `86400` | no |
| <a name="input_key_name"></a> [key\_name](#input\_key\_name) | Key pair name | `string` | `null` | no |
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | Optional CMK Key ARN to be used for Parameter Store. This key must be in the current account. | `string` | `null` | no |
| <a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86\_64' functions. | `string` | `"x86_64"` | no |
| <a name="input_lambda_principals"></a> [lambda\_principals](#input\_lambda\_principals) | (Optional) add extra principals to the role created for execution of the lambda, e.g. for local testing. | <pre>list(object({<br> type = string<br> identifiers = list(string)<br> }))</pre> | `[]` | no |
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs14.x"` | no |
| <a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | AWS Lambda architecture. | `string` | `"x86_64"` | no |
| <a name="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket) | S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. | `any` | `null` | no |
| <a name="input_lambda_security_group_ids"></a> [lambda\_security\_group\_ids](#input\_lambda\_security\_group\_ids) | List of security group IDs associated with the Lambda function. | `list(string)` | `[]` | no |
| <a name="input_lambda_subnet_ids"></a> [lambda\_subnet\_ids](#input\_lambda\_subnet\_ids) | List of subnets in which the action runners will be launched, the subnets needs to be subnets in the `vpc_id`. | `list(string)` | `[]` | no |
Expand Down Expand Up @@ -458,6 +458,7 @@ In case the setup does not work as intended follow the trace of events:
| <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 specificatons. | `map(string)` | `{}` | no |
| <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 |
| <a name="input_runner_enable_workflow_job_labels_check"></a> [runner\_enable\_workflow\_job\_labels\_check](#input\_runner\_enable\_workflow\_job\_labels\_check) | If set to true all labels in the workflow job even are matched agaist the custom labels and GitHub labels (os, architecture and `self-hosted`). When the labels are not matching the event is dropped at the webhook. | `bool` | `false` | no |
| <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 |
| <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 |
| <a name="input_runner_group_name"></a> [runner\_group\_name](#input\_runner\_group\_name) | Name of the runner group. | `string` | `"Default"` | no |
| <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 |
Expand Down
5 changes: 4 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ locals {
id = module.ssm.parameters.github_app_id
key_base64 = module.ssm.parameters.github_app_key_base64
}

default_runner_labels = "self-hosted,${var.runner_os},${var.runner_architecture}"
}

resource "random_string" "random" {
Expand Down Expand Up @@ -111,7 +113,8 @@ module "webhook" {

# labels
enable_workflow_job_labels_check = var.runner_enable_workflow_job_labels_check
runner_labels = "self-hosted,${var.runner_os},${var.runner_architecture},${var.runner_extra_labels}"
workflow_job_labels_check_all = var.runner_enable_workflow_job_labels_check_all
runner_labels = var.runner_extra_labels != "" ? "${local.default_runner_labels},${var.runner_extra_labels}" : local.default_runner_labels

role_path = var.role_path
role_permissions_boundary = var.role_permissions_boundary
Expand Down
1 change: 1 addition & 0 deletions modules/runner-binaries-syncer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ No modules.
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | AWS region. | `string` | n/a | yes |
| <a name="input_distribution_bucket_name"></a> [distribution\_bucket\_name](#input\_distribution\_bucket\_name) | Bucket for storing the action runner distribution. | `string` | n/a | yes |
| <a name="input_environment"></a> [environment](#input\_environment) | A name that identifies the environment, used as prefix and for tagging. | `string` | `null` | no |
| <a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86\_64' functions. | `string` | `"x86_64"` | no |
| <a name="input_lambda_principals"></a> [lambda\_principals](#input\_lambda\_principals) | (Optional) add extra principals to the role created for execution of the lambda, e.g. for local testing. | <pre>list(object({<br> type = string<br> identifiers = list(string)<br> }))</pre> | `[]` | no |
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs14.x"` | no |
| <a name="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket) | S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. | `any` | `null` | no |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@
"@octokit/rest": "^18.12.0",
"@trivago/prettier-plugin-sort-imports": "^3.2.0",
"@types/jest": "^27.5.0",
"@types/node": "^17.0.42",
"@types/node": "^18.0.0",
"@types/request": "^2.48.8",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"@vercel/ncc": "^0.34.0",
"aws-sdk": "^2.1153.0",
"aws-sdk": "^2.1160.0",
"eslint": "^7.32.0",
"eslint-plugin-prettier": "4.0.0",
"jest": "^27.5.1",
"jest-mock": "^28.1.1",
"prettier": "2.6.2",
"prettier": "2.7.1",
"ts-jest": "^27.1.4",
"ts-node-dev": "^2.0.0",
"typescript": "^4.7.3"
"typescript": "^4.7.4"
},
"dependencies": {
"axios": "^0.27.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -897,10 +897,10 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d"
integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==

"@types/node@*", "@types/node@^17.0.42":
version "17.0.42"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.42.tgz#d7e8f22700efc94d125103075c074396b5f41f9b"
integrity sha512-Q5BPGyGKcvQgAMbsr7qEGN/kIPN6zZecYYABeTDBizOsau+2NMdSVTar9UQw21A2+JyA2KRNDYaYrPB0Rpk2oQ==
"@types/node@*", "@types/node@^18.0.0":
version "18.0.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.0.tgz#67c7b724e1bcdd7a8821ce0d5ee184d3b4dd525a"
integrity sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==

"@types/prettier@^2.1.5":
version "2.4.2"
Expand Down Expand Up @@ -1172,10 +1172,10 @@ asynckit@^0.4.0:
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=

aws-sdk@^2.1153.0:
version "2.1153.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1153.0.tgz#63394dff05166d12d29594beda909e85897aa56d"
integrity sha512-afuYFy5jc2eQ7fGL6bsMiDGJ74nSvQyCWwQ0j3lJp+9BbMCxqc03lozWh3W07tknr4xmL+5YhfkmViNLoz2huA==
aws-sdk@^2.1160.0:
version "2.1160.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1160.0.tgz#4af9bcbf044b77e836341fad47627cc0d7c2b854"
integrity sha512-aUjpuuVctjoRDnbs/SnDJXS7QeXmBANbYFPNLwm5JXcszkokoGcYzD37PFRNJUHQ30XNBoH451mxdNWZQ606xg==
dependencies:
buffer "4.9.2"
events "1.1.1"
Expand Down Expand Up @@ -3062,10 +3062,10 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@2.6.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032"
integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==
prettier@2.7.1:
version "2.7.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==

pretty-format@^27.0.0, pretty-format@^27.5.1:
version "27.5.1"
Expand Down Expand Up @@ -3585,10 +3585,10 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

typescript@^4.7.3:
version "4.7.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d"
integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==
typescript@^4.7.4:
version "4.7.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==

universal-user-agent@^6.0.0:
version "6.0.0"
Expand Down
1 change: 1 addition & 0 deletions modules/runners/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ yarn run dist
| <a name="input_instance_types"></a> [instance\_types](#input\_instance\_types) | List of instance types for the action runner. Defaults are based on runner\_os (amzn2 for linux and Windows Server Core for win). | `list(string)` | `null` | no |
| <a name="input_key_name"></a> [key\_name](#input\_key\_name) | Key pair name | `string` | `null` | no |
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | Optional CMK Key ARN to be used for Parameter Store. | `string` | `null` | no |
| <a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86\_64' functions. | `string` | `"x86_64"` | no |
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | AWS Lambda runtime. | `string` | `"nodejs14.x"` | no |
| <a name="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket) | S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. | `any` | `null` | no |
| <a name="input_lambda_security_group_ids"></a> [lambda\_security\_group\_ids](#input\_lambda\_security\_group\_ids) | List of security group IDs associated with the Lambda function. | `list(string)` | `[]` | no |
Expand Down
18 changes: 9 additions & 9 deletions modules/runners/lambdas/runners/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^3.2.0",
"@types/aws-lambda": "^8.10.100",
"@types/aws-lambda": "^8.10.101",
"@types/express": "^4.17.11",
"@types/jest": "^27.5.0",
"@typescript-eslint/eslint-plugin": "^4.33.0",
Expand All @@ -29,23 +29,23 @@
"jest-mock": "^28.1.1",
"jest-mock-extended": "^2.0.6",
"moment-timezone": "^0.5.34",
"nock": "^13.2.6",
"prettier": "2.6.2",
"nock": "^13.2.7",
"prettier": "2.7.1",
"ts-jest": "^27.1.4",
"ts-node": "^10.7.0",
"ts-node-dev": "^2.0.0"
},
"dependencies": {
"@aws-sdk/client-ssm": "^3.105.0",
"@aws-sdk/client-ssm": "^3.112.0",
"@octokit/auth-app": "3.6.1",
"@octokit/rest": "^18.12.0",
"@octokit/types": "^6.34.0",
"@types/aws-lambda": "^8.10.100",
"@octokit/types": "^6.37.0",
"@types/aws-lambda": "^8.10.101",
"@types/express": "^4.17.11",
"@types/node": "^17.0.42",
"aws-sdk": "^2.1153.0",
"@types/node": "^18.0.0",
"aws-sdk": "^2.1160.0",
"cron-parser": "^4.4.0",
"tslog": "^3.3.3",
"typescript": "^4.7.3"
"typescript": "^4.7.4"
}
}
Loading