diff --git a/acceptance/bundle/config-remote-sync/yaml_anchors/databricks.yml.tmpl b/acceptance/bundle/config-remote-sync/yaml_anchors/databricks.yml.tmpl new file mode 100644 index 00000000000..dbd4ec74bda --- /dev/null +++ b/acceptance/bundle/config-remote-sync/yaml_anchors/databricks.yml.tmpl @@ -0,0 +1,36 @@ +bundle: + name: test-bundle-$UNIQUE_NAME + +resources: + jobs: + my_job: + job_clusters: + - job_cluster_key: main + new_cluster: &cluster + spark_version: $DEFAULT_SPARK_VERSION + node_type_id: $NODE_TYPE_ID + num_workers: 1 + - job_cluster_key: large + new_cluster: *cluster + tasks: + - task_key: setup + job_cluster_key: main + notebook_task: + notebook_path: /Users/{{workspace_user_name}}/setup + libraries: &common_libs + - pypi: + package: requests + - task_key: ingest + job_cluster_key: main + notebook_task: + notebook_path: /Users/{{workspace_user_name}}/ingest + libraries: *common_libs + - task_key: transform + job_cluster_key: main + notebook_task: + notebook_path: /Users/{{workspace_user_name}}/transform + libraries: *common_libs + +targets: + default: + mode: development diff --git a/acceptance/bundle/config-remote-sync/yaml_anchors/out.test.toml b/acceptance/bundle/config-remote-sync/yaml_anchors/out.test.toml new file mode 100644 index 00000000000..a4f8dd5ef74 --- /dev/null +++ b/acceptance/bundle/config-remote-sync/yaml_anchors/out.test.toml @@ -0,0 +1,3 @@ +Cloud = true +GOOS.windows = false +EnvMatrix.DMS = ["", "true"] diff --git a/acceptance/bundle/config-remote-sync/yaml_anchors/output.txt b/acceptance/bundle/config-remote-sync/yaml_anchors/output.txt new file mode 100644 index 00000000000..0f503724607 --- /dev/null +++ b/acceptance/bundle/config-remote-sync/yaml_anchors/output.txt @@ -0,0 +1,62 @@ +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files... +Created jobs.my_job +Files: 2 uploaded, 0 deleted +Resources: 1 created, 0 changed, 0 deleted, 0 unchanged + +=== Remove the libraries of the task that defines the anchor, change the library of one aliased task and move another to the large cluster + +=== Detect and save changes +Detected changes in 1 resource(s): + +Resource: resources.jobs.my_job + tasks[task_key='ingest'].libraries[0].pypi.package: replace + tasks[task_key='setup'].libraries: remove + tasks[task_key='transform'].job_cluster_key: replace + + + +=== Configuration changes + +>>> diff.py databricks.yml.backup databricks.yml +--- databricks.yml.backup ++++ databricks.yml +@@ -18,17 +18,18 @@ + notebook_task: + notebook_path: /Users/{{workspace_user_name}}/setup +- libraries: &common_libs +- - pypi: +- package: requests + - task_key: ingest + job_cluster_key: main + notebook_task: + notebook_path: /Users/{{workspace_user_name}}/ingest +- libraries: *common_libs ++ libraries: ++ - pypi: ++ package: httpx + - task_key: transform +- job_cluster_key: main ++ job_cluster_key: large + notebook_task: + notebook_path: /Users/{{workspace_user_name}}/transform +- libraries: *common_libs ++ libraries: &common_libs ++ - pypi: ++ package: requests + + targets: + +=== Only the changed tasks differ + +>>> [CLI] bundle validate -o json +{"task_key":"ingest","job_cluster_key":"main","libraries":[{"pypi":{"package":"httpx"}}]} +{"task_key":"setup","job_cluster_key":"main","libraries":null} +{"task_key":"transform","job_cluster_key":"large","libraries":[{"pypi":{"package":"requests"}}]} + +>>> [CLI] bundle destroy --auto-approve +The following resources will be deleted: + delete resources.jobs.my_job + +All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default + +Destroy: 1 deleted diff --git a/acceptance/bundle/config-remote-sync/yaml_anchors/script b/acceptance/bundle/config-remote-sync/yaml_anchors/script new file mode 100644 index 00000000000..f74f9840148 --- /dev/null +++ b/acceptance/bundle/config-remote-sync/yaml_anchors/script @@ -0,0 +1,33 @@ +#!/bin/bash + +envsubst < databricks.yml.tmpl > databricks.yml + +cleanup() { + trace $CLI bundle destroy --auto-approve +} +trap cleanup EXIT + +$CLI bundle deploy +job_id="$(read_id.py my_job)" + +title "Remove the libraries of the task that defines the anchor, change the library of one aliased task and move another to the large cluster" +edit_resource.py jobs $job_id <