Commit Graph

731 Commits

Author SHA1 Message Date
Tristan Keen 4320e0e5e1 New generated CRDs 2021-09-14 17:12:09 +09:00
Tristan Keen 4a61c2f3aa Revert CRD workaround for K8s v1.18 2021-09-14 17:12:09 +09:00
Tristan Keen 1eb135cace Correct default image logic 2021-09-14 17:00:57 +09:00
Tristan Keen d918c91bea Complete CRDs for acceptance testing 2021-09-14 17:00:39 +09:00
Sebastien Le Digabel bf35c51440 Adding unit test for ephemeral feature flag
This was something that was missing in #707.
Adding a new test to make sure the ephemeral feature flag from upstream
is set up correctly by the script.
2021-09-14 16:37:25 +09:00
Yusuke Kuoka b679a54196 Add missing //go:build tag on deepcopy source
But not sure why this is needed yet :)
2021-09-14 16:37:04 +09:00
Rolf Ahrenberg 5da808af96 Allow defining unique election leader id 2021-09-14 16:37:04 +09:00
Rolf Ahrenberg e5b5ee6f1d Make target platform configurable for runner builds 2021-09-14 16:37:04 +09:00
Rolf Ahrenberg cf3abcc7d6 Reorder docker build parameters 2021-09-14 16:37:04 +09:00
Rolf Ahrenberg cffc2585f9 Use unique serving cert name
Based on the comments in https://github.com/actions-runner-controller/actions-runner-controller/issues/782
2021-09-14 16:37:04 +09:00
Renovate Bot 01928863b9 chore(deps): update dependency actions/runner to v2.282.0 2021-09-13 21:07:46 +00:00
Sebastien Le Digabel a98729b08b Adding github action for entrypoint unit test
... and adding safety mechanism in UNITTEST handling.
2021-09-06 08:51:28 +09:00
Sebastien Le Digabel ec0915ce7c Adding some unit testing for entrypoint.sh
The unit tests are simulating a run for entrypoint. It creates some
dummy config.sh and runsvc.sh and makes sure the logic behind
entrypoint.sh is correct.

Unfortunately the entrypoint.sh contains some sections that are not
mockable so I had to put some logic in there too.

Testing includes for now:
- the normal scenario
- the normal non-ephemeral scenario
- the configuration failure scenario

Also tested the entrypoint.sh on a real runner, still works as expected.
2021-09-06 08:51:28 +09:00
Sebastien Le Digabel d355f05ac0 Adding retry after config and formatted logging
Adding a basic retry loop during configuration. If configuration fails,
the runner will just straight into a retry loop and will continuously
fail until it dies after a while.

This change will retry 10 times and will exit if the configuration
wasn't successful.

