diff --git a/premerge/gke_cluster/main.tf b/premerge/gke_cluster/main.tf index 93069c31a..b6c199375 100644 --- a/premerge/gke_cluster/main.tf +++ b/premerge/gke_cluster/main.tf @@ -32,6 +32,14 @@ resource "google_container_cluster" "llvm_premerge" { } } +variable "microarchitecture_map" { + type = map(string) + default = { + "n2d" : "AMD Milan" + "n2-" : "Intel Ice Lake" + } +} + resource "google_container_node_pool" "llvm_premerge_linux_service" { name = "llvm-premerge-linux-service" location = var.region @@ -62,7 +70,8 @@ resource "google_container_node_pool" "llvm_premerge_linux" { } node_config { - machine_type = var.linux_machine_type + machine_type = var.linux_machine_type + min_cpu_platform = var.microarchitecture_map[substr(var.linux_machine_type, 0, 3)] taint { key = "premerge-platform" value = "linux" @@ -96,7 +105,8 @@ resource "google_container_node_pool" "llvm_buildbot_linux" { } node_config { - machine_type = var.linux_machine_type + machine_type = var.linux_machine_type + min_cpu_platform = var.microarchitecture_map[substr(var.linux_machine_type, 0, 3)] taint { key = "buildbot-platform" value = "linux" @@ -127,7 +137,8 @@ resource "google_container_node_pool" "llvm_premerge_libcxx" { } node_config { - machine_type = var.libcxx_machine_type + machine_type = var.libcxx_machine_type + min_cpu_platform = var.microarchitecture_map[substr(var.libcxx_machine_type, 0, 3)] taint { key = "premerge-platform-libcxx" value = "linux-libcxx" @@ -154,7 +165,8 @@ resource "google_container_node_pool" "llvm_premerge_windows_2022" { # We do not set a taint for the windows nodes as kubernetes by default sets # a node.kubernetes.io/os taint for windows nodes. node_config { - machine_type = var.windows_machine_type + machine_type = var.windows_machine_type + min_cpu_platform = var.microarchitecture_map[substr(var.windows_machine_type, 0, 3)] labels = { "premerge-platform" : "windows-2022" } @@ -204,7 +216,8 @@ resource "google_container_node_pool" "llvm_buildbot_window_2022" { # Use the Linux machine type here as we want to keep the windows machines # symmetric with the Linux machines for faster builds. Throughput is not # as much of a concern postcommit. - machine_type = var.linux_machine_type + machine_type = var.linux_machine_type + min_cpu_platform = var.microarchitecture_map[substr(var.linux_machine_type, 0, 3)] labels = { "buildbot-platform" : "windows-2022" }