Skip to content

Commit

Permalink
Set CPU throttling to false
Browse files Browse the repository at this point in the history
  • Loading branch information
w-t-yang authored Dec 9, 2022
1 parent 74a7c67 commit d5730c3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ variable "superblocks_agent_image" {
description = "The docker image used by Superblocks Agent container instance"
}
variable "container_cpu_throttling" {
type = bool
default = false
description = "When it's false, CPU is always allocated."
}
variable "name_prefix" {
type = string
default = "superblocks"
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module "cloud_run" {
"SUPERBLOCKS_AGENT_ENVIRONMENT" = var.superblocks_agent_environment,
"SUPERBLOCKS_AGENT_PORT" = var.superblocks_agent_port
}
container_cpu_throttling = var.container_cpu_throttling
container_requests_cpu = var.container_requests_cpu
container_requests_memory = var.container_requests_memory
container_limits_cpu = var.container_limits_cpu
Expand Down
5 changes: 3 additions & 2 deletions modules/cloud-run/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ resource "google_cloud_run_service" "superblocks" {
}
metadata {
annotations = {
"autoscaling.knative.dev/minScale" = "${var.container_min_capacity}"
"autoscaling.knative.dev/maxScale" = "${var.container_max_capacity}"
"autoscaling.knative.dev/minScale" = "${var.container_min_capacity}"
"autoscaling.knative.dev/maxScale" = "${var.container_max_capacity}"
"run.googleapis.com/cpu-throttling" = "${var.container_cpu_throttling}"
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions modules/cloud-run/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ variable "container_env" {
default = {}
}

variable "container_cpu_throttling" {
type = bool
default = false
description = "When it's false, CPU is always allocated."
}

variable "container_requests_cpu" {
type = string
default = "1"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ variable "deploy_in_cloud_run" {
EOF
}

variable "container_cpu_throttling" {
type = bool
default = false
description = "When it's false, CPU is always allocated."
}

variable "container_requests_cpu" {
type = string
default = "1"
Expand Down

0 comments on commit d5730c3

Please sign in to comment.