Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"plan": {
"resources.jobs.test_job": {
"action": "create",
"new_state": {
"config": {
"deployment": {
"kind": "BUNDLE",
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json"
},
"edit_mode": "UI_LOCKED",
"environments": [
{
"environment_key": "test_env",
"spec": {
"client": "1",
"dependencies": [
"/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl"
]
}
}
],
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "[default] My Wheel Job",
"queue": {
"enabled": true
},
"tasks": [
{
"environment_key": "test_env",
"python_wheel_task": {
"entry_point": "run",
"package_name": "my_test_code"
},
"task_key": "ServerlessTestTask"
},
{
"existing_cluster_id": "0717-132531-5opeqon1",
"for_each_task": {
"inputs": "[1]",
"task": {
"existing_cluster_id": "0717-132531-5opeqon1",
"libraries": [
{
"whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl"
}
],
"python_wheel_task": {
"entry_point": "run",
"package_name": "my_test_code"
},
"task_key": "SubTask"
}
},
"libraries": [
{
"whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl"
},
{
"whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/other_test_code-0.0.1+[UNIX_TIME_NANOS][1]-py3-none-any.whl"
}
],
"python_wheel_task": {
"entry_point": "run",
"package_name": "my_test_code"
},
"task_key": "TestTask"
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plan": {
"resources.jobs.test_job": {
"action": "create"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"plan": {
"resources.jobs.test_job": {
"action": "update",
"new_state": {
"config": {
"deployment": {
"kind": "BUNDLE",
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json"
},
"edit_mode": "UI_LOCKED",
"environments": [
{
"environment_key": "test_env",
"spec": {
"client": "1",
"dependencies": [
"/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl"
]
}
}
],
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "[default] My Wheel Job",
"queue": {
"enabled": true
},
"tasks": [
{
"environment_key": "test_env",
"python_wheel_task": {
"entry_point": "run",
"package_name": "my_test_code"
},
"task_key": "ServerlessTestTask"
},
{
"existing_cluster_id": "0717-132531-5opeqon1",
"for_each_task": {
"inputs": "[1]",
"task": {
"existing_cluster_id": "0717-132531-5opeqon1",
"libraries": [
{
"whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl"
}
],
"python_wheel_task": {
"entry_point": "run",
"package_name": "my_test_code"
},
"task_key": "SubTask"
}
},
"libraries": [
{
"whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl"
},
{
"whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/other_test_code-0.0.1+[UNIX_TIME_NANOS][1]-py3-none-any.whl"
}
],
"python_wheel_task": {
"entry_point": "run",
"package_name": "my_test_code"
},
"task_key": "TestTask"
}
]
}
},
"changes": {
"local": {
"environments[0].spec.dependencies[0]": {
"action": "update"
},
"tasks[1].for_each_task.task.libraries[0].whl": {
"action": "update"
},
"tasks[1].libraries[0].whl": {
"action": "update"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plan": {
"resources.jobs.test_job": {
"action": "update"
}
}
}
3 changes: 3 additions & 0 deletions acceptance/bundle/artifacts/whl_dynamic/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"type": "whl"
}
}
Building my_test_code...

>>> [CLI] bundle deploy
Building my_test_code...
Expand Down Expand Up @@ -103,6 +104,8 @@ my_test_code-0.0.1+[UNIX_TIME_NANOS][1].dist-info/RECORD
"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/prebuilt/other_test_code-0.0.1-py3-none-any.whl"

=== Updating the local wheel and deploying again
Building my_test_code...

>>> [CLI] bundle deploy
Building my_test_code...
Uploading .databricks/bundle/default/patched_wheels/my_prebuilt_whl_other_test_code/other_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl...
Expand Down
4 changes: 3 additions & 1 deletion acceptance/bundle/artifacts/whl_dynamic/script
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cp -r $TESTDIR/../whl_prebuilt_multiple/dist/lib/other_test_code-0.0.1-py3-none-

trace $CLI bundle validate -o json | jq .artifacts

$CLI bundle debug plan > out.plan_create.$DATABRICKS_BUNDLE_ENGINE.json
trace $CLI bundle deploy

title "There are 2 original wheels and 2 patched ones"
Expand All @@ -22,8 +23,9 @@ trace jq .path < out.requests.txt | grep import | grep whl | sort

rm out.requests.txt

title "Updating the local wheel and deploying again"
title "Updating the local wheel and deploying again\n"
touch my_test_code/src/new_module.py
$CLI bundle debug plan > out.plan_update.$DATABRICKS_BUNDLE_ENGINE.json
trace $CLI bundle deploy

title "Verify contents, it should now have new_module.py"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
Error: cannot resolve "${resources.jobs.foo.url}": schema mismatch: url: field "url" not found in resources.Job; url: field "url" not found in jobs.Job

Error: cannot plan resources.jobs.bar: dependency failed: resources.jobs.foo
Error: cannot plan resources.jobs.bar: cannot resolve "${resources.jobs.foo.url}": schema mismatch: url: field "url" not found in jobs.JobSettings; url: field "url" not found in jobs.Job

Error: planning failed

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
Error: cannot resolve "${resources.jobs.foo.url}": schema mismatch: url: field "url" not found in resources.Job; url: field "url" not found in jobs.Job

Error: cannot plan resources.jobs.bar: dependency failed: resources.jobs.foo
Error: cannot plan resources.jobs.bar: cannot resolve "${resources.jobs.foo.url}": schema mismatch: url: field "url" not found in jobs.JobSettings; url: field "url" not found in jobs.Job

Error: planning failed

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"plan": {
"resources.models.my_model": {
"action": "update",
"new_state": {
"config": {
"description": "new-description-[UNIQUE_NAME]",
"name": "original-name-[UNIQUE_NAME]",
"tags": [
{
"key": "key1",
"value": "value1"
}
]
}
},
"changes": {
"local": {
"description": {
"action": "update"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plan": {
"resources.models.my_model": {
"action": "update"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"plan": {
"resources.models.my_model": {
"action": "recreate",
"new_state": {
"config": {
"description": "new-description-[UNIQUE_NAME]",
"name": "new-name-[UNIQUE_NAME]",
"tags": [
{
"key": "key1",
"value": "value1"
}
]
}
},
"changes": {
"local": {
"name": {
"action": "recreate"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plan": {
"resources.models.my_model": {
"action": "recreate"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"plan": {
"resources.models.my_model": {
"action": "skip",
"changes": {
"local": {
"tags": {
"action": "skip"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plan": {
"resources.models.my_model": {
"action": "update"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
update models.my_model

Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged
5 changes: 1 addition & 4 deletions acceptance/bundle/deploy/models/basic/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,8 @@ Deployment complete!
]
}

=== add a new tag, this should be a no-op
=== add a new tag, this should be a no-op; terraform does make an update request but since update request has no tags in it, it does nothing; direct skips request completely
>>> [CLI] bundle plan
update models.my_model

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

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-models-basic-[UNIQUE_NAME]/default/files...
Expand Down
7 changes: 5 additions & 2 deletions acceptance/bundle/deploy/models/basic/script
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ trace export MODEL_DESCRIPTION=new-description-$UNIQUE_NAME
envsubst < templates/one_tag.tmpl > databricks.yml
title "update the description, this should update the description remotely as well"
trace $CLI bundle plan
$CLI bundle debug plan > out.plan_update_description.$DATABRICKS_BUNDLE_ENGINE.json
trace $CLI bundle deploy
trace $CLI model-registry get-model $MODEL_NAME | jq '.registered_model_databricks | {name, description, tags}'

trace export MODEL_NAME=new-name-$UNIQUE_NAME
envsubst < templates/one_tag.tmpl > databricks.yml
title "update the name, this should recreate the model with the new name"
trace $CLI bundle plan
$CLI bundle debug plan > out.plan_update_name.$DATABRICKS_BUNDLE_ENGINE.json
trace $CLI bundle deploy
trace $CLI model-registry get-model $MODEL_NAME | jq '.registered_model_databricks | {name, description, tags}'

title "add a new tag, this should be a no-op"
title "add a new tag, this should be a no-op; terraform does make an update request but since update request has no tags in it, it does nothing; direct skips request completely"
envsubst < templates/two_tag.tmpl > databricks.yml
trace $CLI bundle plan
trace $CLI bundle plan > out.plan_update_tag.$DATABRICKS_BUNDLE_ENGINE.txt
$CLI bundle debug plan > out.plan_update_tag.$DATABRICKS_BUNDLE_ENGINE.json
trace $CLI bundle deploy
trace $CLI model-registry get-model $MODEL_NAME | jq '.registered_model_databricks | {name, description, tags}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resources:
jobs:
bar:
name: job bar
foo:
name: job foo
tasks:
- task_key: job_task
run_job_task:
job_id: ${resources.jobs.bar.name}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

>>> musterr [CLI] bundle plan
Error: cannot plan resources.jobs.foo: cannot update tasks[0].run_job_task.job_id with value of "${resources.jobs.bar.name}": cannot set (*jobs.JobSettings).tasks[0].run_job_task.job_id to string ("job bar"): cannot parse "job bar" as int64: strconv.ParseInt: parsing "job bar": invalid syntax

Error: planning failed


Exit code (musterr): 1
Loading
Loading