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

Fix DiffSuppressFunc for databricks_model_serving resource #2813

Merged
merged 5 commits into from
Oct 19, 2023

Conversation

nkvuong
Copy link
Contributor

@nkvuong nkvuong commented Oct 18, 2023

Changes

Closes #2811

Tests

  • make test run locally
  • covered with integration tests in internal/acceptance
  • relevant acceptance tests are passing
  • using Go SDK

@nkvuong nkvuong requested review from a team as code owners October 18, 2023 11:33
@nkvuong nkvuong requested review from mgyucht and removed request for a team October 18, 2023 11:33
@alexott
Copy link
Contributor

alexott commented Oct 18, 2023

But with the Default, do we really need a suppress diff?

@nkvuong
Copy link
Contributor Author

nkvuong commented Oct 18, 2023

@alexott the problem is on Azure, where GPU serving is not enabled, the API returns empty workload_type...

@alexott
Copy link
Contributor

alexott commented Oct 18, 2023

and yeah, then we'll have GCP

@nkvuong
Copy link
Contributor Author

nkvuong commented Oct 18, 2023

integration tests passed

@mgyucht
Copy link
Contributor

mgyucht commented Oct 18, 2023

@nkvuong can we do the following instead:

			common.MustSchemaPath(m, "config", "served_models", "workload_type").Computed = true
			common.MustSchemaPath(m, "config", "served_models", "workload_type").Optional = true

That way, if the user doesn't specify, we fall back to the API default (which could be empty, as in Azure), and if they remove the value, it would keep its original value. I'm just so confused by DiffSuppressFunc... I'm going to try to repro now and use this change.

Copy link
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

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

We can move forward with this as-is. I think we need to revisit how we use Computed/Optional vs DiffSuppressFunc in the future; in the meantime, let's just add a comment here, and merge.

@codecov-commenter
Copy link

Codecov Report

Merging #2813 (95c6cf1) into master (9f3658d) will decrease coverage by 0.10%.
Report is 8 commits behind head on master.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2813      +/-   ##
==========================================
- Coverage   84.75%   84.65%   -0.10%     
==========================================
  Files         150      151       +1     
  Lines       13086    13145      +59     
==========================================
+ Hits        11091    11128      +37     
- Misses       1394     1411      +17     
- Partials      601      606       +5     
Files Coverage Δ
serving/resource_model_serving.go 80.76% <100.00%> (+1.13%) ⬆️

... and 7 files with indirect coverage changes

@nkvuong nkvuong added this pull request to the merge queue Oct 19, 2023
Merged via the queue into master with commit 4087b40 Oct 19, 2023
7 checks passed
@nkvuong nkvuong deleted the fix/model_serving_workload_type_diff branch October 19, 2023 09:11
@mgyucht mgyucht mentioned this pull request Oct 25, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants