Add direct-mode bundle support for AI Gateway model_service - #6519
Add direct-mode bundle support for AI Gateway model_service#6519alex-khakhlyuk wants to merge 1 commit into
Conversation
Adds direct-engine Databricks Asset Bundle support for the Unity Catalog AI Gateway model service securable (model_services), so it can be declared and deployed from databricks.yml. First of a stacked split of databricks#6410 (mcp_services and model_provider_services follow). Direct engine only. - bundle/config/resources/model_service.go: flat ConfigResource exposing the immutable parent + model_service_id identity plus the mutable comment/config body. - bundle/direct/dresources/model_service.go: CRUD onto the AiGateway service; DoRead reconstructs identity from the server-derived name so it participates in drift detection. - resources.yml: parent + model_service_id as immutable id fields; the server-computed output-only config fields (inference_table.table/is_deleted and routing.destinations[*]/fallback.destinations[*].is_deleted) suppressed to avoid phantom drift. - Registration, testserver implementation, regenerated schema, acceptance (basic + remote-delete + bind), and an invariant config. Scope is strictly model_service: no changes to jobs suppression or other resources. Owner is deferred (the API returns effective_owner); permissions use grants; no Catalog Explorer URL is wired up yet. Co-authored-by: Isaac <no-reply@databricks.com>
5e323c9 to
c7221de
Compare
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Approval status: pending
|
Changes
Adds Databricks Asset Bundle support (direct deployment engine) for the Unity Catalog AI Gateway model service securable (
model_services), so it can be declared and deployed fromdatabricks.yml.This is the first of a stacked split of #6410 — per review feedback to split the three AI Gateway securables for easier review.
mcp_servicesandmodel_provider_serviceswill follow as stacked PRs on top of this one. Direct engine only (the Terraform engine is being removed from DABs).Following the existing direct-engine pattern (cf.
volume/database_instance):bundle/config/resources/model_service.go— config/state struct implementingConfigResource. A flat struct exposes the immutable identity (parent+model_service_id, which the server composes into the resource name) plus the mutablecomment/configbody.bundle/direct/dresources/model_service.go— CRUD mapped 1:1 onto theAiGatewayservice indatabricks-sdk-go. The engine tracks the bare{catalog}.{schema}.{leaf}id and re-adds the resource-name prefix at each call;DoReadreconstructs identity from the server-returned name so it participates in drift detection.resources.ymlclassification —parent+model_service_idas immutable id fields; output-only config fields (inference_table.table/inference_table.is_deleted, androuting.destinations[*].is_deleted/routing.fallback.destinations[*].is_deleted, which the server computes at read time) suppressed to avoid phantom drift.bundle/config/resources.go,bundle/direct/dresources/all.go), a resource test-server implementation (libs/testserver/), regenerated schema, and updated shared coverage tests.Owner is deferred (the API returns
effective_owner); permissions use grants rather than bundle permissions; no Catalog Explorer URL is wired up yet.Why
Lets users manage AI Gateway model services declaratively in bundles alongside their other Unity Catalog resources. Splitting #6410 per reviewer request so each of the three securables can be reviewed independently. This PR is scoped strictly to the model_service addition — no unrelated jobs/pipelines changes.
Tests
go build ./...,gofmt, andtask generate-check(validate-generated) pass.bundle/config/...,bundle/direct/dresources/...,libs/testserver/...,bundle/internal/schema/....resources/model_services(basic + remote-delete),deployment/bind/model_service,refschema, and fullinvariant— clean run.bundle deploycreate, in-place update, immutable-field recreate plan, no-op redeploy with no phantom drift, server-side validation rejection (traffic percentages must sum to 100), andbundle destroy(confirmed removed). Verified with rich config — two traffic-split destinations (60/40) and int64 rate limits (tokens=3000000000) round-trip exactly.