Skip to content

Commit 6b8c5af

Browse files
Add GOMEMLIMIT as env variable in Terraform for serverless implementation of Buz (#592)
* Relax Content-Type expectation and bump version to 0.18.3 * Add GOMEMLIMIT as env variable in Terraform for serverless implementation of Buz * Revert "Add GOMEMLIMIT as env variable in Terraform for serverless implementation of Buz" This reverts commit 00ebb48. * Add GOMEMLIMIT as env variable in Terraform for serverless implementation of Buz --------- Signed-off-by: Jake Thomas <aerialfly@gmail.com> Co-authored-by: Jake Thomas <aerialfly@gmail.com>
1 parent 60eadaa commit 6b8c5af

File tree

6 files changed

+22
-4
lines changed

6 files changed

+22
-4
lines changed

.VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.18.4
1+
v0.18.5

deploy/terraform/aws/lambda/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ resource "aws_lambda_function" "buz" {
206206
variables = {
207207
(local.buz_config_var) = local.buz_config_path,
208208
(local.buz_debug_var) = var.debug
209+
GOMEMLIMIT = floor(var.buz_lambda_gomemlimit_pct * var.buz_lambda_memory_limit)
209210
}
210211
}
211212

deploy/terraform/aws/lambda/variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ variable "buz_image_repo" {
4141
variable "buz_version" {
4242
description = "The version of Buz to run."
4343
type = string
44-
default = "v0.18.4"
44+
default = "v0.18.5"
4545
}
4646

4747
variable "buz_lambda_memory_limit" {
@@ -50,6 +50,12 @@ variable "buz_lambda_memory_limit" {
5050
default = 128
5151
}
5252

53+
variable "buz_lambda_gomemlimit_pct" {
54+
description = "Percentage of the lambda memory limit to specify in GOMEMLIMIT env variable."
55+
type = number
56+
default = 0.9
57+
}
58+
5359
variable "buz_lambda_timeout" {
5460
description = "The lambda timeout"
5561
type = number

deploy/terraform/gcp/cloud_run/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ resource "google_cloud_run_service" "buz" {
163163
value = local.buz_config_path
164164
}
165165

166+
env {
167+
name = "GOMEMLIMIT"
168+
value = floor(var.buz_service_gomemlimit_pct * var.buz_service_memory_limit)
169+
}
170+
166171
volume_mounts {
167172
name = local.config
168173
mount_path = local.buz_config_dir

deploy/terraform/gcp/cloud_run/variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ variable "buz_domain" {
2828
variable "buz_version" {
2929
description = "The version of Buz to run."
3030
type = string
31-
default = "v0.18.4"
31+
default = "v0.18.5"
3232
}
3333

3434
variable "buz_service_timeout_seconds" {
@@ -55,6 +55,12 @@ variable "buz_service_memory_limit" {
5555
default = "512Mi" # Cloud Run default
5656
}
5757

58+
variable "buz_service_gomemlimit_pct" {
59+
description = "Percentage of the cloud run memory limit to specify in GOMEMLIMIT env variable."
60+
type = number
61+
default = 0.9
62+
}
63+
5864
variable "buz_service_container_port" {
5965
description = "The service container port"
6066
type = number

examples/quickstart/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ x-dependency:
2020
services:
2121
buz:
2222
container_name: buz
23-
image: ghcr.io/silverton-io/buz:v0.18.4
23+
image: ghcr.io/silverton-io/buz:v0.18.5
2424
volumes:
2525
- type: bind
2626
source: ./buz/quickstart.conf.yml

0 commit comments

Comments
 (0)