Skip to content

Commit 073ab72

Browse files
authored
Merge branch 'main' into iainlane/many-events
2 parents d6af260 + f5775a9 commit 073ab72

File tree

36 files changed

+212
-251
lines changed

36 files changed

+212
-251
lines changed

CHANGELOG.md

Lines changed: 23 additions & 15 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

docs/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To be able to support a number of use-cases, the module has quite a lot of confi
88
- Multi-Runner module. This modules allows you to create multiple runner configurations with a single webhook and single GitHub App to simplify deployment of different types of runners. Check the detailed module [documentation](modules/public/multi-runner.md) for more information or checkout the [multi-runner example](examples/multi-runner.md).
99
- Webhook mode, the module can be deployed in `direct` mode or `EventBridge` (Experimental) mode. The `direct` mode is the default and will directly distribute to SQS for the scale-up lambda. The `EventBridge` mode will publish the events to a eventbus, the rule then directs the received events to a dispatch lambda. The dispatch lambda will send the event to the SQS queue. The `EventBridge` mode is the default and allows to have more control over the events and potentially filter them. The `EventBridge` mode can be disabled, messages are sent directed to queues in that case. An example of what the `EventBridge` mode could be used for is building a data lake, build metrics, act on `workflow_job` job started events, etc.
1010
- Linux vs Windows. You can configure the OS types linux and win. Linux will be used by default.
11-
- Re-use vs Ephemeral. By default runners are re-used, until detected idle. Once idle they will be removed from the pool. To improve security we are introducing ephemeral runners. Those runners are only used for one job. Ephemeral runners only work in combination with the workflow job event. For ephemeral runners the lambda requests a JIT (just in time) configuration via the GitHub API to register the runner. [JIT configuration](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-just-in-time-runners) is limited to ephemeral runners (and currently not supported by GHES). For non-ephemeral runners, a registration token is always requested. In both cases the configuration is made available to the instance via the same SSM parameter. To disable JIT configuration for ephemeral runners set `enable_jit_config` to `false`. We also suggest using a pre-build AMI to improve the start time of jobs for ephemeral runners.
11+
- Reuse vs Ephemeral. By default runners are reused, until detected idle. Once idle they will be removed from the pool. To improve security we are introducing ephemeral runners. Those runners are only used for one job. Ephemeral runners only work in combination with the workflow job event. For ephemeral runners the lambda requests a JIT (just in time) configuration via the GitHub API to register the runner. [JIT configuration](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-just-in-time-runners) is limited to ephemeral runners (and currently not supported by GHES). For non-ephemeral runners, a registration token is always requested. In both cases the configuration is made available to the instance via the same SSM parameter. To disable JIT configuration for ephemeral runners set `enable_jit_config` to `false`. We also suggest using a pre-build AMI to improve the start time of jobs for ephemeral runners.
1212
- Job retry (**Beta**). By default the scale-up lambda will discard the message when it is handled. Meaning in the ephemeral use-case an instance is created. The created runner will ask GitHub for a job, no guarantee it will run the job for which it was scaling. Result could be that with small system hick-up the job is keeping waiting for a runner. Enable a pool (org runners) is one option to avoid this problem. Another option is to enable the job retry function. Which will retry the job after a delay for a configured number of times.
1313
- GitHub Cloud vs GitHub Enterprise Server (GHES). The runners support GitHub Cloud (Public GitHub - github.com), GitHub Data Residency instances (ghe.com), and GitHub Enterprise Server. For GHES, we rely on our community for support and testing. We have no capability to test GHES ourselves.
1414
- Spot vs on-demand. The runners use either the EC2 spot or on-demand life cycle. Runners will be created via the AWS [CreateFleet API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet.html). The module (scale up lambda) will request via the CreateFleet API to create instances in one of the subnets and of the specified instance types.
@@ -286,7 +286,7 @@ In case the setup does not work as intended, trace the events through this seque
286286

287287
This feature is in early stage and therefore disabled by default. To enable the watcher, set `instance_termination_watcher.enable = true`.
288288

289-
The termination watcher is currently watching for spot terminations. The module is only taken events into account for instances tagged with `ghr:environment` by default when deployment the module as part of one of the main modules (root or multi-runner). The module can also be deployed stand-alone, in this case, the tag filter needs to be tunned.
289+
The termination watcher is currently watching for spot terminations. The module is only taken events into account for instances tagged with `ghr:environment` by default when deployment the module as part of one of the main modules (root or multi-runner). The module can also be deployed stand-alone, in this case, the tag filter needs to be tuned.
290290

291291
### Termination notification
292292

