Skip to content

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

Merged
janniklasrose merged 1 commit into
mainfrom
aigov-dabs-model-service
Sep 11, 2026
Merged

janniklasrose merged 1 commit into
mainfrom
aigov-dabs-model-service

Conversation

@alex-khakhlyuk

Copy link
Copy Markdown
Member

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 #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.

Changes

Why

Tests

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 3016db1

Run: 34594964457

Env 🟨​KNOWN ✅​pass 🙈​skip Time
🟨​ aws linux 3 310 386 13:45
🟨​ aws windows 3 312 384 17:24
🟨​ azure linux 3 309 386 13:07
🟨​ azure windows 3 311 384 18:02
🟨​ gcp linux 3 310 386 13:40
🟨​ gcp windows 3 312 384 16:15
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K
🟨​ TestAccept/bundle/resources/model_services/lifecycle 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K
🟨​ TestAccept/bundle/resources/model_services/lifecycle/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K
Top 14 slowest tests (at least 2 minutes):
duration env testname
3:08 gcp windows TestFilerWorkspaceFilesExtensionsReadDir
2:53 azure windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=model.yml.tmpl
2:50 gcp windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=job_with_task.yml.tmpl
2:23 gcp windows TestImportDirWithOverwriteFlag
2:21 aws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=job_apply_policy_default_values_task_cluster.yml.tmpl
2:17 azure windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=job_pydabs_10_tasks.yml.tmpl
2:15 azure linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=pipeline_allow_duplicate_names.yml.tmpl
2:13 gcp windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=job_pydabs_10_tasks.yml.tmpl
2:06 gcp linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=job_with_depends_on.yml.tmpl
2:05 aws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=model_serving_endpoint.yml.tmpl
2:03 gcp linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=job_pydabs_10_tasks.yml.tmpl
2:02 gcp windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=secret_scope_default_backend_type.yml.tmpl
2:01 aws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=pipeline.yml.tmpl
2:01 aws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=app.yml.tmpl

@alex-khakhlyuk
alex-khakhlyuk force-pushed the aigov-dabs-model-service branch 5 times, most recently from d4a0614 to da2de5c Compare September 10, 2026 11:05
Comment thread bundle/direct/dresources/model_service.go Outdated

@janniklasrose janniklasrose left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please add a .nextchanges fragment for this resource

Comment thread bundle/config/resources/model_service.go Outdated
Comment thread bundle/config/resources/model_service.go Outdated
Comment thread bundle/config/resources/model_service.go
Comment thread bundle/direct/dresources/model_service.go
Comment thread bundle/direct/dresources/resources.yml
Comment thread acceptance/bundle/resources/model_services/test.toml
Comment thread bundle/direct/dresources/model_service.go
Comment thread bundle/direct/dresources/resources.yml
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 #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.

- Wired model_services into the direct-only Terraform-lifecycle ignore list and
  the statemgmt full-resource-coverage test suite, and fully populated the SDK
  struct literals so the dresources exhaustruct lint passes.

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 dcc3c4e to 3016db1 Compare September 11, 2026 11:37

@janniklasrose janniklasrose left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looking forward to the other AIG resources :shipit:

@janniklasrose
janniklasrose added this pull request to the merge queue Sep 11, 2026
Merged via the queue into main with commit c9650e9 Sep 11, 2026
37 checks passed
@janniklasrose
janniklasrose deleted the aigov-dabs-model-service branch September 11, 2026 13:06
pranshupand-db pushed a commit to pranshupand-db/cli that referenced this pull request Sep 11, 2026
…tabricks#6618)

## What

Allow `get_field_behaviors` to exhaustively extract from specs.

This discovers `OUTPUT_ONLY` / `INPUT_ONLY` field behaviours.

## Why

Follow-up to the discussion on databricks#6525
(databricks#6525 (comment)):
the
`model_services` resource can't rely on the generator to suppress its
output-only config fields, because the destination-config type reused
under
`config.routing.fallback.destinations[*]` is deduped away. That is a
general
generator bug, not model_services-specific — it already drops correct
suppressions on the three resources above. Fixing it here lets a later
`apitypes.yml` pin (`model_services: catalog.ModelService`, riding with
databricks#6525)
generate the full set instead of hand-classifying it.

## Explanation

(There's also inline comments on `resources.generated.yml`)

`get_field_behaviors` in `bundle/direct/tools/generate_resources.py`
threaded a
single global `visited` set through the whole schema walk, deduping by
type name
across the entire tree. A type reached at two sibling paths was
therefore
expanded only at the first one, and its nested `OUTPUT_ONLY` /
`INPUT_ONLY`
annotations were dropped at every later path — surfacing later as
phantom drift
on those server-populated fields.

This scopes `visited` to the current root→node path (each branch gets
its own
copy via `visited | {ref}`) so a self-referential type still terminates
the
recursion, but a type reused at sibling paths is expanded at each
occurrence.
`max_depth` stays as the runaway guard.

## Tests

- `go test ./bundle/direct/dresources/` passes, including
`TestResourcesYMLNoRedundantRules` (the recovered entries don't collide
with
  hand-written `resources.yml` rules).
- Regeneration is idempotent; the script is ruff-clean and formatted
with the
  pinned `ruff@0.15.17`.
- No acceptance test references the recovered fields, so there is no
  golden-output churn.
- Simulated databricks#6525 and the `model_services` annotations are picked up

This pull request and its description were written by Isaac.

---------

Co-authored-by: Isaac <no-reply@databricks.com>
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.

4 participants