-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add multi-runner capability (#2472)
* feat: Remove support check_run (#2521) * chore: Remove support check_run * format, lint * feat: Remove old scale down mechanism (< 0.19.0) (#2519) fix: Remove old cleanup mechanism (< 0.19.0) * feat: added changes for multi runner. * fix: region. * fix: more fixes. * tuple to list. * fixes. * fixes. * fixes. * fixes. * fixes. * fixes. * fix: formatting. * fix: formatting. * fix: formatting. * fix: moved some blocks outside runner config. * fix: few more updates * fix: liniting. * fix: updated example output * changed runner group name. * fix: updated the tests. * fix: addressed review comments. * fix: linting issues. * fix: formatting. * fix: updated tf version. * fix: Remove removed prerelease option * Add ubuntu runner to example * refactor: use each instead of count * fix: few small issues. * refactor: syncer to count for multi runner * fix: comments. * fix: added Readme. * fix: errors. * move variable to runner config * fix: updated the readme. * Add todos * feat: added windows runner configuration, completed todos and added the weight for runner config matchers. * chore: Update docs * fix: reverted tf versions. * fix: addressed comments. * fix: missed. * fix: formatting. * Update terraform versions in CI * Update terraform versions in CI * Update docs * fix: coverage. * Update docs * improve test coverage webhook * Apply suggestions from code review * fix: formatting. * fix: fixed merge issues. * fix: syntax. Co-authored-by: Niek Palm <npalm@users.noreply.github.com> Co-authored-by: Niek Palm <niek.palm@philips.com> Co-authored-by: navdeepg2021 <navdeepg2021@gmail.com>
- Loading branch information
1 parent
6533242
commit 5e17d6f
Showing
42 changed files
with
1,842 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Action runners deployment of Multiple-Runner-Configurations-Together example | ||
|
||
This module shows how to create GitHub action runners with multiple runner configuration together in one deployment. This example has the configurations for the following runner types with the relevant labels supported by them as matchers: | ||
|
||
- Linux ARM64 `["self-hosted", "linux", "arm64", "amazon"]` | ||
- Linux Ubuntu `["self-hosted", "linux", "x64", "ubuntu"]` | ||
- Linux X64 `["self-hosted", "linux", "x64", "amazon"]` | ||
- Windows X64 `["self-hosted", "windows", "x64", "servercore-2022"]` | ||
|
||
The module will decide the runner for the workflow job based on the match in the labels defined in the workflow job and runner configuration. Also the runner configuration allows the match to be exact or non-exact match. We recommend to use only exact matches. | ||
|
||
For exact match, all the labels defined in the workflow should be present in the runner configuration matchers and for non-exact match, some of the labels in the workflow, when present in runner configuration, shall be enough for the runner configuration to be used for the job. First the exact matchers are applied, next the non exact ones. | ||
|
||
## Webhook | ||
|
||
For the list of provided runner configurations, there will be a single webhook and only a single Github App to receive the notifications for all types of workflow triggers. | ||
|
||
## Lambda distribution | ||
|
||
Per combination of OS and architecture a lambda distribution syncer will be created. For this example there will be three instances (windows X64, linux X64, linux ARM). | ||
|
||
## Usages | ||
|
||
Steps for the full setup, such as creating a GitHub app can be found in the root module's [README](../../README.md). 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. | ||
|
||
> Ensure you have set the version in `lambdas-download/main.tf` for running the example. The version needs to be set to a GitHub release version, see https://github.com/philips-labs/terraform-aws-github-runner/releases | ||
```bash | ||
cd lambdas-download | ||
terraform init | ||
terraform apply | ||
cd .. | ||
``` | ||
|
||
Before running Terraform, ensure the GitHub app is configured. See the [configuration details](../../README.md#usages) for more details. | ||
|
||
```bash | ||
terraform init | ||
terraform apply | ||
``` | ||
|
||
You can receive the webhook details by running: | ||
|
||
```bash | ||
terraform output -raw webhook_secret | ||
``` | ||
|
||
Be-aware some shells will print some end of line character `%`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
locals { | ||
version = "<REPLACE_BY_GITHUB_RELEASE_VERSION>" | ||
} | ||
|
||
module "lambdas" { | ||
source = "../../../modules/download-lambda" | ||
lambdas = [ | ||
{ | ||
name = "webhook" | ||
tag = local.version | ||
}, | ||
{ | ||
name = "runners" | ||
tag = local.version | ||
}, | ||
{ | ||
name = "runner-binaries-syncer" | ||
tag = local.version | ||
} | ||
] | ||
} | ||
|
||
output "files" { | ||
value = module.lambdas.files | ||
} |
Oops, something went wrong.