Skip to content

Commit 9afab3c

Browse files
[CI] Pass Bucket Names Through to Runner Pods (#516)
This patch passes the per-cluster bucket names through to the runner pods in a custom env variable. This allows for configuring sccache inside the workflow to use the GCS buckets.
1 parent 3e616b2 commit 9afab3c

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

premerge/linux_runners_values.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,10 @@ template:
4444
limits:
4545
cpu: 64
4646
memory: "256Gi"
47-
47+
env:
48+
# We pass the GCS bucket name in as an environment variable as it is
49+
# different per cluster. We do not directly pass this to sccache
50+
# through the SCCACHE_GCS_BUCKET variable so that we can control how
51+
# sccache is caching directly in the workflow.
52+
- name: CACHE_GCS_BUCKET
53+
value: ${ cache_gcs_bucket }

premerge/premerge_resources/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ resource "helm_release" "github_actions_runner_set_linux" {
152152
chart = "gha-runner-scale-set"
153153

154154
values = [
155-
"${templatefile("linux_runners_values.yaml", { runner_group_name : var.runner_group_name })}"
155+
"${templatefile("linux_runners_values.yaml", { runner_group_name : var.runner_group_name, cache_gcs_bucket : format("%s-object-cache-linux", var.cluster_name) })}"
156156
]
157157

158158
depends_on = [
@@ -170,7 +170,7 @@ resource "helm_release" "github_actions_runner_set_windows_2022" {
170170
chart = "gha-runner-scale-set"
171171

172172
values = [
173-
"${templatefile("windows_2022_runner_values.yaml", { runner_group_name : var.runner_group_name })}"
173+
"${templatefile("windows_2022_runner_values.yaml", { runner_group_name : var.runner_group_name, cache_gcs_bucket : format("%s-object-cache-windows", var.cluster_name) })}"
174174
]
175175

176176
depends_on = [

premerge/windows_2022_runner_values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ template:
3333
env:
3434
- name: DISABLE_RUNNER_UPDATE
3535
value: "true"
36+
# We pass the GCS bucket name in as an environment variable as it is
37+
# different per cluster. We do not directly pass this to sccache
38+
# through the SCCACHE_GCS_BUCKET variable so that we can control how
39+
# sccache is caching directly in the workflow.
40+
- name: CACHE_GCS_BUCKET
41+
value: ${ cache_gcs_bucket }
3642
# Add a volume/mount it to C:/_work so that we can use more than 20GB
3743
# of space. Windows containers default to only having 20GB of scratch
3844
# space and there is no way to configure this through kubernetes

0 commit comments

Comments
 (0)