Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bundles
* `bundle run` now prints the modern job run URL (`/jobs/<id>/runs/<id>`) so that non-admin users permitted to view the run are taken to the run instead of the workspace homepage.
* Fix missing field descriptions in the bundle JSON schema for fields whose upstream API docs arrived after the field was first annotated (e.g. `vector_search_endpoints.*.target_qps`); stale placeholder markers no longer hide them ([#5588](https://github.com/databricks/cli/pull/5588)).
* Expose a computed, read-only `volume_path` on `resources.volumes.*` so configs can reference a volume's Unity Catalog path via `${resources.volumes.<key>.volume_path}` instead of hardcoding `/Volumes/<catalog>/<schema>/<name>` ([#5550](https://github.com/databricks/cli/pull/5550)).

### Dependency updates
* Bump `github.com/databricks/databricks-sdk-go` from v0.141.0 to v0.147.0 ([#5636](https://github.com/databricks/cli/pull/5636)).
Expand Down
2 changes: 2 additions & 0 deletions acceptance/bundle/python/volumes-support/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
"catalog_name": "my_catalog",
"name": "My Volume (updated)",
"schema_name": "my_schema",
"volume_path": "/Volumes/my_catalog/my_schema/My Volume (updated)",
"volume_type": "MANAGED"
},
"my_volume_2": {
"catalog_name": "my_catalog_2",
"name": "My Volume (2) (updated)",
"schema_name": "my_schema_2",
"volume_path": "/Volumes/my_catalog_2/my_schema_2/My Volume (2) (updated)",
"volume_type": "MANAGED"
}
}
Expand Down
1 change: 1 addition & 0 deletions acceptance/bundle/refschema/out.fields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3476,6 +3476,7 @@ resources.volumes.*.updated_at int64 REMOTE
resources.volumes.*.updated_by string REMOTE
resources.volumes.*.url string INPUT
resources.volumes.*.volume_id string REMOTE
resources.volumes.*.volume_path string INPUT
resources.volumes.*.volume_type catalog.VolumeType ALL
resources.volumes.*.grants.full_name string ALL
resources.volumes.*.grants.securable_type string ALL
Expand Down
1 change: 1 addition & 0 deletions acceptance/bundle/resource_deps/bad_syntax/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"catalog_name": "mycatalog",
"name": "barname",
"schema_name": "myschema",
"volume_path": "/Volumes/mycatalog/myschema/barname",
"volume_type": "MANAGED"
},
"foo": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
bundle:
Comment thread
radakam marked this conversation as resolved.
name: testbundle-${UNIQUE_NAME}

resources:
schemas:
my:
catalog_name: main
name: myschema-${UNIQUE_NAME}

volumes:
bar:
catalog_name: main
schema_name: myschema-${UNIQUE_NAME}
name: volumebar-${UNIQUE_NAME}

foo:
catalog_name: main
schema_name: myschema-${UNIQUE_NAME}
name: volumefoo-${UNIQUE_NAME}
comment: ${resources.volumes.bar.volume_path}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions acceptance/bundle/resource_deps/computed_volume_path/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

>>> [CLI] bundle validate -o json
{
"schemas": {
"my": {
"catalog_name": "main",
"name": "myschema-[UNIQUE_NAME]"
}
},
"volumes": {
"bar": {
"catalog_name": "main",
"name": "volumebar-[UNIQUE_NAME]",
"schema_name": "${resources.schemas.my.name}",
"volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumebar-[UNIQUE_NAME]",
"volume_type": "MANAGED"
},
"foo": {
"catalog_name": "main",
"comment": "/Volumes/main/myschema-[UNIQUE_NAME]/volumebar-[UNIQUE_NAME]",
"name": "volumefoo-[UNIQUE_NAME]",
"schema_name": "${resources.schemas.my.name}",
"volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumefoo-[UNIQUE_NAME]",
"volume_type": "MANAGED"
}
}
}

>>> [CLI] bundle plan
create schemas.my
create volumes.bar
create volumes.foo

Plan: 3 to add, 0 to change, 0 to delete, 0 unchanged

>>> print_requests.py --get //unity
4 changes: 4 additions & 0 deletions acceptance/bundle/resource_deps/computed_volume_path/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
envsubst < databricks.yml.tmpl > databricks.yml
trace $CLI bundle validate -o json | jq .resources
trace $CLI bundle plan
trace print_requests.py --get //unity
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"catalog_name": "${resources.catalogs.my_catalog.name}",
"name": "myvolume",
"schema_name": "${resources.schemas.my_schema.name}",
"volume_path": "/Volumes/mycatalog/dev_[USERNAME]_myschema/myvolume",
"volume_type": "MANAGED"
}
}
Expand Down
2 changes: 2 additions & 0 deletions acceptance/bundle/resource_deps/non_existent_field/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
"catalog_name": "mycatalog",
"name": "barname",
"schema_name": "myschema",
"volume_path": "/Volumes/mycatalog/myschema/barname",
"volume_type": "MANAGED"
},
"foo": {
"catalog_name": "${resources.volumes.bar.non_existent}",
"name": "myname",
"schema_name": "${resources.volumes.bar.schema_name}",
"volume_path": "/Volumes/${resources.volumes.bar.non_existent}/myschema/myname",
"volume_type": "MANAGED"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
"catalog_name": "main",
"name": "volumebar-[UNIQUE_NAME]",
"schema_name": "${resources.schemas.my.name}",
"volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumebar-[UNIQUE_NAME]",
"volume_type": "MANAGED"
},
"foo": {
"catalog_name": "main",
"comment": "${resources.volumes.bar.storage_location}",
"name": "volumefoo-[UNIQUE_NAME]",
"schema_name": "${resources.schemas.my.name}",
"volume_path": "/Volumes/main/myschema-[UNIQUE_NAME]/volumefoo-[UNIQUE_NAME]",
"volume_type": "MANAGED"
}
}
Expand Down
2 changes: 2 additions & 0 deletions acceptance/bundle/resource_deps/resources_var/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
"catalog_name": "mycatalog",
"name": "barname",
"schema_name": "myschema",
"volume_path": "/Volumes/mycatalog/myschema/barname",
"volume_type": "MANAGED"
},
"foo": {
"catalog_name": "${resources.volumes.bar.catalog_name}",
"name": "myname",
"schema_name": "${resources.volumes.bar.schema_name}",
"volume_path": "/Volumes/mycatalog/myschema/myname",
"volume_type": "MANAGED"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"catalog_name": "${resources.schemas.bar.catalog_name}",
"name": "myname",
"schema_name": "${resources.schemas.bar.name}",
"volume_path": "/Volumes/mycatalog/dev_[USERNAME]_myschema/myname",
"volume_type": "MANAGED"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
bundle:
name: test-bundle

# volume_path is a CLI-only computed field (not API state). When a component
# (catalog_name, schema_name, name) is an unresolved ${...} reference, it stays
# embedded in volume_path so it resolves later at plan/deploy.
#
# Chain under test: bar.name is a remote value (baz.id), so bar.volume_path is
# computed at initialize with that reference intact; foo.comment picks up that
# string and resolves at deploy to the fully-resolved path.
#
# baz.id is used instead of baz.storage_location because the resolved value
# becomes bar's name, and the testserver can't route a name containing the
# slashes of a storage_location URL.
resources:
volumes:
baz:
catalog_name: mycatalog
schema_name: myschema
name: bazname
bar:
catalog_name: mycatalog
schema_name: myschema
name: ${resources.volumes.baz.id}
foo:
catalog_name: mycatalog
schema_name: myschema
name: fooname
comment: ${resources.volumes.bar.volume_path}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

>>> errcode [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"method": "POST",
"path": "/api/2.1/unity-catalog/volumes",
"body": {
"catalog_name": "mycatalog",
"comment": "/Volumes/mycatalog/myschema/mycatalog.myschema.bazname",
"name": "fooname",
"schema_name": "myschema",
"volume_type": "MANAGED"
}
}
{
"method": "POST",
"path": "/api/2.1/unity-catalog/volumes",
"body": {
"catalog_name": "mycatalog",
"name": "bazname",
"schema_name": "myschema",
"volume_type": "MANAGED"
}
}
{
"method": "POST",
"path": "/api/2.1/unity-catalog/volumes",
"body": {
"catalog_name": "mycatalog",
"name": "mycatalog.myschema.bazname",
"schema_name": "myschema",
"volume_type": "MANAGED"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"method": "GET",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.bazname"
}
{
"method": "GET",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.fooname"
}
{
"method": "GET",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.mycatalog.myschema.bazname"
}
{
"method": "POST",
"path": "/api/2.1/unity-catalog/volumes",
"body": {
"catalog_name": "mycatalog",
"comment": "/Volumes/mycatalog/myschema/mycatalog.myschema.bazname",
"name": "fooname",
"schema_name": "myschema",
"volume_type": "MANAGED"
}
}
{
"method": "POST",
"path": "/api/2.1/unity-catalog/volumes",
"body": {
"catalog_name": "mycatalog",
"name": "bazname",
"schema_name": "myschema",
"volume_type": "MANAGED"
}
}
{
"method": "POST",
"path": "/api/2.1/unity-catalog/volumes",
"body": {
"catalog_name": "mycatalog",
"name": "mycatalog.myschema.bazname",
"schema_name": "myschema",
"volume_type": "MANAGED"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

>>> errcode [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
The following resources will be deleted:
delete resources.volumes.bar
delete resources.volumes.baz
delete resources.volumes.foo

This action will result in the deletion of the following volumes.
For managed volumes, the files stored in the volume are also deleted from your
cloud tenant within 30 days. For external volumes, the metadata about the volume
is removed from the catalog, but the underlying files are not deleted:
delete resources.volumes.bar
delete resources.volumes.baz
delete resources.volumes.foo

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default

Deleting files...
Destroy complete!
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
The following resources will be deleted:
delete resources.volumes.bar
delete resources.volumes.baz
delete resources.volumes.foo

This action will result in the deletion of the following volumes.
For managed volumes, the files stored in the volume are also deleted from your
cloud tenant within 30 days. For external volumes, the metadata about the volume
is removed from the catalog, but the underlying files are not deleted:
delete resources.volumes.bar
delete resources.volumes.baz
delete resources.volumes.foo

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default

Deleting files...
Destroy complete!
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"method": "DELETE",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.bazname"
}
{
"method": "DELETE",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.fooname"
}
{
"method": "DELETE",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.mycatalog.myschema.bazname"
}
{
"method": "GET",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.bazname"
}
{
"method": "GET",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.fooname"
}
{
"method": "GET",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.mycatalog.myschema.bazname"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"method": "DELETE",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.bazname"
}
{
"method": "DELETE",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.fooname"
}
{
"method": "DELETE",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.mycatalog.myschema.bazname"
}
{
"method": "GET",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.bazname"
}
{
"method": "GET",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.fooname"
}
{
"method": "GET",
"path": "/api/2.1/unity-catalog/volumes/mycatalog.myschema.mycatalog.myschema.bazname"
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading