Skip to content

Commit beae497

Browse files
authored
Merge branch 'actions:master' into master
2 parents 7e34ae9 + 68787be commit beae497

File tree

12 files changed

+75
-27
lines changed

12 files changed

+75
-27
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,15 @@ updates:
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "weekly"
12+
groups:
13+
gomod:
14+
patterns:
15+
- "*"
16+
- package-ecosystem: github-actions
17+
directory: "/"
18+
schedule:
19+
interval: "weekly"
20+
groups:
21+
actions:
22+
patterns:
23+
- "*"

.github/workflows/gha-validate-chart.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,17 @@ jobs:
123123
if: steps.list-changed.outputs.changed == 'true'
124124
run: |
125125
ct install --config charts/.ci/ct-config-gha.yaml
126+
test-chart:
127+
name: Test Chart
128+
runs-on: ubuntu-latest
129+
steps:
130+
- name: Checkout
131+
uses: actions/checkout@v4
132+
- uses: actions/setup-go@v5
133+
with:
134+
go-version-file: "go.mod"
135+
cache: false
136+
- name: Test gha-runner-scale-set
137+
run: go test ./charts/gha-runner-scale-set/...
138+
- name: Test gha-runner-scale-set-controller
139+
run: go test ./charts/gha-runner-scale-set-controller/...

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endif
66
DOCKER_USER ?= $(shell echo ${DOCKER_IMAGE_NAME} | cut -d / -f1)
77
VERSION ?= dev
88
COMMIT_SHA = $(shell git rev-parse HEAD)
9-
RUNNER_VERSION ?= 2.321.0
9+
RUNNER_VERSION ?= 2.322.0
1010
TARGETPLATFORM ?= $(shell arch)
1111
RUNNER_NAME ?= ${DOCKER_USER}/actions-runner
1212
RUNNER_TAG ?= ${VERSION}

charts/gha-runner-scale-set-controller/tests/template_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ func TestTemplate_ControllerDeployment_Defaults(t *testing.T) {
366366
"--metrics-addr=0",
367367
"--listener-metrics-addr=0",
368368
"--listener-metrics-endpoint=",
369+
"--runner-max-concurrent-reconciles=2",
369370
}
370371
assert.ElementsMatch(t, expectedArgs, deployment.Spec.Template.Spec.Containers[0].Args)
371372

@@ -518,6 +519,7 @@ func TestTemplate_ControllerDeployment_Customize(t *testing.T) {
518519
"--listener-metrics-addr=0",
519520
"--listener-metrics-endpoint=",
520521
"--metrics-addr=0",
522+
"--runner-max-concurrent-reconciles=2",
521523
}
522524

523525
assert.ElementsMatch(t, expectArgs, deployment.Spec.Template.Spec.Containers[0].Args)
@@ -646,6 +648,7 @@ func TestTemplate_EnableLeaderElection(t *testing.T) {
646648
"--listener-metrics-addr=0",
647649
"--listener-metrics-endpoint=",
648650
"--metrics-addr=0",
651+
"--runner-max-concurrent-reconciles=2",
649652
}
650653

651654
assert.ElementsMatch(t, expectedArgs, deployment.Spec.Template.Spec.Containers[0].Args)
@@ -686,6 +689,7 @@ func TestTemplate_ControllerDeployment_ForwardImagePullSecrets(t *testing.T) {
686689
"--listener-metrics-addr=0",
687690
"--listener-metrics-endpoint=",
688691
"--metrics-addr=0",
692+
"--runner-max-concurrent-reconciles=2",
689693
}
690694

691695
assert.ElementsMatch(t, expectedArgs, deployment.Spec.Template.Spec.Containers[0].Args)
@@ -776,6 +780,7 @@ func TestTemplate_ControllerDeployment_WatchSingleNamespace(t *testing.T) {
776780
"--listener-metrics-addr=0",
777781
"--listener-metrics-endpoint=",
778782
"--metrics-addr=0",
783+
"--runner-max-concurrent-reconciles=2",
779784
}
780785

781786
assert.ElementsMatch(t, expectedArgs, deployment.Spec.Template.Spec.Containers[0].Args)

