Skip to content

Commit ca638e3

Browse files
[CI] Specify CPU Microarchitectue for Premerge Worker Nodes
This ensures more consistent performance as the n2/n2d machine types can vary microarchitecturally in ways that significantly impact performance (xx%).
1 parent a811e79 commit ca638e3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

premerge/gke_cluster/main.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ resource "google_container_cluster" "llvm_premerge" {
3232
}
3333
}
3434

35+
variable "microarchitecture_map" {
36+
type = map(string)
37+
default = {
38+
"n2d": "AMD Milan"
39+
"n2-": "Intel Ice Lake"
40+
}
41+
}
42+
3543
resource "google_container_node_pool" "llvm_premerge_linux_service" {
3644
name = "llvm-premerge-linux-service"
3745
location = var.region
@@ -63,6 +71,7 @@ resource "google_container_node_pool" "llvm_premerge_linux" {
6371

6472
node_config {
6573
machine_type = var.linux_machine_type
74+
min_cpu_platform = var.microarchitecture_map[substr(var.linux_machine_type, 0, 3)]
6675
taint {
6776
key = "premerge-platform"
6877
value = "linux"
@@ -97,6 +106,7 @@ resource "google_container_node_pool" "llvm_buildbot_linux" {
97106

98107
node_config {
99108
machine_type = var.linux_machine_type
109+
min_cpu_platform = var.microarchitecture_map[substr(var.linux_machine_type, 0, 3)]
100110
taint {
101111
key = "buildbot-platform"
102112
value = "linux"
@@ -128,6 +138,7 @@ resource "google_container_node_pool" "llvm_premerge_libcxx" {
128138

129139
node_config {
130140
machine_type = var.libcxx_machine_type
141+
min_cpu_platform = var.microarchitecture_map[substr(var.libcxx_machine_type, 0, 3)]
131142
taint {
132143
key = "premerge-platform-libcxx"
133144
value = "linux-libcxx"
@@ -155,6 +166,7 @@ resource "google_container_node_pool" "llvm_premerge_windows_2022" {
155166
# a node.kubernetes.io/os taint for windows nodes.
156167
node_config {
157168
machine_type = var.windows_machine_type
169+
min_cpu_platform = var.microarchitecture_map[substr(var.windows_machine_type, 0, 3)]
158170
labels = {
159171
"premerge-platform" : "windows-2022"
160172
}
@@ -205,6 +217,7 @@ resource "google_container_node_pool" "llvm_buildbot_window_2022" {
205217
# symmetric with the Linux machines for faster builds. Throughput is not
206218
# as much of a concern postcommit.
207219
machine_type = var.linux_machine_type
220+
min_cpu_platform = var.microarchitecture_map[substr(var.linux_machine_type, 0, 3)]
208221
labels = {
209222
"buildbot-platform" : "windows-2022"
210223
}

0 commit comments

Comments
 (0)