Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions premerge/gke_cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
}
Expand Down Expand Up @@ -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"
}
Expand Down