Skip to content

Add direct-mode bundle support for AI Gateway model_service - #6519

Open
alex-khakhlyuk wants to merge 1 commit into
databricks:mainfrom
alex-khakhlyuk:aigov-dabs-model-service
Open

Add direct-mode bundle support for AI Gateway model_service#6519
alex-khakhlyuk wants to merge 1 commit into
databricks:mainfrom
alex-khakhlyuk:aigov-dabs-model-service

Conversation

@alex-khakhlyuk

@alex-khakhlyuk alex-khakhlyuk commented Sep 3, 2026

Copy link
Copy Markdown
Member

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 from databricks.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_services and model_provider_services will 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 implementing ConfigResource. A flat struct exposes the immutable identity (parent + model_service_id, which the server composes into the resource name) plus the mutable comment/config body.
  • bundle/direct/dresources/model_service.go — CRUD mapped 1:1 onto the AiGateway service in databricks-sdk-go. The engine tracks the bare {catalog}.{schema}.{leaf} id and re-adds the resource-name prefix at each call; DoRead reconstructs identity from the server-returned name so it participates in drift detection.
  • resources.yml classification — parent + model_service_id as immutable id fields; output-only config fields (inference_table.table/inference_table.is_deleted, and routing.destinations[*].is_deleted / routing.fallback.destinations[*].is_deleted, which the server computes at read time) suppressed to avoid phantom drift.
  • Registration (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, and task generate-check (validate-generated) pass.
  • Unit tests: bundle/config/..., bundle/direct/dresources/..., libs/testserver/..., bundle/internal/schema/....
  • Acceptance: resources/model_services (basic + remote-delete), deployment/bind/model_service, refschema, and full invariant — clean run.
  • Live-cloud end-to-end test on an internal staging workspace (direct engine): bundle deploy create, in-place update, immutable-field recreate plan, no-op redeploy with no phantom drift, server-side validation rejection (traffic percentages must sum to 100), and bundle destroy (confirmed removed). Verified with rich config — two traffic-split destinations (60/40) and int64 rate limits (tokens=3000000000) round-trip exactly.

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>
@alex-khakhlyuk
alex-khakhlyuk force-pushed the aigov-dabs-model-service branch from 5e323c9 to c7221de Compare September 3, 2026 16:00
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 6519
  • Commit SHA: c7221de14786e827f372926c5754c0c5046e2f7d

Checks will be approved automatically on success.

@alex-khakhlyuk
alex-khakhlyuk marked this pull request as ready for review September 3, 2026 16:20
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

24 files changed
Suggested: @denik
Also eligible: @janniklasrose, @pietern, @andrewnester, @shreyas-goenka, @anton-107, @lennartkats-db

/bundle/ - needs approval

16 files changed
Suggested: @denik
Also eligible: @janniklasrose, @pietern, @andrewnester, @shreyas-goenka, @anton-107, @lennartkats-db

General files (require maintainer)

Files: libs/testserver/fake_workspace.go, libs/testserver/handlers.go, libs/testserver/model_services.go
Based on git history:

  • @denik -- recent work in libs/testserver/, bundle/direct/dresources/, acceptance/bundle/invariant/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db, @rugpanov, @rclarey) can approve all areas.
See OWNERS for ownership rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant