-
Notifications
You must be signed in to change notification settings - Fork 209
bundle: route config sync write-back to the block that defines each change #6138
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
Changes from all commits
b09caf1
c23e7ed
90a8e6e
c439bed
8c81393
8b3e0a8
f080114
13a950a
6865e8d
6f09c49
4c00ff7
1544e89
a5b9de5
72f83f7
8addc15
21eef0c
8ca0df5
ffb1028
ecbad19
fa2140b
e803e40
c81059b
48c6040
e187626
0138f43
9d10f4e
20434a5
9b75e0b
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 |
|---|---|---|
|
|
@@ -97,21 +97,14 @@ Resource: resources.jobs.rename_task_job | |
| >>> diff.py databricks.yml.backup2 databricks.yml | ||
| --- databricks.yml.backup2 | ||
| +++ databricks.yml | ||
| @@ -52,14 +52,14 @@ | ||
| @@ -52,5 +52,5 @@ | ||
| rename_task_job: | ||
| tasks: | ||
| - - task_key: b_task | ||
| + - new_cluster: | ||
| + node_type_id: [NODE_TYPE_ID] | ||
| + num_workers: 1 | ||
| + spark_version: 13.3.x-snapshot-scala2.12 | ||
| + - task_key: b_task_renamed | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, no changes in fields but diff is less noisy because task renames are now handled better |
||
| notebook_task: | ||
| notebook_path: /Users/{{workspace_user_name}}/b_task | ||
| - new_cluster: | ||
| - spark_version: 13.3.x-snapshot-scala2.12 | ||
| - node_type_id: [NODE_TYPE_ID] | ||
| - num_workers: 1 | ||
| + task_key: b_task_renamed | ||
| @@ -61,5 +61,5 @@ | ||
| - task_key: d_task | ||
| depends_on: | ||
| - - task_key: b_task | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| bundle: | ||
| name: test-bundle-$UNIQUE_NAME | ||
|
|
||
| # cluster_id makes OverrideCompute replace each task's compute with | ||
| # existing_cluster_id. It builds that value in Go, so the leaf is present in the | ||
| # merged config but carries no source location -- unlike a field absent from the | ||
| # config, which has no value either. Routing by location therefore finds nothing, and | ||
| # on a task defined in both blocks there is no winning definition to fall back on. The | ||
| # field is not declared anywhere, so writing it is an addition. | ||
|
|
||
| resources: | ||
| jobs: | ||
| cli_default_job: | ||
| tasks: | ||
| - task_key: shared | ||
| max_retries: 1 | ||
| new_cluster: | ||
| spark_version: 13.3.x-scala2.12 | ||
| num_workers: 1 | ||
| notebook_task: | ||
| notebook_path: /Users/{{workspace_user_name}}/nb | ||
|
|
||
| targets: | ||
| dev: | ||
| mode: development | ||
| cluster_id: 0101-000000-abcd1234 | ||
| resources: | ||
| jobs: | ||
| cli_default_job: | ||
| tasks: | ||
| - task_key: shared | ||
| timeout_seconds: 45 |
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,41 @@ | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| === existing_cluster_id is injected by OverrideCompute; the YAML has none | ||
| >>> grep -c existing_cluster_id databricks.yml | ||
| 1 | ||
|
|
||
| === Edit that locationless field remotely on a two-block task | ||
| === Sync | ||
| Detected changes in 1 resource(s): | ||
|
|
||
| Resource: resources.jobs.cli_default_job | ||
| tasks[task_key='shared'].existing_cluster_id: add | ||
|
|
||
|
|
||
|
|
||
| === The field is added to the block declaring the resource | ||
|
|
||
| >>> diff.py databricks.yml.backup databricks.yml | ||
| --- databricks.yml.backup | ||
| +++ databricks.yml | ||
| @@ -20,4 +20,5 @@ | ||
| notebook_task: | ||
| notebook_path: /Users/{{workspace_user_name}}/nb | ||
| + existing_cluster_id: 0101-000000-remote1 | ||
|
|
||
| targets: | ||
|
|
||
| >>> grep -c existing_cluster_id: 0101-000000-remote1 databricks.yml | ||
| 1 | ||
|
|
||
| >>> [CLI] bundle destroy --auto-approve -t dev | ||
| The following resources will be deleted: | ||
| delete resources.jobs.cli_default_job | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev | ||
|
|
||
| Deleting files... | ||
| Destroy complete! |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #!/bin/bash | ||
| envsubst < databricks.yml.tmpl > databricks.yml | ||
| cleanup() { trace $CLI bundle destroy --auto-approve -t dev; } | ||
| trap cleanup EXIT | ||
| $CLI bundle deploy -t dev | ||
| job_id="$(read_id.py cli_default_job)" | ||
|
|
||
| title "existing_cluster_id is injected by OverrideCompute; the YAML has none" | ||
| errcode trace grep -c "existing_cluster_id" databricks.yml | ||
|
|
||
| title "Edit that locationless field remotely on a two-block task" | ||
| edit_resource.py jobs $job_id <<PYEDIT | ||
| for task in r["tasks"]: | ||
| if task["task_key"] == "shared": | ||
| task["existing_cluster_id"] = "0101-000000-remote1" | ||
| PYEDIT | ||
|
|
||
| title "Sync" | ||
| echo | ||
| cp databricks.yml databricks.yml.backup | ||
| errcode $CLI bundle config-remote-sync -t dev --save | ||
| title "The field is added to the block declaring the resource" | ||
| echo | ||
| trace diff.py databricks.yml.backup databricks.yml | ||
| errcode trace grep -c "existing_cluster_id: 0101-000000-remote1" databricks.yml | ||
| rm databricks.yml.backup |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| bundle: | ||
| name: test-bundle-$UNIQUE_NAME | ||
|
|
||
| # A target name may contain a dot. The write path to an override block is | ||
| # targets.<target>.<field>, which is parsed back into segments, so a dotted name has to | ||
| # be quoted or "dev.eu" becomes two keys and addresses a node that does not exist. | ||
| resources: | ||
| jobs: | ||
| dotted_job: | ||
| tasks: | ||
| - task_key: main | ||
| max_retries: 1 | ||
| notebook_task: | ||
| notebook_path: /Users/{{workspace_user_name}}/nb | ||
|
|
||
| targets: | ||
| dev.eu: | ||
| mode: development | ||
| resources: | ||
| jobs: | ||
| dotted_job: | ||
| tasks: | ||
| - task_key: main | ||
| timeout_seconds: 45 |
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,33 @@ | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev.eu/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| === Edit a field in the override block of a target whose name contains a dot | ||
| === Sync | ||
| Detected changes in 1 resource(s): | ||
|
|
||
| Resource: resources.jobs.dotted_job | ||
| tasks[task_key='main'].timeout_seconds: replace | ||
|
|
||
|
|
||
|
|
||
| === The override block is updated | ||
|
|
||
| >>> diff.py databricks.yml.backup databricks.yml | ||
| --- databricks.yml.backup | ||
| +++ databricks.yml | ||
| @@ -22,3 +22,3 @@ | ||
| tasks: | ||
| - task_key: main | ||
| - timeout_seconds: 45 | ||
| + timeout_seconds: 900 | ||
|
|
||
| >>> [CLI] bundle destroy --auto-approve -t dev.eu | ||
| The following resources will be deleted: | ||
| delete resources.jobs.dotted_job | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev.eu | ||
|
|
||
| Deleting files... | ||
| Destroy complete! |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/bin/bash | ||
| envsubst < databricks.yml.tmpl > databricks.yml | ||
| cleanup() { trace $CLI bundle destroy --auto-approve -t dev.eu; } | ||
| trap cleanup EXIT | ||
| $CLI bundle deploy -t dev.eu | ||
| job_id="$(read_id.py -t dev.eu dotted_job)" | ||
|
|
||
| title "Edit a field in the override block of a target whose name contains a dot" | ||
| edit_resource.py jobs $job_id <<PYEDIT | ||
| for task in r["tasks"]: | ||
| if task["task_key"] == "main": | ||
| task["timeout_seconds"] = 900 | ||
| PYEDIT | ||
|
|
||
| title "Sync" | ||
| echo | ||
| cp databricks.yml databricks.yml.backup | ||
| errcode $CLI bundle config-remote-sync -t dev.eu --save | ||
| title "The override block is updated" | ||
| echo | ||
| trace diff.py databricks.yml.backup databricks.yml | ||
| rm databricks.yml.backup |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| bundle: | ||
| name: test-bundle-$UNIQUE_NAME | ||
|
|
||
| # job_a's task list is split across both blocks and one task, "shared", is defined | ||
| # in both. job_b is an ordinary single-block job. | ||
| # | ||
| # The point of the fixture: an unrelated resource's change must still be applied | ||
| # in the same run as a structural change to a split element. The sync is | ||
| # unattended, so one harder change must never stop the rest. | ||
| resources: | ||
| jobs: | ||
| job_a: | ||
| tasks: | ||
| - task_key: shared | ||
| max_retries: 1 | ||
| notebook_task: | ||
| notebook_path: /Users/{{workspace_user_name}}/shared | ||
|
|
||
| job_b: | ||
| max_concurrent_runs: 1 | ||
| tasks: | ||
| - task_key: simple | ||
| notebook_task: | ||
| notebook_path: /Users/{{workspace_user_name}}/simple | ||
|
|
||
| targets: | ||
| dev: | ||
| mode: development | ||
| resources: | ||
| jobs: | ||
| job_a: | ||
| tasks: | ||
| - task_key: shared | ||
| timeout_seconds: 45 |
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,59 @@ | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| === Rename the two-block task on job_a, and edit job_b in the same run | ||
| === Sync | ||
| Detected changes in 2 resource(s): | ||
|
|
||
| Resource: resources.jobs.job_a | ||
| tasks[task_key='shared']: remove | ||
| tasks[task_key='shared_renamed']: add | ||
|
|
||
| Resource: resources.jobs.job_b | ||
| max_concurrent_runs: replace | ||
|
|
||
|
|
||
|
|
||
| === job_b is updated, and job_a's rename is written in both blocks | ||
|
|
||
| >>> diff.py databricks.yml.backup databricks.yml | ||
| --- databricks.yml.backup | ||
| +++ databricks.yml | ||
| @@ -12,5 +12,5 @@ | ||
| job_a: | ||
| tasks: | ||
| - - task_key: shared | ||
| + - task_key: shared_renamed | ||
| max_retries: 1 | ||
| notebook_task: | ||
| @@ -18,5 +18,5 @@ | ||
|
|
||
| job_b: | ||
| - max_concurrent_runs: 1 | ||
| + max_concurrent_runs: 6 | ||
| tasks: | ||
| - task_key: simple | ||
| @@ -31,4 +31,4 @@ | ||
| job_a: | ||
| tasks: | ||
| - - task_key: shared | ||
| + - task_key: shared_renamed | ||
| timeout_seconds: 45 | ||
|
|
||
| >>> grep -c max_concurrent_runs: 6 databricks.yml | ||
| 1 | ||
|
|
||
| >>> grep -c task_key: shared_renamed databricks.yml | ||
| 2 | ||
|
|
||
| >>> [CLI] bundle destroy --auto-approve -t dev | ||
| The following resources will be deleted: | ||
| delete resources.jobs.job_a | ||
| delete resources.jobs.job_b | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev | ||
|
|
||
| Deleting files... | ||
| Destroy complete! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an expected change, the only changed field is still "spark_version" but new diff is less noisy,