-
Notifications
You must be signed in to change notification settings - Fork 186
Immutable folder support in DABs #5254
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
base: main
Are you sure you want to change the base?
Changes from all commits
b685ec2
a429b26
e7c1968
67914d0
549492a
aedfdb0
eddec61
27a6b02
4a9bcd9
ebd26ea
5efe1da
6215a49
7b44126
be6dec3
0f1ed52
d978559
9a6c898
079998b
c6b1ff5
3a0ec41
b9f67f7
01136f5
6e9aa77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| bundle: | ||
| name: test-bundle-immutable-no-artifacts-$UNIQUE_NAME | ||
|
|
||
| experimental: | ||
| immutable_folder: true | ||
|
|
||
| resources: | ||
| jobs: | ||
| my_job: | ||
| name: my job | ||
| tasks: | ||
| - task_key: spark_python_task | ||
| spark_python_task: | ||
| python_file: ./src/main.py | ||
| environment_key: env | ||
| - task_key: notebook_task | ||
| notebook_task: | ||
| notebook_path: ./src/notebook.py | ||
| base_parameters: | ||
| path: ${workspace.file_path}/some_path | ||
|
|
||
|
|
||
| environments: | ||
| - environment_key: env | ||
| spec: | ||
| environment_version: "4" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
|
|
||
| >>> [CLI] bundle validate | ||
| Name: test-bundle-immutable-no-artifacts-[UNIQUE_NAME] | ||
| Target: default | ||
| Workspace: | ||
| User: [USERNAME] | ||
| Path: /Workspace/Users/[USERNAME]/.bundle/test-bundle-immutable-no-artifacts-[UNIQUE_NAME]/default | ||
|
|
||
| Validation OK! | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Uploading immutable bundle snapshot... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> [CLI] jobs get [NUMID] | ||
| "/Workspace/Users/[UUID]/.snapshots/[UUID]/[SNAPSHOT_HASH]/src/files/src/main.py" | ||
|
|
||
| >>> [CLI] jobs get [NUMID] | ||
| "/Workspace/Users/[UUID]/.snapshots/[UUID]/[SNAPSHOT_HASH]/src/files/src/notebook" | ||
|
|
||
| >>> [CLI] jobs get [NUMID] | ||
| "/Workspace/Users/[UUID]/.snapshots/[UUID]/[SNAPSHOT_HASH]/src/files/some_path" | ||
|
|
||
| >>> [CLI] bundle destroy --auto-approve | ||
| The following resources will be deleted: | ||
| delete resources.jobs.my_job | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-immutable-no-artifacts-[UNIQUE_NAME]/default | ||
|
|
||
| Deleting files... | ||
| Destroy complete! | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| envsubst < databricks.yml.tmpl > databricks.yml | ||
|
|
||
| cleanup() { | ||
| rm -f out.requests.txt | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| trace $CLI bundle validate | ||
| trace $CLI bundle deploy | ||
|
|
||
|
|
||
| # Get a job and check that task paths point into the snapshot | ||
| JOB_ID=$($CLI bundle summary -o json | jq -r '.resources.jobs.my_job.id') | ||
| trace $CLI jobs get $JOB_ID | jq '.settings.tasks' | jq '.[] | select(.spark_python_task != null) | .spark_python_task.python_file' | ||
| trace $CLI jobs get $JOB_ID | jq '.settings.tasks' | jq '.[] | select(.notebook_task != null) | .notebook_task.notebook_path' | ||
| trace $CLI jobs get $JOB_ID | jq '.settings.tasks' | jq '.[] | select(.notebook_task != null) | .notebook_task.base_parameters.path' | ||
|
|
||
| trace $CLI bundle destroy --auto-approve |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| print("Hello from Spark Python Task!") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Databricks notebook source | ||
|
|
||
| print("Hello from Notebook Task!") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| Local = true | ||
| Cloud = true | ||
| RecordRequests = true | ||
|
|
||
| # immutable_folder only works with the direct engine. | ||
| EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] | ||
|
|
||
| Ignore = [ | ||
| "databricks.yml", | ||
| ".databricks", | ||
| ".venv", | ||
| "script", | ||
| "*.pyc", | ||
| ] | ||
|
|
||
| # Normalize the content-addressed snapshot hash so it doesn't need to be | ||
| # hardcoded in output.txt and the test stays stable across file changes. | ||
| [[Repls]] | ||
| Old = '[0-9a-f]{64}' | ||
| New = '[SNAPSHOT_HASH]' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| bundle: | ||
| name: test-bundle-immutable-$UNIQUE_NAME | ||
|
|
||
| experimental: | ||
| immutable_folder: true | ||
|
|
||
| artifacts: | ||
| python_artifact: | ||
| type: whl | ||
| build: uv build --wheel | ||
|
|
||
| resources: | ||
| jobs: | ||
| my_job: | ||
| name: my job | ||
| tasks: | ||
| - task_key: spark_python_task | ||
| spark_python_task: | ||
| python_file: ./src/main.py | ||
| environment_key: env | ||
| - task_key: notebook_task | ||
| notebook_task: | ||
| notebook_path: ./src/notebook.py | ||
| - task_key: python_wheel_task | ||
| python_wheel_task: | ||
| package_name: immutable | ||
| entry_point: main | ||
| environment_key: env | ||
| environments: | ||
| - environment_key: env | ||
| spec: | ||
| environment_version: "4" | ||
| dependencies: | ||
| - ./dist/*.whl |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
|
|
||
| >>> [CLI] bundle validate | ||
| Name: test-bundle-immutable-[UNIQUE_NAME] | ||
| Target: default | ||
| Workspace: | ||
| User: [USERNAME] | ||
| Path: /Workspace/Users/[USERNAME]/.bundle/test-bundle-immutable-[UNIQUE_NAME]/default | ||
|
|
||
| Validation OK! | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Building python_artifact... | ||
| Error: build failed python_artifact, error: exit status 2, output: Building wheel... | ||
| × Failed to build | ||
| │ `[TEST_TMP_DIR]` | ||
| ├─▶ Failed to resolve requirements from `build-system.requires` | ||
| ├─▶ No solution found when resolving: `hatchling` | ||
| ╰─▶ Because only the following versions of hatchling are available: | ||
| hatchling==0.8.0 | ||
| hatchling==0.8.1 | ||
| hatchling==0.8.2 | ||
| hatchling==0.9.0 | ||
| hatchling==0.10.0 | ||
| hatchling==0.11.0 | ||
| hatchling==0.11.1 | ||
| hatchling==0.11.2 | ||
| hatchling==0.11.3 | ||
| hatchling==0.12.0 | ||
| hatchling==0.13.0 | ||
| hatchling==0.14.0 | ||
| hatchling==0.15.0 | ||
| hatchling==0.16.0 | ||
| hatchling==0.17.0 | ||
| hatchling==0.18.0 | ||
| hatchling==0.19.0 | ||
| hatchling==0.20.0 | ||
| hatchling==0.20.1 | ||
| hatchling==0.21.0 | ||
| hatchling==0.21.1 | ||
| hatchling==0.22.0 | ||
| hatchling==0.23.0 | ||
| hatchling==0.24.0 | ||
| hatchling==0.25.0 | ||
| hatchling==0.25.1 | ||
| hatchling==1.0.0 | ||
| hatchling==1.1.0 | ||
| hatchling==1.2.0 | ||
| hatchling==1.3.0 | ||
| hatchling==1.3.1 | ||
| hatchling==1.4.0 | ||
| hatchling==1.4.1 | ||
| hatchling==1.5.0 | ||
| hatchling==1.6.0 | ||
| hatchling==1.7.0 | ||
| hatchling==1.7.1 | ||
| hatchling==1.8.0 | ||
| hatchling==1.8.1 | ||
| hatchling==1.9.0 | ||
| hatchling==1.10.0 | ||
| hatchling==1.11.0 | ||
| hatchling==1.11.1 | ||
| hatchling==1.12.0 | ||
| hatchling==1.12.1 | ||
| hatchling==1.12.2 | ||
| hatchling==1.13.0 | ||
| hatchling==1.14.0 | ||
| hatchling==1.14.1 | ||
| hatchling==1.15.0 | ||
| hatchling==1.16.0 | ||
| hatchling==1.16.1 | ||
| hatchling==1.17.0 | ||
| hatchling==1.17.1 | ||
| hatchling==1.18.0 | ||
| hatchling==1.19.0 | ||
| hatchling==1.19.1 | ||
| hatchling==1.20.0 | ||
| hatchling==1.21.0 | ||
| hatchling==1.21.1 | ||
| hatchling==1.22.0 | ||
| hatchling==1.22.1 | ||
| hatchling==1.22.2 | ||
| hatchling==1.22.3 | ||
| hatchling==1.22.4 | ||
| hatchling==1.22.5 | ||
| hatchling==1.23.0 | ||
| hatchling==1.24.0 | ||
| hatchling==1.24.1 | ||
| hatchling==1.24.2 | ||
| hatchling==1.25.0 | ||
| hatchling==1.26.0 | ||
| hatchling==1.26.1 | ||
| hatchling==1.26.2 | ||
| hatchling==1.26.3 | ||
| hatchling==1.27.0 | ||
| hatchling==1.28.0 | ||
| hatchling==1.29.0 | ||
| and hatchling<=1.3.1 needs to be downloaded from a registry, we can | ||
| conclude that hatchling<=1.3.1 cannot be used. | ||
| And because hatchling==1.4.0 was yanked (reason: Building wheels from | ||
| sdists is broken), we can conclude that hatchling<1.4.1 cannot be used. | ||
| And because hatchling>=1.4.1,<=1.19.0 needs to be downloaded | ||
| from a registry and hatchling==1.19.1 was yanked (reason: | ||
| https://github.com/pypa/hatch/issues/1129), we can conclude that | ||
| hatchling<1.20.0 cannot be used. | ||
| And because hatchling>=1.20.0,<=1.21.1 needs to be downloaded from | ||
| a registry and hatchling>=1.22.0,<=1.22.1 was yanked (reason: Broken | ||
| builds from sdists), we can conclude that hatchling>=1.22.0,<=1.22.1 | ||
| cannot be used. | ||
| And because hatchling>=1.22.2,<=1.25.0 needs to be downloaded from a | ||
| registry and hatchling==1.26.0 was yanked (reason: Incompatible with | ||
| currently released Hatch), we can conclude that hatchling<1.26.1 cannot | ||
| be used. | ||
| And because hatchling>=1.26.1,<=1.26.2 was yanked (reason: Upload | ||
| issues) and hatchling>=1.26.3,<=1.28.0 needs to be downloaded from a | ||
| registry, we can conclude that hatchling>=1.26.3,<=1.28.0 cannot be | ||
| used. (1) | ||
|
|
||
| Because only the following versions of tomli{python_full_version < | ||
| '3.11'} are available: | ||
| tomli{python_full_version < '3.11'}<=1.2.2 | ||
| tomli{python_full_version < '3.11'}==1.2.3 | ||
| tomli{python_full_version < '3.11'}==2.0.0 | ||
| tomli{python_full_version < '3.11'}==2.0.1 | ||
| tomli{python_full_version < '3.11'}==2.0.2 | ||
| tomli{python_full_version < '3.11'}==2.1.0 | ||
| tomli{python_full_version < '3.11'}==2.2.1 | ||
| tomli{python_full_version < '3.11'}==2.3.0 | ||
| tomli{python_full_version < '3.11'}==2.3.1 | ||
| tomli{python_full_version < '3.11'}==2.4.0 | ||
| tomli{python_full_version < '3.11'}==2.4.1 | ||
| and tomli>=1.2.2 needs to be downloaded from a registry, we can conclude | ||
| that tomli{python_full_version < '3.11'}>=1.2.2,<1.2.3 cannot be used. | ||
| And because hatchling==1.29.0 depends on tomli{python_full_version < | ||
| '3.11'}>=1.2.2, we can conclude that hatchling==1.29.0 cannot be used. | ||
| And because we know from (1) that hatchling>=1.26.3,<=1.28.0 cannot be | ||
| used, we can conclude that all versions of hatchling cannot be used. | ||
| And because you require hatchling, we can conclude that your | ||
| requirements are unsatisfiable. | ||
|
|
||
| hint: Packages were unavailable because the network was disabled. When | ||
| the network is disabled, registry packages may only be read from the | ||
| cache. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this supposed to fail? |
||
|
|
||
|
|
||
|
|
||
| >>> [CLI] bundle destroy --auto-approve | ||
| No active deployment found to destroy! | ||
|
|
||
| Exit code: 1 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| [project] | ||
| name = "immutable" | ||
| version = "0.0.1" | ||
| authors = [{ name = "andrew.nester@databricks.com" }] | ||
| requires-python = ">=3.10,<3.13" | ||
| dependencies = [ | ||
| # Any dependencies for jobs and pipelines in this project can be added here | ||
| # See also https://docs.databricks.com/dev-tools/bundles/library-dependencies | ||
| # | ||
| # LIMITATION: for pipelines, dependencies are cached during development; | ||
| # add dependencies to the 'environment' section of your pipeline.yml file instead | ||
| ] | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "pytest", | ||
| "ruff", | ||
| "databricks-dlt", | ||
| "databricks-connect>=15.4,<15.5", | ||
| "ipykernel", | ||
| ] | ||
|
|
||
| [project.scripts] | ||
| main = "immutable.main:main" | ||
|
|
||
| [build-system] | ||
| requires = ["hatchling"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| [tool.ruff] | ||
| line-length = 120 |
Uh oh!
There was an error while loading. Please reload this page.