charts/gha-runner-scale-set/values.yaml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,40 @@
22
## ex: https://github.com/myorg/myrepo or https://github.com/myorg
33
githubConfigUrl: ""
44

5-
## githubConfigSecret is the k8s secrets to use when auth with GitHub API.
6-
## You can choose to use GitHub App or a PAT token
5+
## githubConfigSecret is the k8s secret information to use when authenticating via the GitHub API.
6+
## You can choose to supply:
7+
## A) a PAT token,
8+
## B) a GitHub App, or
9+
## C) a pre-defined Kubernetes secret.
10+
## The syntax for each of these variations is documented below.
11+
## (Variation A) When using a PAT token, the syntax is as follows:
712
githubConfigSecret:
8-
### GitHub Apps Configuration
9-
## NOTE: IDs MUST be strings, use quotes
10-
#github_app_id: ""
11-
#github_app_installation_id: ""
12-
#github_app_private_key: |
13-
14-
### GitHub PAT Configuration
15-
github_token: ""
16-
## If you have a pre-define Kubernetes secret in the same namespace the gha-runner-scale-set is going to deploy,
17-
## you can also reference it via `githubConfigSecret: pre-defined-secret`.
18-
## You need to make sure your predefined secret has all the required secret data set properly.
13+
# Example:
14+
# github_token: "ghp_sampleSampleSampleSampleSampleSample"
15+
github_token: ""
16+
#
17+
## (Variation B) When using a GitHub App, the syntax is as follows:
18+
# githubConfigSecret:
19+
# # NOTE: IDs MUST be strings, use quotes
20+
# github_app_id: ""
21+
# github_app_installation_id: ""
22+
# github_app_private_key: |
23+
# private key line 1
24+
# private key line 2
25+
# .
26+
# .
27+
# .
28+
# private key line N
29+
#
30+
## (Variation C) When using a pre-defined Kubernetes secret in the same namespace that the gha-runner-scale-set is going to deploy,
31+
## the syntax is as follows:
32+
# githubConfigSecret: pre-defined-secret
33+
## Notes on using pre-defined Kubernetes secrets:
34+
## You need to make sure your predefined secret has all the required secret data set properly.
1935
## For a pre-defined secret using GitHub PAT, the secret needs to be created like this:
2036
## > kubectl create secret generic pre-defined-secret --namespace=my_namespace --from-literal=github_token='ghp_your_pat'
2137
## For a pre-defined secret using GitHub App, the secret needs to be created like this:
2238
## > kubectl create secret generic pre-defined-secret --namespace=my_namespace --from-literal=github_app_id=123456 --from-literal=github_app_installation_id=654321 --from-literal=github_app_private_key='-----BEGIN CERTIFICATE-----*******'
23-
# githubConfigSecret: pre-defined-secret
2439

2540
## proxy can be used to define proxy settings that will be used by the
2641
## controller, the listener and the runner of this scale set.

cmd/ghalistener/config/config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,15 @@ func Read(path string) (Config, error) {
4646
return Config{}, fmt.Errorf("failed to decode config: %w", err)
4747
}
4848

49-
if err := config.validate(); err != nil {
49+
if err := config.Validate(); err != nil {
5050
return Config{}, fmt.Errorf("failed to validate config: %w", err)
5151
}
5252

5353
return config, nil
5454
}
5555

