cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Databricks App with DAB

drii_cavalcanti
New Contributor III

Hi All,

I am trying to deploy a DBX APP via DAB, however source_code_path seems not to be parsed correctly to the app configuration.

- dbx_dash/
-- resources/
---- app.yml
-- src/
---- app.yaml
---- app.py
-- databricks.yml

resources/app.yml:

resources:
apps: my_app:
name: "my_app"
description: "My First APP"
# The location of the source code for the app
source_code_path: ../src

targets:
dev:
workspace:
root_path: /Workspace/Users/my_user@domain.com/my_app

databricks.yml:

bundle:
name: apps
include:
- resources/*.yml

targets:
dev:
mode: development
default: true
workspace:
host: https://my_host.com

The src folder, when deployed, goes to a folder called files/ in my workspace. However, the app has /Workspace/Users/my_user@domain.com/my_app as the source_path_code, which differs from the correct src path which is /Workspace/Users/my_user@domain.com/my_app/files/src.

Is there anything that I am missing here?

Thank you!
Adriana Cavalcanti

 

 

3 REPLIES 3

NandiniN
Databricks Employee
Databricks Employee

It seems to be issue with relative path

source_code_path: ../src

This does not match the actual path where the source code is being deployed in the Databricks workspace (/Workspace/Users/my_user@domain.com/my_app/files/src). This mismatch could lead to the app being unable to locate the files in the expected path.

By default, deploying a Databricks Asset Bundle (DAB) might append additional directory structures like files/ depending on the bundle structure.

To fix this Review databricks.yml Configuration:

  • Confirm that the root_path in your databricks.yml file is consistent with how you want the app deployed. For instance, it could be necessary to append /files to the root_path if the src/ folder is being nested under files/ during deployment.

After making the above changes, redeploy the bundle using the following command:

databricks bundle deploy -t dev

Hi NandiniN,

Thanks for your reply.

The more folders I add to root_path (my_user@domain.com/my_app/files/src), the deeper the hierarchy becomes to reach the app (/Workspace/Users/my_user@domain.com/my_app/files/src/files/src), and source path continues to be /Workspace/Users/my_user@domain.com/my_app.

Is there anything else that I can look into?

Appreciate your assistance,
Adriana Cavalcanti

 

NandiniN
Databricks Employee
Databricks Employee

Hi Adriana,

Have you adjusted the root_path in your databricks.yml

Kindly add /Workspace and entire path to the root_path

Thanks

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now