Skip to content

Commit

Permalink
feat: Add WD memory limit to overwrite resource limit when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
JianLi-Expedia committed Apr 16, 2024
1 parent 3d67b00 commit 23257ae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ For more information please refer to the main [Apiary](https://github.com/Expedi
| k8s_max_replica_count | Max Number of k8s pod replicas to create. | number | `10` | no |
| local_metastores | List of federated Metastore endpoints directly accessible on the local network. See section [`local_metastores`](#local_metastores) for more info. | list | `<list>` | no |
| memory | The amount of memory (in MiB) used to allocate for the Waggle Dance container. Valid values: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html | string | `4096` | no |
| memory_limit | The amount of memory limit (in MiB) used to allocate for the Waggle Dance container. Valid values: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html | string | `null` | no |
| primary_metastore_access_type | Primary Hive Metastore access control type. | string | `READ_AND_WRITE_ON_DATABASE_WHITELIST` | no |
| primary_metastore_host | Primary Hive Metastore hostname configured in Waggle Dance. | string | `localhost` | no |
| primary_metastore_port | Primary Hive Metastore port | string | `9083` | no |
Expand Down
2 changes: 1 addition & 1 deletion k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

locals {
heapsize = ceil((var.memory * 85) / 100)
memory_limit = ceil((var.memory * 120) / 100)
memory_limit = length(var.memory_limit) == 0 ? ceil((var.memory * 120) / 100) : var.memory_limit
actuator_port = 18000
wd_port = 48869
k8s_cpu = var.cpu / 1024
Expand Down
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ EOF
default = "4096"
}

variable "memory_limit" {
description = <<EOF
The amount of memory limit (in MiB) used to allocate for the Waggle Dance container.
Valid values: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html
EOF

type = string
default = ""
}

variable "cpu" {
description = <<EOF
The number of CPU units to reserve for the Waggle Dance container.
Expand Down

0 comments on commit 23257ae

Please sign in to comment.