actions-runner-controller/controllers
Yusuke Kuoka fabead8c8e
feat: Workflow job based ephemeral runner scaling (#721)
This add support for two upcoming enhancements on the GitHub side of self-hosted runners, ephemeral runners, and `workflow_jow` events. You can't use these yet.

**These features are not yet generally available to all GitHub users**. Please take this pull request as a preparation to make it available to actions-runner-controller users as soon as possible after GitHub released the necessary features on their end.

**Ephemeral runners**:

The former, ephemeral runners, is basically the reliable alternative to `--once`, which we've been using when you enabled `ephemeral: true` (default in actions-runner-controller).

`--once` has been suffering from a race issue #466. `--ephemeral` fixes that.

To enable ephemeral runners with `actions/runner`, you give `--ephemeral` to `config.sh`. This updated version of `actions-runner-controller` does it for you, by using `--ephemeral` instead of `--once` when you set `RUNNER_FEATURE_FLAG_EPHEMERAL=true`.

Please read the section `Ephemeral Runners` in the updated version of our README for more information.

Note that ephemeral runners is not released on GitHub yet. And `RUNNER_FEATURE_FLAG_EPHEMERAL=true` won't work at all until the feature gets released on GitHub. Stay tuned for an announcement from GitHub!

**`workflow_job` events**:

`workflow_job` is the additional webhook event that corresponds to each GitHub Actions workflow job run. It provides `actions-runner-controller` a solid foundation to improve our webhook-based autoscale.

Formerly, we've been exploiting webhook events like `check_run` for autoscaling. However, as none of our supported events has included `labels`, you had to configure an HRA to only match relevant `check_run` events. It wasn't trivial.

In contrast, a `workflow_job` event payload contains `labels` of runners requested. `actions-runner-controller` is able to automatically decide which HRA to scale by filtering the corresponding RunnerDeployment by `labels` included in the webhook payload. So all you need to use webhook-based autoscale will be to enable `workflow_job` on GitHub and expose actions-runner-controller's webhook server to the internet.

Note that the current implementation of `workflow_job` support works in two ways, increment, and decrement. An increment happens when the webhook server receives` workflow_job` of `queued` status. A decrement happens when it receives `workflow_job` of `completed` status. The latter is used to make scaling-down faster so that you waste money less than before. You still don't suffer from flapping, as a scale-down is still subject to `scaleDownDelaySecondsAfterScaleOut `.

Please read the section `Example 3: Scale on each `workflow_job` event` in the updated version of our README for more information on its usage.
2021-08-11 09:52:04 +09:00
..
metrics Clean up import list (#645) 2021-06-22 17:55:06 +09:00
testdata Fix panic on webhook for user-owned repository (#344) 2021-02-23 08:05:25 +09:00
autoscaling.go Add HRA support for RunnerSet (#647) 2021-06-23 20:25:03 +09:00
autoscaling_test.go Add HRA support for RunnerSet (#647) 2021-06-23 20:25:03 +09:00
horizontal_runner_autoscaler_webhook.go feat: Workflow job based ephemeral runner scaling (#721) 2021-08-11 09:52:04 +09:00
horizontal_runner_autoscaler_webhook_on_check_run.go Add POC of GitHub Webhook Delivery Forwarder (#682) 2021-07-14 10:18:55 +09:00
horizontal_runner_autoscaler_webhook_on_pull_request.go Add POC of GitHub Webhook Delivery Forwarder (#682) 2021-07-14 10:18:55 +09:00
horizontal_runner_autoscaler_webhook_on_push.go Add POC of GitHub Webhook Delivery Forwarder (#682) 2021-07-14 10:18:55 +09:00
horizontal_runner_autoscaler_webhook_test.go Add POC of GitHub Webhook Delivery Forwarder (#682) 2021-07-14 10:18:55 +09:00
horizontalrunnerautoscaler_controller.go Add HRA support for RunnerSet (#647) 2021-06-23 20:25:03 +09:00
horizontalrunnerautoscaler_controller_test.go Clean up import list (#645) 2021-06-22 17:55:06 +09:00
integration_test.go Add POC of GitHub Webhook Delivery Forwarder (#682) 2021-07-14 10:18:55 +09:00
pod_runner_token_injector.go RunnerSet: Automatic-recovery from registration timeout and deregistration on pod termination (#652) 2021-06-24 20:39:37 +09:00
runner_controller.go Allow disabling /runner emptydir mounts and setting storage volume (#674) 2021-07-15 06:29:58 +09:00
runner_pod_controller.go Add POC of GitHub Webhook Delivery Forwarder (#682) 2021-07-14 10:18:55 +09:00
runnerdeployment_controller.go Clean up import list (#645) 2021-06-22 17:55:06 +09:00
runnerdeployment_controller_test.go Clean up import list (#645) 2021-06-22 17:55:06 +09:00
runnerreplicaset_controller.go Add POC of GitHub Webhook Delivery Forwarder (#682) 2021-07-14 10:18:55 +09:00
runnerreplicaset_controller_test.go Clean up import list (#645) 2021-06-22 17:55:06 +09:00
runnerset_controller.go Adding a default docker registry mirror (#689) 2021-07-15 06:20:08 +09:00
schedule.go Experimental support for ScheduledOverrides (#515) 2021-05-03 23:31:17 +09:00
schedule_test.go Experimental support for ScheduledOverrides (#515) 2021-05-03 23:31:17 +09:00
suite_test.go Clean up import list (#645) 2021-06-22 17:55:06 +09:00
utils.go feat: EKS IAM Roles for Service Accounts for Runner Pods (#226) 2020-12-08 17:56:06 +09:00
utils_test.go feat: EKS IAM Roles for Service Accounts for Runner Pods (#226) 2020-12-08 17:56:06 +09:00