diff --git a/.VERSION b/.VERSION index 4c3cc4c3..129e8025 100644 --- a/.VERSION +++ b/.VERSION @@ -1 +1 @@ -v0.18.4 +v0.18.5 \ No newline at end of file diff --git a/deploy/terraform/aws/lambda/main.tf b/deploy/terraform/aws/lambda/main.tf index c9671e9f..133f80d0 100644 --- a/deploy/terraform/aws/lambda/main.tf +++ b/deploy/terraform/aws/lambda/main.tf @@ -206,6 +206,7 @@ resource "aws_lambda_function" "buz" { variables = { (local.buz_config_var) = local.buz_config_path, (local.buz_debug_var) = var.debug + GOMEMLIMIT = floor(var.buz_lambda_gomemlimit_pct * var.buz_lambda_memory_limit) } } diff --git a/deploy/terraform/aws/lambda/variables.tf b/deploy/terraform/aws/lambda/variables.tf index d33f7949..3276e8b2 100644 --- a/deploy/terraform/aws/lambda/variables.tf +++ b/deploy/terraform/aws/lambda/variables.tf @@ -41,7 +41,7 @@ variable "buz_image_repo" { variable "buz_version" { description = "The version of Buz to run." type = string - default = "v0.18.4" + default = "v0.18.5" } variable "buz_lambda_memory_limit" { @@ -50,6 +50,12 @@ variable "buz_lambda_memory_limit" { default = 128 } +variable "buz_lambda_gomemlimit_pct" { + description = "Percentage of the lambda memory limit to specify in GOMEMLIMIT env variable." + type = number + default = 0.9 +} + variable "buz_lambda_timeout" { description = "The lambda timeout" type = number diff --git a/deploy/terraform/gcp/cloud_run/main.tf b/deploy/terraform/gcp/cloud_run/main.tf index 6b945f27..9714ccb5 100644 --- a/deploy/terraform/gcp/cloud_run/main.tf +++ b/deploy/terraform/gcp/cloud_run/main.tf @@ -163,6 +163,11 @@ resource "google_cloud_run_service" "buz" { value = local.buz_config_path } + env { + name = "GOMEMLIMIT" + value = floor(var.buz_service_gomemlimit_pct * var.buz_service_memory_limit) + } + volume_mounts { name = local.config mount_path = local.buz_config_dir diff --git a/deploy/terraform/gcp/cloud_run/variables.tf b/deploy/terraform/gcp/cloud_run/variables.tf index 7b5e6515..c3396614 100644 --- a/deploy/terraform/gcp/cloud_run/variables.tf +++ b/deploy/terraform/gcp/cloud_run/variables.tf @@ -28,7 +28,7 @@ variable "buz_domain" { variable "buz_version" { description = "The version of Buz to run." type = string - default = "v0.18.4" + default = "v0.18.5" } variable "buz_service_timeout_seconds" { @@ -55,6 +55,12 @@ variable "buz_service_memory_limit" { default = "512Mi" # Cloud Run default } +variable "buz_service_gomemlimit_pct" { + description = "Percentage of the cloud run memory limit to specify in GOMEMLIMIT env variable." + type = number + default = 0.9 +} + variable "buz_service_container_port" { description = "The service container port" type = number diff --git a/examples/quickstart/docker-compose.yml b/examples/quickstart/docker-compose.yml index 76cbbda5..cb9537ca 100644 --- a/examples/quickstart/docker-compose.yml +++ b/examples/quickstart/docker-compose.yml @@ -20,7 +20,7 @@ x-dependency: services: buz: container_name: buz - image: ghcr.io/silverton-io/buz:v0.18.4 + image: ghcr.io/silverton-io/buz:v0.18.5 volumes: - type: bind source: ./buz/quickstart.conf.yml