Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RPD-279] [BUG] Automatically deal with stale states #170

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/matcha_ml/infrastructure/remote_state_storage/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ output "cloud_azure_location"{
description = "The Azure location in which the resources are provisioned"
value = var.location
}

output "cloud_azure_resource_group_name" {
description = "Name of the Azure resource group"
value = module.resource_group.name
}
2 changes: 1 addition & 1 deletion src/matcha_ml/state/matcha_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def __init__(

Raises:
MatchaError: if the state file does not exist.
MatchaError: if MatchaStateService is initialize with both 'matcha_state' and 'terraform_output' arguments.
MatchaError: if MatchaStateService is initialized with both 'matcha_state' and 'terraform_output' arguments.
"""
if matcha_state is not None and terraform_output is not None:
raise MatchaError(
Expand Down
1 change: 1 addition & 0 deletions src/matcha_ml/templates/azure_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def build_template(
# Add matcha.state file one directory above the template
config_dict = vars(config)
_ = config_dict.pop("password", None)
config_dict["resource-group-name"] = f"{config_dict['prefix']}-resources"
initial_state_file_dict = {"cloud": config_dict}
matcha_state = MatchaState.from_dict(initial_state_file_dict)
MatchaStateService(matcha_state=matcha_state)