Skip to content

Commit 9b534d5

Browse files
authored
Merge pull request #1840 from philips-labs/develop
Release
2 parents 10d4ccb + c88a005 commit 9b534d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+611
-543
lines changed

.github/workflows/lambda-runner-binaries-syncer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
working-directory: modules/runner-binaries-syncer/lambdas/runner-binaries-syncer
1818

1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
2121
- name: Install dependencies
2222
run: yarn install
2323
- name: Run prettier

.github/workflows/lambda-runners.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
working-directory: modules/runners/lambdas/runners
1818

1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
2121
- name: Install dependencies
2222
run: yarn install
2323
- name: Run prettier

.github/workflows/lambda-webhook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
working-directory: modules/webhook/lambdas/webhook
1818

1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
2121
- name: Install dependencies
2222
run: yarn install
2323
- name: Run prettier

.github/workflows/packer-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
working-directory: images/${{ matrix.image }}
2828
steps:
2929
- name: "Checkout"
30-
uses: actions/checkout@v2
30+
uses: actions/checkout@v3
3131

3232
- name: packer init
3333
run: packer init .

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
env:
2222
LAMBDA: ${{ matrix.lambda }}
2323
run: echo ::set-output name=name::${LAMBDA##*/}
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v3
2525
- name: Add zip
2626
run: apt update && apt install zip
2727
- name: Build dist
@@ -39,7 +39,7 @@ jobs:
3939
needs:
4040
prepare
4141
steps:
42-
- uses: actions/checkout@v2
42+
- uses: actions/checkout@v3
4343
with:
4444
fetch-depth: 0
4545
persist-credentials: false

.github/workflows/terraform.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
image: hashicorp/terraform:${{ matrix.terraform }}
2222
steps:
2323
- name: "Checkout"
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v3
2525
- name: "Fake zip files" # Validate will fail if it cannot find the zip files
2626
run: |
2727
touch modules/webhook/lambdas/webhook/webhook.zip
@@ -53,7 +53,7 @@ jobs:
5353
container:
5454
image: hashicorp/terraform:${{ matrix.terraform }}
5555
steps:
56-
- uses: actions/checkout@v2
56+
- uses: actions/checkout@v3
5757
- name: terraform init
5858
run: terraform init -get -backend=false -input=false
5959
- if: contains(matrix.terraform, '1.1.')

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,14 +387,18 @@ In case the setup does not work as intended follow the trace of events:
387387
| [aws_resourcegroups_group.resourcegroups_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/resourcegroups_group) | resource |
388388
| [aws_sqs_queue.queued_builds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue) | resource |
389389
| [aws_sqs_queue.queued_builds_dlq](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue) | resource |
390+
| [aws_sqs_queue_policy.build_queue_dlq_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue_policy) | resource |
391+
| [aws_sqs_queue_policy.build_queue_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue_policy) | resource |
390392
| [random_string.random](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
393+
| [aws_iam_policy_document.deny_unsecure_transport](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
391394

392395
## Inputs
393396

394397
| Name | Description | Type | Default | Required |
395398
|------|-------------|------|---------|:--------:|
396399
| <a name="input_ami_filter"></a> [ami\_filter](#input\_ami\_filter) | List of maps used to create the AMI filter for the action runner AMI. By default amazon linux 2 is used. | `map(list(string))` | `null` | no |
397400
| <a name="input_ami_owners"></a> [ami\_owners](#input\_ami\_owners) | The list of owners used to select the AMI of action runner instances. | `list(string)` | <pre>[<br> "amazon"<br>]</pre> | no |
401+
| <a name="input_aws_partition"></a> [aws\_partition](#input\_aws\_partition) | (optiona) partition in the arn namespace to use if not 'aws' | `string` | `"aws"` | no |
398402
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | AWS region. | `string` | n/a | yes |
399403
| <a name="input_block_device_mappings"></a> [block\_device\_mappings](#input\_block\_device\_mappings) | The EC2 instance block device configuration. Takes the following keys: `device_name`, `delete_on_termination`, `volume_type`, `volume_size`, `encrypted`, `iops` | `map(string)` | `{}` | no |
400404
| <a name="input_cloudwatch_config"></a> [cloudwatch\_config](#input\_cloudwatch\_config) | (optional) Replaces the module default cloudwatch log config. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html for details. | `string` | `null` | no |
@@ -428,6 +432,7 @@ In case the setup does not work as intended follow the trace of events:
428432
| <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 |
429433
| <a name="input_log_level"></a> [log\_level](#input\_log\_level) | Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'. | `string` | `"info"` | no |
430434
| <a name="input_log_type"></a> [log\_type](#input\_log\_type) | Logging format for lambda logging. Valid values are 'json', 'pretty', 'hidden'. | `string` | `"pretty"` | no |
435+
| <a name="input_logging_kms_key_id"></a> [logging\_kms\_key\_id](#input\_logging\_kms\_key\_id) | Specifies the kms key id to encrypt the logs with | `string` | `null` | no |
431436
| <a name="input_logging_retention_in_days"></a> [logging\_retention\_in\_days](#input\_logging\_retention\_in\_days) | Specifies the number of days you want to retain log events for the lambda log group. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653. | `number` | `180` | no |
432437
| <a name="input_market_options"></a> [market\_options](#input\_market\_options) | DEPCRECATED: Replaced by `instance_target_capacity_type`. | `string` | `null` | no |
433438
| <a name="input_minimum_running_time_in_minutes"></a> [minimum\_running\_time\_in\_minutes](#input\_minimum\_running\_time\_in\_minutes) | The time an ec2 action runner should be running at minimum before terminated if not busy. | `number` | `null` | no |

images/linux-amzn2/github_agent.linux.pkr.hcl

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ variable "subnet_id" {
3131
default = null
3232
}
3333

34+
variable "associate_public_ip_address" {
35+
description = "If using a non-default VPC, there is no public IP address assigned to the EC2 instance. If you specified a public subnet, you probably want to set this to true. Otherwise the EC2 instance won't have access to the internet"
36+
type = string
37+
default = null
38+
}
39+
3440
variable "instance_type" {
3541
description = "The instance type Packer will use for the builder"
3642
type = string
@@ -66,15 +72,22 @@ variable "snapshot_tags" {
6672
default = {}
6773
}
6874

75+
variable "custom_shell_commands" {
76+
description = "Additional commands to run on the EC2 instance, to customize the instance, like installing packages"
77+
type = list(string)
78+
default = []
79+
}
80+
6981
source "amazon-ebs" "githubrunner" {
70-
ami_name = "github-runner-amzn2-x86_64-${formatdate("YYYYMMDDhhmm", timestamp())}"
71-
instance_type = var.instance_type
72-
region = var.region
73-
security_group_id = var.security_group_id
74-
subnet_id = var.subnet_id
82+
ami_name = "github-runner-amzn2-x86_64-${formatdate("YYYYMMDDhhmm", timestamp())}"
83+
instance_type = var.instance_type
84+
region = var.region
85+
security_group_id = var.security_group_id
86+
subnet_id = var.subnet_id
87+
associate_public_ip_address = var.associate_public_ip_address
7588
source_ami_filter {
7689
filters = {
77-
name = "amzn2-ami-hvm-2.*-x86_64-ebs"
90+
name = "amzn2-ami-kernel-5.*-hvm-*-x86_64-gp2"
7891
root-device-type = "ebs"
7992
virtualization-type = "hvm"
8093
}
@@ -111,15 +124,15 @@ build {
111124
]
112125
provisioner "shell" {
113126
environment_vars = []
114-
inline = [
127+
inline = concat([
115128
"sudo yum update -y",
116129
"sudo yum install -y amazon-cloudwatch-agent curl jq git",
117130
"sudo amazon-linux-extras install docker",
118131
"sudo systemctl enable docker.service",
119132
"sudo systemctl enable containerd.service",
120133
"sudo service docker start",
121134
"sudo usermod -a -G docker ec2-user",
122-
]
135+
], var.custom_shell_commands)
123136
}
124137

125138
provisioner "file" {

images/ubuntu-focal/github_agent.ubuntu.pkr.hcl

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ variable "subnet_id" {
3131
default = null
3232
}
3333

34+
variable "associate_public_ip_address" {
35+
description = "If using a non-default VPC, there is no public IP address assigned to the EC2 instance. If you specified a public subnet, you probably want to set this to true. Otherwise the EC2 instance won't have access to the internet"
36+
type = string
37+
default = null
38+
}
39+
3440
variable "instance_type" {
3541
description = "The instance type Packer will use for the builder"
3642
type = string
@@ -66,12 +72,20 @@ variable "snapshot_tags" {
6672
default = {}
6773
}
6874

75+
variable "custom_shell_commands" {
76+
description = "Additional commands to run on the EC2 instance, to customize the instance, like installing packages"
77+
type = list(string)
78+
default = []
79+
}
80+
6981
source "amazon-ebs" "githubrunner" {
70-
ami_name = "github-runner-ubuntu-focal-amd64-${formatdate("YYYYMMDDhhmm", timestamp())}"
71-
instance_type = var.instance_type
72-
region = var.region
73-
security_group_id = var.security_group_id
74-
subnet_id = var.subnet_id
82+
ami_name = "github-runner-ubuntu-focal-amd64-${formatdate("YYYYMMDDhhmm", timestamp())}"
83+
instance_type = var.instance_type
84+
region = var.region
85+
security_group_id = var.security_group_id
86+
subnet_id = var.subnet_id
87+
associate_public_ip_address = var.associate_public_ip_address
88+
7589
source_ami_filter {
7690
filters = {
7791
name = "*/ubuntu-focal-20.04-amd64-server-*"
@@ -112,7 +126,7 @@ build {
112126
environment_vars = [
113127
"DEBIAN_FRONTEND=noninteractive"
114128
]
115-
inline = [
129+
inline = concat([
116130
"sudo apt-get -y update",
117131
"sudo apt-get -y install ca-certificates curl gnupg lsb-release",
118132
"sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg",
@@ -128,7 +142,7 @@ build {
128142
"sudo curl -f https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip",
129143
"unzip awscliv2.zip",
130144
"sudo ./aws/install",
131-
]
145+
], var.custom_shell_commands)
132146
}
133147

134148
provisioner "file" {

images/windows-core-2019/github_agent.windows.pkr.hcl

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,25 @@ variable "ebs_delete_on_termination" {
2525
default = true
2626
}
2727

28+
variable "associate_public_ip_address" {
29+
description = "If using a non-default VPC, there is no public IP address assigned to the EC2 instance. If you specified a public subnet, you probably want to set this to true. Otherwise the EC2 instance won't have access to the internet"
30+
type = string
31+
default = null
32+
}
33+
34+
variable "custom_shell_commands" {
35+
description = "Additional commands to run on the EC2 instance, to customize the instance, like installing packages"
36+
type = list(string)
37+
default = []
38+
}
39+
2840
source "amazon-ebs" "githubrunner" {
29-
ami_name = "github-runner-windows-core-2019-${formatdate("YYYYMMDDhhmm", timestamp())}"
30-
communicator = "winrm"
31-
instance_type = "t3a.medium"
32-
region = var.region
41+
ami_name = "github-runner-windows-core-2019-${formatdate("YYYYMMDDhhmm", timestamp())}"
42+
communicator = "winrm"
43+
instance_type = "t3a.medium"
44+
region = var.region
45+
associate_public_ip_address = var.associate_public_ip_address
46+
3347
source_ami_filter {
3448
filters = {
3549
name = "Windows_Server-2019-English-Core-ContainersLatest-*"
@@ -70,8 +84,10 @@ build {
7084
}
7185

7286
provisioner "powershell" {
73-
inline = [templatefile("./windows-provisioner.ps1", {
74-
action_runner_url = var.action_runner_url
75-
})]
87+
inline = concat([
88+
templatefile("./windows-provisioner.ps1", {
89+
action_runner_url = var.action_runner_url
90+
})
91+
], var.custom_shell_commands)
7692
}
7793
}

0 commit comments

Comments
 (0)