@@ -352,7 +352,7 @@ locals {
352352
353353
resource "aws_cloudwatch_event_rule" "example" {
354354
name = "${local.prefix}-github-events-all"
355-
description = "Caputure all GitHub events"
355+
description = "Capture all GitHub events"
356356
event_bus_name = local.event_bus_name
357357
event_pattern = <<EOF
358358
{

examples/ephemeral/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module "runners" {
9292
# Enable debug logging for the lambda functions
9393
# log_level = "debug"
9494

95-
# Setup a dead letter queue, by default scale up lambda will kepp retrying to process event in case of scaling error.
95+
# Setup a dead letter queue, by default scale up lambda will keep retrying to process event in case of scaling error.
9696
# redrive_policy_build_queue = {
9797
# enabled = true
9898
# maxReceiveCount = 50 # 50 retries every 30 seconds => 25 minutes

examples/external-managed-ssm-secrets/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Example using AWS CLI:
5252

5353
Steps for the full setup, such as creating a GitHub app can be found in the root module's [README](https://github.com/philips-labs/terraform-aws-github-runner). First download the Lambda releases from GitHub. Alternatively you can build the lambdas locally with Node or Docker, there is a simple build script in `<root>/.ci/build.sh`. In the `main.tf` you can simply remove the location of the lambda zip files, the default location will work in this case.
5454

55-
> This example assumes local built lambda's available. Ensure you have built the lambda's. Alternativly you can downlowd the lambda's. The version needs to be set to a GitHub release version, see https://github.com/philips-labs/terraform-aws-github-runner/releases
55+
> This example assumes local built lambda's available. Ensure you have built the lambda's. Alternatively you can download the lambda's. The version needs to be set to a GitHub release version, see https://github.com/philips-labs/terraform-aws-github-runner/releases
5656
5757
```bash
5858
cd ../lambdas-download

examples/prebuilt/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module "runners" {
7979

8080
# `schedule_expression`: is used to configure the schedule for the lambda.
8181
# `enabled`: enable or disable the lambda trigger via the EventBridge.
82-
# `lambda_memory_size`: lambda memery size limit.
82+
# `lambda_memory_size`: lambda memory size limit.
8383
# `lambda_timeout`: timeout for the lambda in seconds.
8484
# `config`: configuration for the lambda function. Token path will be read by default from the module.
8585
# EOF

examples/termination-watcher/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This module shows how to use the termination watcher stand-alone.
44

55
## Usages
66

7-
Esnure your have the lambda for the termination locally build. By default the one in the lambdas folder will be used.
7+
Ensure your have the lambda for the termination locally build. By default the one in the lambdas folder will be used.
88

99
Build lambda's (requires node and yarn).
1010

@@ -20,7 +20,7 @@ terraform init
2020
terraform apply
2121
```
2222

23-
Once a Spot instance is terminated a log line and metric will be updated. Spot instance termination can be simulated using the Amazon [Fault Injection Service](https://docs.aws.amazon.com/fis/latest/userguide/what-is.html) (FIS). In thw web console you can simply initiate a spot instance failure by navigate in the EC2 console to Spot Requests and choose the action initiate a spot termination event.
23+
Once a Spot instance is terminated a log line and metric will be updated. Spot instance termination can be simulated using the Amazon [Fault Injection Service](https://docs.aws.amazon.com/fis/latest/userguide/what-is.html) (FIS). In the web console you can simply initiate a spot instance failure by navigate in the EC2 console to Spot Requests and choose the action initiate a spot termination event.
2424

2525
<!-- BEGIN_TF_DOCS -->
2626
## Requirements

images/install-runner.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
user_name=ec2-user
44

5-
## This wrapper file re-uses scripts in the /modules/runners/templates directory
5+
## This wrapper file reuses scripts in the /modules/runners/templates directory
66
## of this repo. These are the same that are used by the user_data functionality
77
## to bootstrap the instance if it is started from an existing AMI.
88
${install_runner}

images/install-runner.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
user_name=$(cat /tmp/install-user.txt)
44

5-
## This wrapper file re-uses scripts in the /modules/runners/templates directory
5+
## This wrapper file reuses scripts in the /modules/runners/templates directory
66
## of this repo. These are the same that are used by the user_data functionality
77
## to bootstrap the instance if it is started from an existing AMI.
88
${install_runner}

images/start-runner.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ exec > >(tee /var/log/runner-startup.log | logger -t user-data -s 2>/dev/console
33

44
cd /opt/actions-runner
55

6-
## This wrapper file re-uses scripts in the /modules/runners/templates directory
6+
## This wrapper file reuses scripts in the /modules/runners/templates directory
77
## of this repo. These are the same that are used by the user_data functionality
88
## to bootstrap the instance if it is started from an existing AMI.
99
${start_runner}

0 commit comments

Comments
 (0)