Skip to content

Commit

Permalink
Add autoscale config
Browse files Browse the repository at this point in the history
  • Loading branch information
tanya-borisova committed Aug 8, 2023
1 parent a7f58d1 commit 242415e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ transform: # Optional
local_disk_min_size: 600
category: "Memory Optimised"
autotermination_minutes: 120
autoscale:
min_workers: 1
max_workers: 3
init_scripts:
- /workspaces/FlowEHR/transform/sample_init_script.sh

Expand Down
4 changes: 4 additions & 0 deletions infrastructure/transform/databricks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ resource "databricks_cluster" "cluster" {
spark_version = data.databricks_spark_version.latest.id
node_type_id = data.databricks_node_type.node_type.id
autotermination_minutes = var.transform.databricks_cluster.autotermination_minutes
autoscale {
min_workers = var.transform.databricks_cluster.autoscale.min_workers
max_workers = var.transform.databricks_cluster.autoscale.max_workers
}

spark_conf = merge(
# Secrets for SQL Feature store
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/transform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ variable "transform" {
}), {}),
autotermination_minutes = optional(number, 0),
init_scripts = optional(list(string), [])
autoscale = optional(object({
min_workers = optional(number, 0)
max_workers = optional(number, 0)
}), {})
}), {})
})
default = {
Expand Down

0 comments on commit 242415e

Please sign in to comment.