Also, changed the logging format, adding a bit of color in the event of
success or failure.
2021-09-06 08:51:28 +09:00
toast-gear 6f27b4920e
docs: watch namespace feature (#786)
Fixes #455
2021-09-06 08:46:01 +09:00
Renovate Bot f8959f973f chore(deps): update dependency actions/runner to v2.281.1 2021-09-01 23:01:06 +00:00
renovate[bot] 37955fa267
fix(deps): update module go.uber.org/zap to v1.19.0 (#748)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-31 09:58:52 +09:00
renovate[bot] 63fe89b7aa
fix(deps): update golang.org/x/oauth2 commit hash to 2bc19b1 (#739)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-31 09:50:34 +09:00
Tarasovych 3f801af72a
Update README.md (#774) 2021-08-31 09:47:20 +09:00
Tarasovych 7008b0c257
feat: Organization RunnerDeployment with webhook-based autoscaling only for certain repositories (#766)
Resolves #765

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2021-08-31 09:46:36 +09:00
Tarasovych d9df455781
Update README.md (#775)
Update organization App url query parameters
2021-08-31 09:44:29 +09:00
renovate[bot] 7e42d3fa7c
chore(deps): update dependency actions/runner to v2.281.0 (#777)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-31 09:42:25 +09:00
Sam 0593125d96
Add dnsConfig to runner deployments (#764)
Resolves #761
2021-08-31 09:42:05 +09:00
Patrick Ellis a815c37614
docs: fix a few small YAML typos (#763)
- Remove two extra colons that were making the yaml invalid 🕵️
- Add `yaml` tags to the markdown blocks 🧹
2021-08-25 09:13:20 +01:00
renovate[bot] 3539569fed
chore(deps): update helm/chart-releaser-action action to v1.2.1 (#742)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-25 09:29:31 +09:00
renovate[bot] fc131870aa
chore(deps): update helm/chart-testing-action action to v2.1.0 (#743)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-25 09:27:52 +09:00
renovate[bot] 382afa4450
chore(deps): update helm/kind-action action to v1.2.0 (#744)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-25 09:27:26 +09:00
renovate[bot] 5125dd7e77
chore(deps): update golang docker tag to v1.17 (#741)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-25 09:26:51 +09:00
Yusuke Kuoka 2c711506ea
Update documentation about epehemral runners and RunnerSet (#727)
Follow-up for #721 and #629
2021-08-25 09:26:26 +09:00
Tarasovych dfa0f2eef4
Update README.md (#735)
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
2021-08-25 09:25:51 +09:00
Yusuke Kuoka 180db37a9a
Merge pull request #762 from actions-runner-controller/non-deprecate-apis-follow-up
chart,kustomize: Fix errors
2021-08-25 09:23:23 +09:00
Yusuke Kuoka 424c33b11f kustomize: Fix error while generating release manifests
This fixes the below error that occurs in `make release`:

```
kustomize build config/default > release/actions-runner-controller.yaml
Error: accumulating resources: accumulation err='accumulating resources from '../webhook': '/home/mumoshu/p/actions-runner-controller/config/webhook' must resolve to a file': recursed accumulation of path '/home/mumoshu/p/actions-runner-controller/config/webhook': accumulating resources: accumulation err='accumulating resources from 'manifests.v1beta1.yaml': evalsymlink failure on '/home/mumoshu/p/actions-runner-controller/config/webhook/manifests.v1beta1.yaml' : lstat /home/mumoshu/p/actions-runner-controller/config/webhook/manifests.v1beta1.yaml: no such file or directory': evalsymlink failure on '/home/mumoshu/p/actions-runner-controller/config/webhook/manifests.v1beta1.yaml' : lstat /home/mumoshu/p/actions-runner-controller/config/webhook/manifests.v1beta1.yaml: no such file or directory
make: *** [Makefile:156: release] Error 1
```

Ref #144
2021-08-25 00:11:43 +00:00
Yusuke Kuoka 34d9c6d4db chart: Fix webhook config installation error
This fixes the below error on installing the chart:

```
Error: UPGRADE FAILED: error validating "": error validating data: [ValidationError(MutatingWebhookConfiguration.webhooks[0]): missing required field "admissionReviewVersions" in io.k8s.api.admissionregistration.v1.MutatingWebhook, ValidationError(MutatingWebhookConfiguration.webhooks[1]): missing required field "admissionReviewVersions" in io.k8s.api.admissionregistration.v1.MutatingWebhook, ValidationError(MutatingWebhookConfiguration.webhooks[2]): missing required field "admissionReviewVersions" in io.k8s.api.admissionregistration.v1.MutatingWebhook, ValidationError(MutatingWebhookConfiguration.webhooks[3]): missing required field "admissionReviewVersions" in io.k8s.api.admissionregistration.v1.MutatingWebhook]
```

Ref #144
2021-08-25 00:07:49 +00:00
Yusuke Kuoka 167c5b4dc9
Use non-deprecated API versions in CRDs and Webhooks (#733)
Resolves #144
2021-08-24 10:31:36 +09:00
Patrick Ellis 91c22ef964
doc: GitHub calls it `admin:enterprise`, not `enterprise:admin` (#759) 2021-08-24 10:26:43 +09:00
Hidetake Iwata 5d292ee5ff
Update actions/runner by Renovate (#734)
Resolves #416
2021-08-23 09:33:47 +09:00
toast-gear 5b4b65664c
chore: bump actions runner version (#736) 2021-08-19 14:47:17 +01:00
toast-gear b6465c5d09
chore: bump docker and runner version and add imageos env var (#730)
* chore: bump runner version

* chore: bump docker version

* feat: add in ImageOS env var

* chore: adding missing fail switches
2021-08-18 15:50:17 +01:00
Hiroki Matsumoto dc9f9b0bfb
fix: arch type with downloading dumb-init. (#723)
* fix: arch type with downloading dumb-init.

* fix: arch type with downloading dumb-init in Dockerfile.dindrunner

* fix: add -f option with curl
2021-08-11 16:43:25 +01:00
toast-gear 02e05bdafb
ci: set username statically (#724)
Co-authored-by: Callum James Tait <callum.tait@photobox.com>
2021-08-11 20:03:37 +09:00
callum-tait-pbx a9421edd46
chore: bump dumb-init (#710)
* chore: bump dumb-init and align files

* ci: align make file with root make file
2021-08-11 09:55:09 +09:00
Rob Bos fb66b28569
Change `move` command to `copy` to prevent issues (#716)
Prevents issues when /runner and /runnertmp are in different devices

Fixes #686
2021-08-11 09:53:42 +09:00
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
Rolf Ahrenberg d528d18211
Fix markdown header (#718) 2021-08-09 14:37:57 +01:00
toast-gear 7e593a80ff
docs: more improvements to the english used 2021-08-06 17:36:11 +01:00
toast-gear 27bdc780a3
docs: better english 2021-08-06 17:34:53 +01:00
toast-gear 3948406374
docs: using better english 2021-08-06 17:32:58 +01:00
toast-gear 743e6d6202
feat: bump runner version (#705)
* feat: bump runner version

* feat: remove deprecated env var

* docs: updating the docs

Co-authored-by: Callum James Tait <callum.tait@photobox.com>
2021-07-30 19:58:04 +09:00
Rolf Ahrenberg 29260549fa
Document volumeStorageMedium and volumeSizeLimit (#700)
Related to #674
2021-07-21 07:50:25 +09:00
Roee Landesman f17edd500b
Use https connection when metrics enabled for githubwebhook server (#685)
Relates to #625 and adds necessary RBAC permissions to fix #401 first reported [here](https://github.com/actions-runner-controller/actions-runner-controller/issues/656).

Co-authored-by: Roee Landesman <roee.landesman@sonos.com>
2021-07-16 10:19:38 +09:00