Skip to content

fix: cloud sql socket routing for feast/cron and safer destroy image cleanup#68

Merged
lokeshmuvva merged 2 commits into
devfrom
fix/pr66-review-findings
Jul 15, 2026
Merged

fix: cloud sql socket routing for feast/cron and safer destroy image cleanup#68
lokeshmuvva merged 2 commits into
devfrom
fix/pr66-review-findings

Conversation

@tomtranjr

Copy link
Copy Markdown
Member

summary

Addresses findings 1 and 2 from the code review of #66, one commit each:

  • fix: route feast and cron db access through the cloud sql socket — the Cloud SQL lockdown removed the 0.0.0.0/0 authorized network, but both cloud_run templates still wired the instance public IP into the Feast and cron modules (postgres_host, feast_online_store_host, database_url), so those connections time out. Repoints the postgres_host module output to the /cloudsql/<connection_name> socket dir, switches remaining public-IP DSN references to their _cloud_sql variants, and passes cloud_sql_connection_name to the cron module in the generic template so jobs mount the /cloudsql volume.
  • fix: make destroy image cleanup repo-aware and optional — destroy deleted a hardcoded mlops-images repo and the Cloud Build staging bucket unconditionally, which misses custom build-images --repository names and deletes images shared by other workspaces in the same project. Adds --repository (default mlops-images) and --keep-images, plus an interactive confirm when --yes is not passed. Docs updated.

test plan

  • uv run --with pytest pytest tests/ -q → 63 passed
  • python3 -m compileall -q src/ → clean
  • rendered mlflow_main.tf.j2 (mlflow+fastapi+grafana+feast+cron, postgres) exactly as deploy does → terraform init -backend=false && terraform validate → valid
  • grep of both rendered templates: no public-IP value reaches any module input; cron receives cloud_sql_connection_name
  • deployml destroy --help shows new flags; no-workspace early-exit path unchanged

notes

  • Pre-existing, out of scope: the generic main.tf.j2 (stacks without MLflow) fails terraform validate on its own with a duplicate module "workflow_orchestration_cron" block (same bug class as the Grafana duplicate fixed in fix: stop emitting the Grafana module twice in the cloud_run template #62) and a duplicate backend_store_uri argument in the Feast module block. Confirmed present on unmodified dev.

related

The Cloud SQL lockdown removed the 0.0.0.0/0 authorized network, so
direct TCP to the instance public IP no longer works. Both cloud_run
templates still wired the public IP into the Feast and cron modules
(postgres_host, feast_online_store_host, database_url), which times out
at runtime.

- repoint the postgres_host module output to the /cloudsql socket dir
- switch remaining public-IP DSN references to their _cloud_sql variants
- pass cloud_sql_connection_name to the cron module in the generic
  template so jobs mount the /cloudsql volume (mlflow template already did)
destroy deleted a hardcoded mlops-images Artifact Registry repo and the
Cloud Build staging bucket unconditionally. A custom build-images
--repository was missed while mlops-images was deleted anyway, and in a
project shared by multiple workspaces, destroying one deleted images the
others still run on.

- add --repository (default mlops-images) matching build-images
- add --keep-images to skip repo and staging bucket cleanup entirely
- confirm interactively before deleting when --yes is not passed
- document both flags in README and cli-commands
@tomtranjr
tomtranjr requested a review from lokeshmuvva July 15, 2026 00:13

@lokeshmuvva lokeshmuvva left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lokeshmuvva
lokeshmuvva merged commit 4d32ae9 into dev Jul 15, 2026
@lokeshmuvva
lokeshmuvva deleted the fix/pr66-review-findings branch July 15, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants