|
1 | 1 |
|
2 | | -=== Deploy without recording: ordinary direct-engine state tracking one job, unknown to DMS |
3 | | ->>> [CLI] bundle deploy |
| 2 | +=== Enable history on existing remote file state without replacing the job |
| 3 | +>>> DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=true [CLI] bundle deploy |
4 | 4 | Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-existing-state-[UNIQUE_NAME]/default/files... |
5 | | -Created jobs.one |
6 | | -Files: 2 uploaded, 0 deleted |
7 | | -Resources: 1 created, 0 changed, 0 deleted, 0 unchanged |
| 5 | +Files: 3 uploaded, 0 deleted |
| 6 | +Resources: 0 created, 0 changed, 0 deleted, 1 unchanged |
8 | 7 |
|
9 | | ->>> [CLI] bundle plan -o json |
| 8 | +>>> jq {features: (.features // {}), job_id: .state["resources.jobs.one"].__id__} .databricks/bundle/default/resources.json |
10 | 9 | { |
11 | | - "plan_version": [PLAN_VERSION], |
12 | | - "cli_version": "[CLI_VERSION]", |
13 | | - "lineage": "[UUID]", |
14 | | - "serial": 1 |
15 | | -} |
16 | | - |
17 | | ->>> [CLI] bundle plan |
18 | | -Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged |
19 | | - |
20 | | ->>> print_requests.py --dms //api/2.0/bundle --oneline |
21 | | - |
22 | | ->>> jq {state_version, features} .databricks/bundle/default/resources.json |
23 | | -{ |
24 | | - "state_version": 3, |
25 | | - "features": null |
| 10 | + "features": { |
| 11 | + "deployment_history_shadow": {} |
| 12 | + }, |
| 13 | + "job_id": "[ONE_ID]" |
26 | 14 | } |
27 | 15 |
|
28 | | -=== Enabling recording is refused because the existing deployment is not recorded |
29 | | ->>> DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=true [CLI] bundle deploy |
30 | | -Error: deployment history setting (true) does not match the existing state (false) |
31 | | - |
32 | | -Update experimental.deployment_history to match the existing deployment, or run "databricks bundle destroy" to start over |
33 | | - |
34 | | - |
35 | | ->>> print_requests.py --dms //api/2.0/bundle --oneline |
36 | | - |
37 | | -=== Wiping the local cache still refuses after pulling the non-DMS state from the workspace |
38 | | ->>> DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=true [CLI] bundle deploy |
39 | | -Error: deployment history setting (true) does not match the existing state (false) |
40 | | - |
41 | | -Update experimental.deployment_history to match the existing deployment, or run "databricks bundle destroy" to start over |
42 | | - |
43 | | - |
44 | | -=== A leftover local WAL with the wrong lineage is still refused |
45 | | ->>> DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=true [CLI] bundle deploy |
46 | | -Error: reading state from [TEST_TMP_DIR]/.databricks/bundle/default/resources.json: WAL recovery failed: WAL lineage ("stale") does not match state lineage ("[UUID]") |
47 | | - |
48 | | - |
49 | | -=== Destroy clears the deployment. With nothing recorded remotely the bundle is treated as new, so recording can be enabled once the stale WAL is gone |
50 | | ->>> DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=true [CLI] bundle destroy --auto-approve |
51 | | -The following resources will be deleted: |
52 | | - delete resources.jobs.one |
53 | | - |
54 | | -All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/dms-existing-state-[UNIQUE_NAME]/default |
55 | | - |
56 | | -Destroy: 1 deleted |
57 | | - |
58 | | ->>> DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=true [CLI] bundle deploy |
| 16 | +=== Disable history without replacing the job |
| 17 | +>>> DATABRICKS_BUNDLE_DEPLOYMENT_HISTORY=false [CLI] bundle deploy |
59 | 18 | Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-existing-state-[UNIQUE_NAME]/default/files... |
60 | | -Created jobs.one |
61 | | -Files: 2 uploaded, 0 deleted |
62 | | -Resources: 1 created, 0 changed, 0 deleted, 0 unchanged |
63 | | - |
64 | | ->>> print_requests.py --dms //api/2.0/bundle --oneline |
65 | | -{"method": "POST", "path": "/api/2.0/bundle/deployments", "body": {"display_name": "dms-existing-state-[UNIQUE_NAME]", "initial_parent_path": "/Workspace/Users/[USERNAME]/.bundle/dms-existing-state-[UNIQUE_NAME]/default/state", "target_name": "default", "workspace_info": {"file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-existing-state-[UNIQUE_NAME]/default/files", "root_path": "/Workspace/Users/[USERNAME]/.bundle/dms-existing-state-[UNIQUE_NAME]/default"}}} |
66 | | -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions", "q": {"version_id": "1"}, "body": {"cli_version": "[CLI_VERSION]", "operations": [{"action_type": "OPERATION_ACTION_TYPE_CREATE", "resource_key": "jobs.one"}], "version_type": "VERSION_TYPE_DEPLOY"}} |
67 | | -{"method": "PATCH", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/1/operations/jobs.one", "q": {"update_mask": "state,error_message,resource_id,status"}, "body": {"error_message": "", "resource_id": "[ONE_ID]", "sequence_id": 0, "state": "{\"state\":{\"deployment\":{\"deployment_id\":\"[DEPLOYMENT_ID]\",\"kind\":\"BUNDLE\",\"metadata_file_path\":\"/Workspace/Users/[USERNAME]/.bundle/dms-existing-state-[UNIQUE_NAME]/default/state/metadata.json\",\"version_id\":\"1\"},\"edit_mode\":\"UI_LOCKED\",\"format\":\"MULTI_TASK\",\"max_concurrent_runs\":1,\"name\":\"one\",\"queue\":{\"enabled\":true}}}", "status": "OPERATION_STATUS_SUCCEEDED"}} |
68 | | -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/1/complete", "body": {"completion_reason": "VERSION_COMPLETE_SUCCESS"}} |
| 19 | +Files: 0 uploaded, 0 deleted |
| 20 | +Resources: 0 created, 0 changed, 0 deleted, 1 unchanged |
69 | 21 |
|
70 | | ->>> find.py resources[.]json[.]wal --expect 0 |
71 | | - |
72 | | ->>> jq {state_version, features} .databricks/bundle/default/resources.json |
| 22 | +>>> jq {features: (.features // {}), job_id: .state["resources.jobs.one"].__id__} .databricks/bundle/default/resources.json |
73 | 23 | { |
74 | | - "state_version": 3, |
75 | | - "features": { |
76 | | - "deployment_history_shadow": {} |
77 | | - } |
| 24 | + "features": {}, |
| 25 | + "job_id": "[ONE_ID]" |
78 | 26 | } |
0 commit comments