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

Missing support for most resource types in deployment bind/unbind commands #2365

Open
snazzyfox opened this issue Feb 22, 2025 · 0 comments
Open
Labels
DABs DABs related issues

Comments

@snazzyfox
Copy link

Describe the issue

The databricks bundle deployment bind and unbind commands only support jobs, pipelines, and apps. It does not support any other resource types managed by DABs, such as clusters, dashboards, schemas, volumes, experiments, models...

Configuration

minimal DAB (using schema as an example)

bundle:
  name: example
resources:
  schemas:
    test:
      catalog_name: my_catalog
      name: my_schema
targets:
  dev:
    default: true
    mode: development
    workspace:
      host: https://my-workspace.cloud.databricks.com

Steps to reproduce the behavior

If the DAB has already been applied, and I wish to remove the schema from the DAB's management: run databricks bundle deployment unbind schemas.test

If the schema already existed before the DAB is created, and I want to add the schema into DAB management, run databricks bundle deployment bind schemas.text [schema id]

Expected Behavior

The schema (or another resource) should be bound/unbound to the DAB successfully.

Actual Behavior

Get an error:

Error: no such resource: schema.test

Note that this error appears for any of the resource types I listed above, and regardless of what I use as the resource key, or the remote resource ID.

OS and CLI version

Windows/WSL Ubuntu, CLI v0.241.2

Is this a regression?

No

Debug Logs

15:32:25  INFO start pid=55140 version=0.239.0 args="databricks, bundle, deployment, unbind, resources.schemas.bronze, --debug"
15:32:25 DEBUG Found bundle root at /mnt/c/Users/luyaoy/gitlab/platform_dataset_databricks_api (file /mnt/c/Users/luyaoy/gitlab/platform_dataset_databricks_api/databricks.yml) pid=55140     
15:32:25 DEBUG Apply pid=55140 mutator=load
15:32:25  INFO Phase: load pid=55140 mutator=load
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=EntryPoint
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=scripts.preinit
15:32:25 DEBUG No script defined for preinit, skipping pid=55140 mutator=load mutator=seq mutator=scripts.preinit
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=ProcessRootIncludes
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=ProcessRootIncludes mutator=seq
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=VerifyCliVersion
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=EnvironmentsToTargets
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=ComputeIdToClusterId
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=InitializeVariables
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=DefineDefaultTarget(default)
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=PythonMutator(load)
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=validate:unique_resource_keys
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=SelectDefaultTarget
15:32:25 DEBUG Apply pid=55140 mutator=load mutator=seq mutator=SelectDefaultTarget mutator=SelectTarget(lab)
15:32:25 DEBUG Apply pid=55140 mutator=<func>
Error: no such resource: schemas.test
15:32:25 ERROR failed execution pid=55140 exit_code=1 error="no such resource: schemas.test"

Additional Details

When poking around the databricks CLI code, I've noticed that the bind/unbind command uses the FindResourceByConfigKey function, which is separately hardcoded for a few resource type. I suspect this is why it won't resolve any resources other than the ones listed here

@snazzyfox snazzyfox added the DABs DABs related issues label Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DABs DABs related issues
Projects
None yet
Development

No branches or pull requests

1 participant