feat: infracost v2 support — deployml estimate and deployml costs#64
Draft
andrewtclim wants to merge 1 commit into
Draft
feat: infracost v2 support — deployml estimate and deployml costs#64andrewtclim wants to merge 1 commit into
andrewtclim wants to merge 1 commit into
Conversation
…sts commands - Rewrites infracost.py for v2 CLI (scan + inspect --json, dropped deprecated breakdown command) - Adds deployml estimate: pre-deploy cost prediction from config, no GCP credentials needed - Adds deployml costs: cost check against live deployed Terraform workspace - Adds check_infracost_authenticated() with macOS + Linux credential path support - Fixes copy_modules_to_workspace to include cloud_sql_postgres when mlflow uses postgresql - Updates deployml doctor to show infracost install + auth status - Adds 14 unit tests for infracost.py - Updates docs/features/costs.md and tutorial with estimate/costs commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
infracost.pyfor infracost v2 (infracost scan/infracost inspect --json— the oldinfracost breakdowncommand no longer exists in v2 and was silently failing)deployml estimate: pre-deploy cost prediction fromconfig.yaml, no GCP credentials or infra neededdeployml costs: cost check against an existing deployed Terraform workspacedeployml doctorauth check (infracost v2 requires an account +infracost auth login)copy_modules_to_workspaceto always includecloud_sql_postgresmodule when mlflow uses postgresql backend (was silently returning $0)infracost.pycosts.mdand the Cloud Run tutorialWhat the student experience looks like
Limitations / future work
deployml estimateanddeployml costsread Terraform configs via infracost — accurate for always-on resources (Cloud SQL, VMs) but show $0 for usage-based services (BigQuery, GCS, Cloud Run). A futuredeployml billingcommand could query the GCP Cloud Billing API for actual accrued charges.Test plan
pytest tests/test_infracost.py— 14 tests, all passingdeployml doctor— shows Infracost installed + authenticateddeployml estimate— shows cost from config.yaml without deployingdeployml deploy— cost shown inline before confirmation promptdeployml costs— shows cost of running deploymentdeployml costswith no deployment — helpful error message🤖 Generated with Claude Code