Skip to content

Commit 1bf7128

Browse files
[CI] Add Bazel Object Cache Bucket (#650)
So the handful of bazel jobs that we run a week will have a cache to read/write from, which should significantly improve performance.
1 parent 1ba6d13 commit 1bf7128

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

premerge/gke_cluster/main.tf

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,27 @@ resource "google_storage_bucket" "object_cache_linux" {
255255
}
256256
}
257257

258+
resource "google_storage_bucket" "object_cache_linux_bazel" {
259+
name = format("%s-object-cache-linux-bazel", var.cluster_name)
260+
location = var.gcs_bucket_location
261+
262+
uniform_bucket_level_access = true
263+
public_access_prevention = "enforced"
264+
265+
soft_delete_policy {
266+
retention_duration_seconds = 0
267+
}
268+
269+
lifecycle_rule {
270+
action {
271+
type = "Delete"
272+
}
273+
condition {
274+
age = 7
275+
}
276+
}
277+
}
278+
258279
resource "google_storage_bucket" "object_cache_windows" {
259280
name = format("%s-object-cache-windows", var.cluster_name)
260281
location = var.gcs_bucket_location
@@ -310,6 +331,19 @@ resource "google_storage_bucket_iam_binding" "linux_bucket_binding" {
310331
]
311332
}
312333

334+
resource "google_storage_bucket_iam_binding" "linux_bucket_bazel_binding" {
335+
bucket = google_storage_bucket.object_cache_linux_bazel.name
336+
role = "roles/storage.objectUser"
337+
members = [
338+
format("serviceAccount:%s", google_service_account.object_cache_linux_gsa.email),
339+
]
340+
341+
depends_on = [
342+
google_storage_bucket.object_cache_linux_bazel,
343+
google_service_account.object_cache_linux_gsa,
344+
]
345+
}
346+
313347
resource "google_storage_bucket_iam_binding" "windows_bucket_binding" {
314348
bucket = google_storage_bucket.object_cache_windows.name
315349
role = "roles/storage.objectUser"

0 commit comments

Comments
 (0)