From b95f047282b38884b24c4159ad21c7196d1cf705 Mon Sep 17 00:00:00 2001 From: ara-25 Date: Wed, 30 Oct 2024 19:55:10 +0500 Subject: [PATCH 1/3] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index f443c82..d5f3048 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*.pyc + # Local .terraform directories **/.terraform/* From 240a2dae6e5fbaf12f19c33943209ec752c73557 Mon Sep 17 00:00:00 2001 From: ara-25 Date: Wed, 30 Oct 2024 19:55:55 +0500 Subject: [PATCH 2/3] Add dagster config file for local deployment --- .../applications/local/orchestrator/dagster/dagster.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/mlinfra/modules/applications/local/orchestrator/dagster/dagster.yaml diff --git a/src/mlinfra/modules/applications/local/orchestrator/dagster/dagster.yaml b/src/mlinfra/modules/applications/local/orchestrator/dagster/dagster.yaml new file mode 100644 index 0000000..d21b8aa --- /dev/null +++ b/src/mlinfra/modules/applications/local/orchestrator/dagster/dagster.yaml @@ -0,0 +1,9 @@ +inputs: + - name: dagster_chart_version + user_facing: true + description: Version of the Dagster Helm chart to use- + default: "1.8.13" +outputs: + - name: dagster_endpoint + description: Dagster access endpoint. + export: true From 65eb6128dc7a45172ba031d8104a0ad1efa8f60d Mon Sep 17 00:00:00 2001 From: ara-25 Date: Wed, 30 Oct 2024 19:56:31 +0500 Subject: [PATCH 3/3] Add terraform code for dagster local deployment --- .../orchestrator/dagster/tf_module/main.tf | 22 ++++++++++++ .../orchestrator/dagster/tf_module/outputs.tf | 4 +++ .../dagster/tf_module/values.yaml | 1 + .../dagster/tf_module/variables.tf | 34 +++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/main.tf create mode 100644 src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/outputs.tf create mode 100644 src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/values.yaml create mode 100644 src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/variables.tf diff --git a/src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/main.tf b/src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/main.tf new file mode 100644 index 0000000..eb75404 --- /dev/null +++ b/src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/main.tf @@ -0,0 +1,22 @@ +locals { + dagster_helmchart_set = [{ + name = "ingress.dagsterWebserver.host" + value = var.dagster_endpoint + type = "auto" + } + ] +} + +module "dagster_helmchart" { + source = "../../../../../local/helm_chart" + name = "dagster" + namespace = "dagster" + create_namespace = true + repository = "https://dagster-io.github.io/helm" + chart = "dagster" + chart_version = var.dagster_chart_version + values = templatefile("${path.module}/values.yaml", { + resources = jsonencode(var.resources) + }) + set = local.dagster_helmchart_set +} diff --git a/src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/outputs.tf b/src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/outputs.tf new file mode 100644 index 0000000..c11e0f9 --- /dev/null +++ b/src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/outputs.tf @@ -0,0 +1,4 @@ +output "dagster_endpoint" { + value = var.dagster_endpoint + description = "" +} diff --git a/src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/values.yaml b/src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/values.yaml new file mode 100644 index 0000000..9e14140 --- /dev/null +++ b/src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/values.yaml @@ -0,0 +1 @@ +resources: ${resources} diff --git a/src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/variables.tf b/src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/variables.tf new file mode 100644 index 0000000..e4d1125 --- /dev/null +++ b/src/mlinfra/modules/applications/local/orchestrator/dagster/tf_module/variables.tf @@ -0,0 +1,34 @@ +variable "dagster_chart_version" { + type = string + description = "Version of the Dagster Helm chart to use" + default = "1.8.13" +} + +variable "resources" { + type = object({ + requests = object({ + cpu = string + memory = string + }) + limits = object({ + cpu = string + memory = string + }) + }) + description = "Resource requests and limits for Dagster pods" + default = { + requests = { + cpu = "100m" + memory = "128Mi" + } + limits = { + cpu = "500m" + memory = "512Mi" + } + } +} + +variable "dagster_endpoint" { + type = string + default = "dagster.localhost" +}