56-
func (c *Config) validate() error {
56+
// Validate checks the configuration for errors.
57+
func (c *Config) Validate() error {
5758
if len(c.ConfigureUrl) == 0 {
5859
return fmt.Errorf("GitHubConfigUrl is not provided")
5960
}

cmd/ghalistener/config/config_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestConfigValidationMinMax(t *testing.T) {
1717
MaxRunners: 2,
1818
Token: "token",
1919
}
20-
err := config.validate()
20+
err := config.Validate()
2121
assert.ErrorContains(t, err, "MinRunners '5' cannot be greater than MaxRunners '2", "Expected error about MinRunners > MaxRunners")
2222
}
2323

@@ -28,7 +28,7 @@ func TestConfigValidationMissingToken(t *testing.T) {
2828
EphemeralRunnerSetName: "deployment",
2929
RunnerScaleSetId: 1,
3030
}
31-
err := config.validate()
31+
err := config.Validate()
3232
expectedError := fmt.Sprintf("GitHub auth credential is missing, token length: '%d', appId: '%d', installationId: '%d', private key length: '%d", len(config.Token), config.AppID, config.AppInstallationID, len(config.AppPrivateKey))
3333
assert.ErrorContains(t, err, expectedError, "Expected error about missing auth")
3434
}
@@ -42,7 +42,7 @@ func TestConfigValidationAppKey(t *testing.T) {
4242
EphemeralRunnerSetName: "deployment",
4343
RunnerScaleSetId: 1,
4444
}
45-
err := config.validate()
45+
err := config.Validate()
4646
expectedError := fmt.Sprintf("GitHub auth credential is missing, token length: '%d', appId: '%d', installationId: '%d', private key length: '%d", len(config.Token), config.AppID, config.AppInstallationID, len(config.AppPrivateKey))
4747
assert.ErrorContains(t, err, expectedError, "Expected error about missing auth")
4848
}
@@ -58,7 +58,7 @@ func TestConfigValidationOnlyOneTypeOfCredentials(t *testing.T) {
5858
EphemeralRunnerSetName: "deployment",
5959
RunnerScaleSetId: 1,
6060
}
61-
err := config.validate()
61+
err := config.Validate()
6262
expectedError := fmt.Sprintf("only one GitHub auth method supported at a time. Have both PAT and App auth: token length: '%d', appId: '%d', installationId: '%d', private key length: '%d", len(config.Token), config.AppID, config.AppInstallationID, len(config.AppPrivateKey))
6363
assert.ErrorContains(t, err, expectedError, "Expected error about missing auth")
6464
}
@@ -74,7 +74,7 @@ func TestConfigValidation(t *testing.T) {
7474
Token: "asdf",
7575
}
7676

77-
err := config.validate()
77+
err := config.Validate()
7878

7979
assert.NoError(t, err, "Expected no error")
8080
}
@@ -86,7 +86,7 @@ func TestConfigValidationConfigUrl(t *testing.T) {
8686
RunnerScaleSetId: 1,
8787
}
8888

89-
err := config.validate()
89+
err := config.Validate()
9090

9191
assert.ErrorContains(t, err, "GitHubConfigUrl is not provided", "Expected error about missing ConfigureUrl")
9292
}

docs/about-arc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ kubectl set env deploy controller-manager -c manager GITHUB_ENTERPRISE_URL=<GHEC
157157
The project supports being deployed on the various cloud Kubernetes platforms (e.g. EKS), it does not however aim to go beyond that. No cloud specific tooling is bundled in the base runner, this is an active decision to keep the overhead of maintaining the solution manageable.
158158

159159
**Bundled Software**<br />
160-
The GitHub hosted runners include a large amount of pre-installed software packages. GitHub maintains a list in README files at <https://github.com/actions/virtual-environments/tree/main/images/linux>.
160+
The GitHub hosted runners include a large amount of pre-installed software packages. GitHub maintains a list in README files at <https://github.com/actions/runner-images/blob/main/images/ubuntu/>.
161161

162162
This solution maintains a few Ubuntu based runner images, these images do not contain all of the software installed on the GitHub runners. The images contain the following subset of packages from the GitHub runners:
163163

docs/automatically-scaling-runners.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ resources:
430430
- github.com/actions/actions-runner-controller/config//default?ref=v0.22.2
431431
# Add the below!
432432
- github.com/actions/actions-runner-controller/config//github-webhook-server?ref=v0.22.2
433+
```
433434

434435
Finally, you will have to configure an ingress so that you may configure the webhook in github. An example of such ingress can be find below:
435436

runner/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ DIND_ROOTLESS_RUNNER_NAME ?= ${DOCKER_USER}/actions-runner-dind-rootless
66
OS_IMAGE ?= ubuntu-22.04
77
TARGETPLATFORM ?= $(shell arch)
88

9-
RUNNER_VERSION ?= 2.321.0
9+
RUNNER_VERSION ?= 2.322.0
1010
RUNNER_CONTAINER_HOOKS_VERSION ?= 0.6.2
1111
DOCKER_VERSION ?= 24.0.7
1212

0 commit comments

Comments
 (0)