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

default_version logic in google_ml_engine_model is broken #10432

Open
AndreasBergmeier6176 opened this issue Oct 28, 2021 · 5 comments
Open

default_version logic in google_ml_engine_model is broken #10432

AndreasBergmeier6176 opened this issue Oct 28, 2021 · 5 comments
Labels
forward/linked persistent-bug Hard to diagnose or long lived bugs for which resolutions are more like feature work than bug work service/aiplatform-prediction size/s
Milestone

Comments

@AndreasBergmeier6176
Copy link

AndreasBergmeier6176 commented Oct 28, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v1.0.1
on linux_amd64

  • provider registry.terraform.io/hashicorp/google v3.90.0
  • provider registry.terraform.io/hashicorp/google-beta v3.90.0

Affected Resource(s)

  • google_ml_engine_model

Terraform Configuration Files

resource "google_ml_engine_model" "foo" {
  provider = google-beta

  name                              = "foo"
  regions                           = ["europe-west1"]
  online_prediction_logging         = true
  online_prediction_console_logging = true

Expected Behavior

There should be no reference to version in model to begin with.
I expect that this design flaw comes directly from the backend.
With the current behavior I would even add a breaking change and remove default_version handling from Terraform entirely.

Actual Behavior

After deploying a model version, the backend adds the following properties to ModelVersion:

default_version {
  ~ name = "projects/pro/models/foo/versions/bar" -> nil # forces replacement
}

And best of all changing default_version enforces replacement.
Now there are various problems with this.
First off, should I reference a version, it basically creates a chicken/egg problem both for creation and destroying.
Second - currently there is not support for model versions in Terraform so you can only hardcode the value.
Third - adding a default_version at model creation time is not supported either.

Steps to Reproduce

  1. terraform apply

b/312911725

@AndreasBergmeier6176 AndreasBergmeier6176 changed the title Logic in google_ml_engine_model is broken default_version logic in google_ml_engine_model is broken Oct 28, 2021
@edwardmedia edwardmedia self-assigned this Oct 28, 2021
@edwardmedia
Copy link
Contributor

@AndreasBergmeier6176 default_version is defined as optional. I don't see api returns if it is not provided in the config. Can you share how you config and your debug log?

@edwardmedia
Copy link
Contributor

edwardmedia commented Oct 28, 2021

default_version cannot be specified at model creation time. But currently the implementation does not support Update. Change label to enhancement for the new functionality.

@AndreasBergmeier6176
Copy link
Author

don't see api returns if it is not provided in the config

  1. Add a model via Terraform (terraform apply)
  2. Add a version (gcloud beta)
  3. terraform plan

Result: There is default_version set on model.

This and no support for version in Terraform makes this basically unusable in Terraform.

@slevenick
Copy link
Collaborator

Hm, so the issue you are describing is that you have modified a field on this resource outside of Terraform and now Terraform is trying to reconcile that diff? You may want to look into a lifecycle directive to ignore changes on that field as you actively manage it outside of Terraform

It's possible that we should not support the default_version field, but it would be a breaking change to do so at this point

@AndreasBergmeier6176
Copy link
Author

You may want to look into a lifecycle directive to ignore changes on that field as you actively manage it outside of Terraform

Thanks, that should do the trick for us.

@rileykarson rileykarson added size/s persistent-bug Hard to diagnose or long lived bugs for which resolutions are more like feature work than bug work and removed bug enhancement labels Feb 27, 2023
@rileykarson rileykarson added this to the Goals milestone Mar 6, 2023
@github-actions github-actions bot added forward/review In review; remove label to forward service/aiplatform-prediction labels Oct 5, 2023
@roaks3 roaks3 removed the forward/review In review; remove label to forward label Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forward/linked persistent-bug Hard to diagnose or long lived bugs for which resolutions are more like feature work than bug work service/aiplatform-prediction size/s
Projects
None yet
Development

No branches or pull requests

6 participants