Skip to content
Draft
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
2 changes: 1 addition & 1 deletion acceptance/bundle/deployment/bind/alert/out.test.toml

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

2 changes: 1 addition & 1 deletion acceptance/bundle/deployment/bind/catalog/out.test.toml

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

2 changes: 1 addition & 1 deletion acceptance/bundle/deployment/bind/cluster/out.test.toml

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

2 changes: 1 addition & 1 deletion acceptance/bundle/deployment/bind/dashboard/out.test.toml

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,5 @@
# This dumps the state file after bind, whose serial counts local state writes; under DMS the
# service owns the version number instead, so the dumped serial differs. That is an engine-level
# difference, not a bind one, and DMS bind is covered by bundle/dms/bind-unbind, so skip the DMS
# variant here.
EnvMatrix.DMS = [""]

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

2 changes: 1 addition & 1 deletion acceptance/bundle/deployment/bind/experiment/out.test.toml

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.

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.

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.

5 changes: 5 additions & 0 deletions acceptance/bundle/deployment/bind/job/noop-job/test.toml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
Cloud = false # test leaves deployed job

# `jobs get` shows the job's deployment block, which under DMS also carries the
# deployment_id/version_id stamp - an engine-level difference, not a bind one. DMS bind is covered
# by bundle/dms/bind-unbind, so skip the DMS variant here.
EnvMatrix.DMS = [""]
5 changes: 5 additions & 0 deletions acceptance/bundle/deployment/bind/job/python-job/test.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
Cloud = false # test leaves deployed job
Timeout = '40s' # python can be slow in CI likely due to caching problems

# `jobs get` shows the job's deployment block, which under DMS also carries the
# deployment_id/version_id stamp - an engine-level difference, not a bind one. DMS bind is covered
# by bundle/dms/bind-unbind, so skip the DMS variant here.
EnvMatrix.DMS = [""]

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.

5 changes: 5 additions & 0 deletions acceptance/bundle/deployment/bind/pipelines/test.toml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
Cloud = false

# These assert the deploy's request bodies, which under DMS also carry the pipeline's
# deployment_id/version_id stamp - an engine-level difference, not a bind one. DMS bind is covered
# by bundle/dms/bind-unbind, so skip the DMS variant here.
EnvMatrix.DMS = [""]

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.

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.

2 changes: 1 addition & 1 deletion acceptance/bundle/deployment/bind/schema/out.test.toml

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.

2 changes: 0 additions & 2 deletions acceptance/bundle/deployment/bind/test.toml

This file was deleted.

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.

2 changes: 1 addition & 1 deletion acceptance/bundle/deployment/bind/volume/out.test.toml

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.

2 changes: 1 addition & 1 deletion acceptance/bundle/deployment/unbind/grants/out.test.toml

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

5 changes: 5 additions & 0 deletions acceptance/bundle/deployment/unbind/job/test.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
Cloud = false # test leaves deployed job
Ignore = [".databricks"]

# The final `jobs get` shows the job's deployment block, which under DMS also carries the
# deployment_id/version_id stamp; that is an engine-level difference, not an unbind one, and DMS
# unbind is covered by bundle/dms/bind-unbind. So skip the DMS variant here.
EnvMatrix.DMS = [""]

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

5 changes: 5 additions & 0 deletions acceptance/bundle/deployment/unbind/python-job/test.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Cloud = false # test leaves deployed job
Ignore = [".databricks"]
Timeout = '40s' # python can be slow in CI likely due to caching problems

# The final `jobs get` shows the job's deployment block, which under DMS also carries the
# deployment_id/version_id stamp; that is an engine-level difference, not an unbind one, and DMS
# unbind is covered by bundle/dms/bind-unbind. So skip the DMS variant here.
EnvMatrix.DMS = [""]
2 changes: 0 additions & 2 deletions acceptance/bundle/deployment/unbind/test.toml

This file was deleted.

16 changes: 0 additions & 16 deletions acceptance/bundle/dms/bind-unbind-unsupported/output.txt

This file was deleted.

16 changes: 0 additions & 16 deletions acceptance/bundle/dms/bind-unbind-unsupported/script

This file was deleted.

3 changes: 0 additions & 3 deletions acceptance/bundle/dms/bind-unbind-unsupported/test.toml

This file was deleted.

3 changes: 3 additions & 0 deletions acceptance/bundle/dms/bind-unbind/out.test.toml

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

80 changes: 80 additions & 0 deletions acceptance/bundle/dms/bind-unbind/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@

=== Bind an existing job to the bundle, recorded with the deployment history service
>>> [CLI] bundle deployment bind foo [JOB_ID] --auto-approve
Successfully bound job with an id '[JOB_ID]'
Run 'bundle deploy' to deploy changes to your workspace

=== The service now records the job as managed, so it plans as a change not a create
>>> [CLI] bundle plan
update jobs.foo

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

=== Unbind it again, dropping it from what the service records
>>> [CLI] bundle deployment unbind foo

=== No longer managed, so it plans as a fresh create
>>> [CLI] bundle plan
create jobs.foo

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

=== Each recorded a version whose operation carries the bind / unbind action type
>>> print_requests.py --dms --method POST //versions --nostamp
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[NUMID]/versions",
"q": {
"version_id": "1"
},
"body": {
"cli_version": "[CLI_VERSION]",
"version_type": "VERSION_TYPE_DEPLOY",
"operations": [
{
"resource_key": "jobs.foo",
"action_type": "OPERATION_ACTION_TYPE_BIND"
}
]
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[NUMID]/versions/1/complete",
"body": {
"completion_reason": "VERSION_COMPLETE_SUCCESS"
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[NUMID]/versions",
"q": {
"version_id": "2"
},
"body": {
"cli_version": "[CLI_VERSION]",
"version_type": "VERSION_TYPE_DEPLOY",
"previous_version_id": "1",
"operations": [
{
"resource_key": "jobs.foo",
"action_type": "OPERATION_ACTION_TYPE_UNBIND"
}
]
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[NUMID]/versions/2/complete",
"body": {
"completion_reason": "VERSION_COMPLETE_SUCCESS"
}
}

=== Test cleanup
>>> [CLI] bundle destroy --auto-approve
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/dms-bind-unbind-[UNIQUE_NAME]/default

Destroy: 0 deleted

>>> [CLI] jobs delete [JOB_ID]
27 changes: 27 additions & 0 deletions acceptance/bundle/dms/bind-unbind/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
envsubst < databricks.yml.tmpl > databricks.yml

job_id=$($CLI jobs create --json '{"name": "bind-target-'$UNIQUE_NAME'"}' | jq -r '.job_id')
add_repl "$job_id" JOB_ID

cleanup() {
title "Test cleanup"
trace $CLI bundle destroy --auto-approve
trace $CLI jobs delete "$job_id"
rm -f out.requests.txt
}
trap cleanup EXIT

title "Bind an existing job to the bundle, recorded with the deployment history service"
trace $CLI bundle deployment bind foo "$job_id" --auto-approve

title "The service now records the job as managed, so it plans as a change not a create"
trace $CLI bundle plan

title "Unbind it again, dropping it from what the service records"
trace $CLI bundle deployment unbind foo

title "No longer managed, so it plans as a fresh create"
trace $CLI bundle plan

title "Each recorded a version whose operation carries the bind / unbind action type"
trace print_requests.py --dms --method POST //versions --nostamp
9 changes: 9 additions & 0 deletions acceptance/bundle/dms/record-op-fault/databricks.yml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bundle:
name: dms-record-op-fault-$UNIQUE_NAME
experimental:
deployment_history: true

resources:
jobs:
foo:
name: foo
Loading
Loading