Skip to content

Commit b255d27

Browse files
authored
Merge pull request #1968 from philips-labs/develop
Release
2 parents 89b07fd + ad1c872 commit b255d27

File tree

10 files changed

+199
-163
lines changed

10 files changed

+199
-163
lines changed

.github/workflows/semantic-check.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Semantic Check"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
contents: read
12+
pull-requests: read
13+
14+
jobs:
15+
main:
16+
name: Semantic Commit Message Check
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- uses: amannn/action-semantic-pull-request@v4
22+
name: Check PR for Semantic Commit Message
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
requireScope: false
27+
validateSingleCommit: true
28+
ignoreLabels: release merge

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ For receiving the `check_run` or `workflow_job` event by the webhook (lambda), a
5555

5656
- `workflow_job`: **(preferred option)** create a webhook on enterprise, org or app level. Select this option for ephemeral runners.
5757
- `check_run`: create a webhook on enterprise, org, repo or app level. When using the app option, the app needs to be installed to repo's are using the self-hosted runners.
58-
- a Webhook needs to be created. The webhook hook can be defined on enterprise, org, repo, or app level.
58+
- a Webhook needs to be created. The webhook hook can be defined on enterprise, org, repo, or app level.
5959

6060
In AWS a [API gateway](https://docs.aws.amazon.com/apigateway/index.html) endpoint is created that is able to receive the GitHub webhook events via HTTP post. The gateway triggers the webhook lambda which will verify the signature of the event. This check guarantees the event is sent by the GitHub App. The lambda only handles `workflow_job` or `check_run` events with status `queued` and matching the runner labels (only for `workflow_job`). The accepted events are posted on a SQS queue. Messages on this queue will be delayed for a configurable amount of seconds (default 30 seconds) to give the available runners time to pick up this build.
6161

@@ -197,17 +197,18 @@ The lambda for syncing the GitHub distribution to S3 is triggered via CloudWatch
197197

198198
### Setup the webhook / GitHub App (part 2)
199199

200-
At this point you have 2 options. Either create a separate webhook (enterprise,
201-
org, or repo), or create webhook in the App.
200+
At this point you have 2 options. Either create a separate webhook (enterprise,
201+
org, or repo), or create webhook in the App.
202202

203203
#### Option 1: Webhook
204204

205205
1. Create a new webhook on repo level for repo level for repo level runner, or org (or enterprise level) for an org level runner.
206206
2. Provide the webhook url, should be part of the output of terraform.
207207
3. Provide the webhook secret (`terraform output -raw <NAME_OUTPUT_VAR>`).
208-
4. In the "Permissions & Events" section and then "Subscribe to Events" subsection, check either "Workflow Job" or "Check Run" (choose only 1 option!!!).
209-
5. In the "Install App" section, install the App in your organization, either in all or in selected repositories.
210-
208+
4. Ensure content type as `application/json`.
209+
5. In the "Permissions & Events" section and then "Subscribe to Events" subsection, check either "Workflow Job" or "Check Run" (choose only 1 option!!!).
210+
6. In the "Install App" section, install the App in your organization, either in all or in selected repositories.
211+
211212
#### Option 2: App
212213

213214
Go back to the GitHub App and update the following settings.
@@ -252,7 +253,7 @@ module "runners" {
252253

253254
### Pool
254255

255-
The module basically supports two options for keeping a pool of runners. One is via a pool which only supports org-level runners, the second option is [keeping runners idle](#idle-runners).
256+
The module basically supports two options for keeping a pool of runners. One is via a pool which only supports org-level runners, the second option is [keeping runners idle](#idle-runners).
256257

257258
The pool is introduced in combination with the ephemeral runners and is primary meant to ensure if any event is unexpected dropped, and no runner was created the pool can pick up the job. The pool is maintained by a lambda. Each time the lambda is triggered a check is preformed if the number of idler runners managed by the module are meeting the expected pool size. If not, the pool will be adjusted. Keep in mind that the scale down function is still active and will terminate instances that are detected as idle.
258259

@@ -304,10 +305,10 @@ For time zones please check [TZ database name column](https://en.wikipedia.org/w
304305
Currently a beta feature! You can configure runners to be ephemeral, runners will be used only for one job. The feature should be used in conjunction with listening for the workflow job event. Please consider the following:
305306

306307
- 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.
307-
- 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`.
308+
- 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`.
308309
- 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.
309310
- 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`.
310-
- 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.
311+
- 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.
311312

312313
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.
313314

@@ -345,7 +346,7 @@ The following sub modules are optional and are provided as example or utility:
345346

346347
### ARM64 configuration for submodules
347348

348-
When using the top level module configure `runner_architecture = "arm64"` and ensure the list of `instance_types` matches. When not using the top-level, ensure these properties are set on the submodules.
349+
When using the top level module configure `runner_architecture = "arm64"` and ensure the list of `instance_types` matches. When not using the top-level, ensure these properties are set on the submodules.
349350

350351
## Debugging
351352

modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
"@octokit/rest": "^18.12.0",
1919
"@trivago/prettier-plugin-sort-imports": "^3.2.0",
2020
"@types/jest": "^27.4.1",
21-
"@types/node": "^17.0.23",
21+
"@types/node": "^17.0.25",
2222
"@types/request": "^2.48.8",
2323
"@typescript-eslint/eslint-plugin": "^4.33.0",
2424
"@typescript-eslint/parser": "^4.33.0",
25-
"@vercel/ncc": "^0.33.3",
26-
"aws-sdk": "^2.1112.0",
25+
"@vercel/ncc": "^0.33.4",
26+
"aws-sdk": "^2.1116.0",
2727
"eslint": "^7.32.0",
2828
"eslint-plugin-prettier": "4.0.0",
2929
"jest": "^27.5.1",

modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/yarn.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -828,10 +828,10 @@
828828
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d"
829829
integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==
830830

831-
"@types/node@*", "@types/node@^17.0.23":
832-
version "17.0.23"
833-
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.23.tgz#3b41a6e643589ac6442bdbd7a4a3ded62f33f7da"
834-
integrity sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==
831+
"@types/node@*", "@types/node@^17.0.25":
832+
version "17.0.25"
833+
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.25.tgz#527051f3c2f77aa52e5dc74e45a3da5fb2301448"
834+
integrity sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==
835835

836836
"@types/prettier@^2.1.5":
837837
version "2.4.2"
@@ -950,10 +950,10 @@
950950
"@typescript-eslint/types" "4.33.0"
951951
eslint-visitor-keys "^2.0.0"
952952

953-
"@vercel/ncc@^0.33.3":
954-
version "0.33.3"
955-
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.33.3.tgz#aacc6b3ea9f7b175e0c9a18c9b97e4005a2f4fcc"
956-
integrity sha512-JGZ11QV+/ZcfudW2Cz2JVp54/pJNXbsuWRgSh2ZmmZdQBKXqBtIGrwI1Wyx8nlbzAiEFe7FHi4K1zX4//jxTnQ==
953+
"@vercel/ncc@^0.33.4":
954+
version "0.33.4"
955+
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.33.4.tgz#e44a87511f583b7ba88e4b9ae90eeb7ba252b872"
956+
integrity sha512-ln18hs7dMffelP47tpkaR+V5Tj6coykNyxJrlcmCormPqRQjB/Gv4cu2FfBG+PMzIfdZp2CLDsrrB1NPU22Qhg==
957957

958958
abab@^2.0.3, abab@^2.0.5:
959959
version "2.0.5"
@@ -1086,10 +1086,10 @@ asynckit@^0.4.0:
10861086
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
10871087
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
10881088

1089-
aws-sdk@^2.1112.0:
1090-
version "2.1112.0"
1091-
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1112.0.tgz#7e6f60df562ebd909a9435b01673ed7685e10ffd"
1092-
integrity sha512-8FKr3zwD2bHZQLmxJ7d1VwvDkW9kKx4YPdNXawV+CqNUzQC/9ZmSmHyx8mZCv6J722tqxIZh5c567499QawuZw==
1089+
aws-sdk@^2.1116.0:
1090+
version "2.1116.0"
1091+
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1116.0.tgz#1187ab943e6bf730db282afe7950dd2af409cb5b"
1092+
integrity sha512-36JFrxPPh/fRQWsgGrZZbzTxRu7dq4KyCKKXPxgVMXylEJsG/KEAVMB1f3eq4PiI5eGxYrpt2OkKoMQZQZLjPA==
10931093
dependencies:
10941094
buffer "4.9.2"
10951095
events "1.1.1"

modules/runners/lambdas/runners/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
"ts-node-dev": "^1.1.6"
3737
},
3838
"dependencies": {
39-
"@aws-sdk/client-ssm": "^3.67.0",
39+
"@aws-sdk/client-ssm": "^3.74.0",
4040
"@octokit/auth-app": "3.6.1",
4141
"@octokit/rest": "^18.12.0",
4242
"@octokit/types": "^6.34.0",
4343
"@types/aws-lambda": "^8.10.93",
4444
"@types/express": "^4.17.11",
45-
"@types/node": "^17.0.23",
46-
"aws-sdk": "^2.1112.0",
45+
"@types/node": "^17.0.26",
46+
"aws-sdk": "^2.1116.0",
4747
"cron-parser": "^4.3.0",
4848
"tslog": "^3.3.3",
4949
"typescript": "^4.6.3"

0 commit comments

Comments
 (0)