databricks / cli

Databricks CLI
Other
115 stars 38 forks source link

The CLI crashes when I include the `model_serving_endpoints` resource #1491

Open danielsteman opened 2 weeks ago

danielsteman commented 2 weeks ago

Describe the issue

When I try to validate a bundle that deploys a model serving endpoint the CLI has a runtime error

Steps to reproduce the behavior

Please list the steps required to reproduce the issue, for example:

  1. Paste this in the databricks.yml of an asset bundle:
    
    bundle:
    name: my_project

targets: dev: mode: development default: true workspace: host: ***

resources:
  model_serving_endpoints:
    name: pd-model
    config:
      auto_capture_config:
        enabled: true
        catalog_name: "team_data"
        schema_name: "development"
        table_name_prefix: "inference_table_pd_model"

prod: mode: production workspace: host: ***

  root_path: /Users/...
run_as:
  user_name: ***
2. Run `databricks bundle validate`
3. See runtime error

### Expected Behavior
I would expect the CLI to return warnings, errors or nothing. But not a runtime error without clear cause.

### Actual Behavior

❯ databricks bundle validate panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x50 pc=0x104d289c8]



### OS and CLI version
Please include the version of the CLI (eg: v0.1.2) and the operating system (eg: windows). You can run databricks --version to get the version of your Databricks CLI

❯ d -v
Databricks CLI v0.221.1

MacOS 14.5

### Is this a regression?
This is the first time I'm trying to deploy a model serving endpoint with an asset bundle

### Debug Logs
Output logs if you run the command with debug logs enabled. Example: databricks clusters list --log-level=debug. Redact if needed
pietern commented 2 weeks ago

The crash shouldn't happen, of course, but you're missing a level of indentation.

The endpoint needs a logical name, like this:

    resources:
      model_serving_endpoints:
        my_serving_endpoint:
          name: pd-model
          config:
            auto_capture_config:
              enabled: true
              catalog_name: "team_data"
              schema_name: "development"
              table_name_prefix: "inference_table_pd_model"
danielsteman commented 2 weeks ago

Thanks that helps! I wasn't super confident that my yml spec was correct, hence the expected behavior I described.