-
Notifications
You must be signed in to change notification settings - Fork 188
Expose computed volume_path during initialize #5550
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
f31555c
16e2e5e
4883fe4
fc1dce6
5dd57ce
6d09441
84be784
d44f9f5
10fc272
401c22c
c91c9e2
ac9ba6f
b3d6786
9e10998
b763929
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,24 @@ | ||
| bundle: | ||
| name: test-bundle-$UNIQUE_NAME | ||
|
|
||
| # A job parameter references a volume's computed volume_path, and the volume's | ||
| # schema_name/name are references to another job's remote creator_user_name. So | ||
| # volume_path embeds a reference at initialize that only resolves at deploy, | ||
| # exercising the deferred-resolution chain (foo -> data.volume_path -> process) | ||
| # end to end with no drift afterwards. | ||
| resources: | ||
| jobs: | ||
| foo: | ||
| name: test-job-foo-$UNIQUE_NAME | ||
|
|
||
| process: | ||
| name: test-job-process-$UNIQUE_NAME | ||
| parameters: | ||
| - name: data_path | ||
| default: ${resources.volumes.data.volume_path} | ||
|
|
||
| volumes: | ||
| data: | ||
| catalog_name: main | ||
| schema_name: ${resources.jobs.foo.creator_user_name} | ||
| name: ${resources.jobs.foo.creator_user_name} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,20 @@ | ||
| bundle: | ||
| 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.
| 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 |
| 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 |
|---|---|---|
| @@ -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} | ||
|
radakam marked this conversation as resolved.
|
||
| 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! |
Uh oh!
There was an error while loading. Please reload this page.