terraform-provider-databricks icon indicating copy to clipboard operation
terraform-provider-databricks copied to clipboard

[ISSUE] Issue with `databricks_model_serving` resource

Open Vikranth-Subramanian opened this issue 1 year ago • 8 comments

Configuration

resource "databricks_model_serving" "this" {
  name = "e5_${local.STICKY_RANDOM}"
  config {
    served_entities {
      name           = "e5_small_v2"
      entity_name    = "${databricks_catalog.databricks_e5_v2_models.id}.models.e5_small_v2"
      entity_version = "2"
      workload_size  = "Small"
      scale_to_zero_enabled = false
    }
    traffic_config {
      routes {
        served_model_name  = "e5_small_v2"
        traffic_percentage = 100
      }
    }
  }
}

Seems like the issue which was resolved here https://github.com/databricks/terraform-provider-databricks/issues/3383 is happening again with databricks provider versions 1.49.0 and above.

Steps to Reproduce

terraform plan works fine but it fails when we try to do terraform apply with the error cannot update model serving: scaleToZeroEnabled is undefined. Please set it to either true or false

Terraform and provider versions

databricks_model_serving resource is broken since 1.49.0

Is it a regression?

Debug Output

Important Factoids

Would you like to implement a fix?

Vikranth-Subramanian avatar Aug 25 '24 12:08 Vikranth-Subramanian

Running into the same issue:

Error: cannot update model serving: scaleToZeroEnabled is undefined. Please set it to either true or false.

I noticed that it only works when you set it to true.

paulzharyukmm avatar Sep 16 '24 19:09 paulzharyukmm

Can confirm that this issue does not exist on 1.48.3

paulzharyukmm avatar Sep 16 '24 19:09 paulzharyukmm

Does adding back ForceSendFields which was added in the PR https://github.com/databricks/terraform-provider-databricks/commit/dbe732e02b2223d32f085f66bd1c5c0707304236#diff-c4af24d835708d4701b7681a821ffeed5cb6ad8958b7f0d32a65f911bda3e693R78 will fix the issue? It was removed in the last PR. @alexott ?

Vikranth-Subramanian avatar Sep 21 '24 10:09 Vikranth-Subramanian

@Vikranth-Subramanian it's a bit complicated as it depends on a specific model.

Cc: @arpitjasa-db

alexott avatar Sep 23 '24 08:09 alexott

Hmm @yucheng-qian-db were any changes made recently on the Model Serving API side?

arpitjasa-db avatar Sep 24 '24 06:09 arpitjasa-db

@arpitjasa-db @yucheng-qian-db I reported this error internally few weeks ago...

alexott avatar Sep 24 '24 06:09 alexott

No change in API, but we'll make this field no longer required to address this issue.

yucheng-qian-db avatar Oct 02 '24 17:10 yucheng-qian-db

there is one more issue in Documentation image

https://github.com/databricks/terraform-provider-databricks/blob/main/internal/service/serving_tf/model.go#L753

cpanpalia avatar Oct 14 '24 10:10 cpanpalia

scale_to_zero_enabled is no longer required. The issue should be fixed.

yucheng-qian-db avatar Oct 30 '24 16:10 yucheng-qian-db

Closing as fixed on backend

alexott avatar Nov 13 '24 09:11 alexott

Thanks Everyone for fixing this one

Vikranth-Subramanian avatar Nov 13 '24 23:11 Vikranth-Subramanian