From 988803ee126ae4ebc6dfce20dd4017c6dfdcb735 Mon Sep 17 00:00:00 2001 From: Lokesh Muvva Date: Tue, 2 Jun 2026 16:58:30 -0700 Subject: [PATCH] fix: stop emitting the Grafana module twice in the cloud_run template main.tf.j2's generic per-tool loop emitted a module for every tool including grafana, while a dedicated block emitted grafana again. That produced a duplicate module "model_monitoring_grafana", and the generic loop also passed arguments the Grafana Cloud Run module does not declare (cpu_request, max_scale, use_postgres, ...). A grafana stack with no MLflow/W&B (which renders this template) therefore could not deploy. Exclude grafana from the generic loop so only the dedicated block emits it, matching how mlflow_main.tf.j2 uses dedicated per-tool blocks. Verified by rendering: grafana-containing stacks now emit a single Grafana module with no stray arguments, and non-grafana tools are unaffected. --- src/deployml/templates/gcp/cloud_run/main.tf.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/deployml/templates/gcp/cloud_run/main.tf.j2 b/src/deployml/templates/gcp/cloud_run/main.tf.j2 index 45bd45c..7ff3a7b 100644 --- a/src/deployml/templates/gcp/cloud_run/main.tf.j2 +++ b/src/deployml/templates/gcp/cloud_run/main.tf.j2 @@ -97,6 +97,7 @@ module "cloud_sql_postgres" { {% endif %} {% endfor %} {% endfor %} +{% if not (stage_name == "model_monitoring" and tool.name == "grafana") %} module "{{ stage_name }}_{{ tool.name }}" { source = "./modules/{{ tool.name }}/cloud/{{ cloud }}/{{ deployment_type }}" count = var.enable_{{ stage_name }}_{{ tool.name }} && var.{{ stage_name }}_{{ tool.name }}_service_name != "" ? 1 : 0 @@ -184,6 +185,7 @@ module "{{ stage_name }}_{{ tool.name }}" { create_bigquery_dataset = var.feast_create_bigquery_dataset {% endif %} } +{% endif %} {% endfor %} {% endfor %}