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] Support updating all attributes of databricks_model_serving #4575

Open
wants to merge 5 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.

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

github-actions bot commented Apr 8, 2025

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: 8f52eb081c7482be7f8791bda94d31f139f8575b

Checks will be approved automatically on success.

@alexott alexott temporarily deployed to test-trigger-is April 8, 2025 11:21 — 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
4 participants