Hello everyone!
Iโm currently working on a project with shared functionalities across different Databricks bundles. I have separate folders for each bundle, along with a common libs/ folder that holds some Python modules intended to be shared across bundles. My directory structure looks like this:
backend/
โโโ libs/
โ โโโ new_package/
โ โ โโโ src/
โ โ โ โโโ new_package/
โ โ โ โโโ __init__.py
โ โ โ โโโ functions.py
โ โ โโโ tests/
โ โ โโโ README.md
โ โ โโโ requirements.txt
โ โ โโโ pyproject.toml
โ โ
โ โโโ second_package/
โ โโโ src/
โ โ โโโ second_package/
โ โ โโโ __init__.py
โ โ โโโ functions.py
โ โโโ tests/
โ โโโ README.md
โ โโโ requirements.txt
โ โโโ pyproject.toml
โ
โโโ bundle_1/
โ โโโ jobs/
โ โโโ tests/
โ โโโ README.md
โ โโโ requirements.txt
โ โโโ databricks.yml
โ
โโโ bundle_2/
โโโ jobs/
โโโ tests/
โโโ README.md
โโโ requirements.txt
โโโ databricks.yml
Iโm using Databricks artifacts to build the wheel as per the documentation. Since my modules reside outside of the bundle root, I use the sync paths mapping to include files located outside the bundle root. However, when I try deploying from the CLI, I encounter this error:
Error: build failed default, error: chdir C:\Users\***\python_monorepo\bundle_1\libs\new_package: The system cannot find the path specified., output:
It seems that the bundle is unable to access the external module. Hereโs my databricks.yml configuration:
bundle:
name: deploy-package-job
resources:
jobs:
deploy-package-job:
name: deploy-package-job
job_clusters:
- job_cluster_key: common-cluster
new_cluster:
spark_version: 13.3.x-scala2.12
node_type_id: Standard_DS3_v2
num_workers: 1
tasks:
- task_key: notebook-task
job_cluster_key: common-cluster
notebook_task:
notebook_path: ./jobs/notebook.ipynb
libraries:
- whl: ../libs/dist/*.whl
sync:
paths:
- ../libs
artifacts:
default:
type: whl
build: python -m build
path: ../libs/new_package
targets:
dev:
mode: development
default: true
workspace:
host: https://***
prod:
mode: production
workspace:
host: https://***
Does anyone have suggestions or insights on why the bundle canโt locate the external module? Any advice would be greatly appreciated!
Thank you!