Skip to content

[Fix] Support updating all attributes of databricks_model_serving #4575

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mgyucht
Copy link
Contributor

@mgyucht mgyucht commented Mar 12, 2025

Changes

Currently, it is only possible to update the config for databricks_model_serving resources. The Serving Endpoints API exposes separate APIs for updating different elements of serving endpoints, including the config, tags, rate limits, and AI gateway configuration. Because of this, we need to call each API separately when requested by a user.

This PR adds support for updating these attributes. The provider will use ResourceData's HasChanges() method to determine whether each corresponding update method needs to be called.

From what I can tell, it is not possible to update the route-optimized setting for model serving endpoints, so I've marked it as ForceNew to ensure endpoints are recreated appropriately if a user requests to enable or disable route optimization.

Resolves #4564, Resolves #4038, Resolves #4589

Tests

  • Added tags to the TestAccModelServing test, verifying that tags can be provided at creation, and that in update tags can be removed, updated, and added.
  • Added AI gateway to the above test.
  • Added rate limits to the above test.

@mgyucht mgyucht requested review from a team as code owners March 12, 2025 14:42
@mgyucht mgyucht requested review from renaudhartert-db and removed request for a team March 12, 2025 14:42
@mgyucht mgyucht temporarily deployed to test-trigger-is March 12, 2025 14:42 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is March 12, 2025 14:43 — with GitHub Actions Inactive
}

// Update the rate limit configuration for a model serving endpoint.
func updateRateLimits(ctx context.Context, w *databricks.WorkspaceClient, name string, newRateLimits []serving.RateLimit, d *schema.ResourceData) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

this endpoint is now deprecated, you can remove it
This API is deprecated for your Foundation Model endpoint. Please use AI Gateway to manage rate limits.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mgyucht - see Vuong's comment

@alexott alexott temporarily deployed to test-trigger-is April 8, 2025 11:20 — with GitHub Actions Inactive
@alexott alexott temporarily deployed to test-trigger-is April 8, 2025 11:21 — with GitHub Actions Inactive
@VOVELEE
Copy link
Contributor

VOVELEE commented Apr 22, 2025

@mgyucht, @alexott : Do you think you can merge this so eventually the bug is not there with the next release :)

@alexott alexott temporarily deployed to test-trigger-is April 25, 2025 08:21 — with GitHub Actions Inactive
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/terraform

Inputs:

  • PR number: 4575
  • Commit SHA: fad40b336b327835d8e9ea441a058a1f325ac1cc

Checks will be approved automatically on success.

@alexott alexott temporarily deployed to test-trigger-is April 25, 2025 08:22 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants