Skip to content
Closed
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,29 @@
bundle:
name: test-bundle-$UNIQUE_NAME

workspace:
root_path: ~/.bundle/$UNIQUE_NAME

resources:
cluster_policies:
policy:
name: test-policy-$UNIQUE_NAME
definition:
# The policy does not constrain spark_conf.
custom_tags.PolicyTag:
type: fixed
value: from-policy
jobs:
test_job:
name: test-job-$UNIQUE_NAME
tasks:
- task_key: test
new_cluster:
policy_id: ${resources.cluster_policies.policy.id}
spark_version: $DEFAULT_SPARK_VERSION
node_type_id: $NODE_TYPE_ID
num_workers: 1
custom_tags:
PolicyTag: from-policy
spark_python_task:
python_file: ./hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env python3

print("hello")

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,35 @@

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
Created cluster_policies.policy
Created jobs.test_job
Files: 6 uploaded, 0 deleted
Resources: 2 created, 0 changed, 0 deleted, 0 unchanged

>>> [CLI] bundle config-remote-sync --save
Detected changes in 1 resource(s):

Resource: resources.jobs.test_job
tasks[task_key='test'].new_cluster.spark_conf: add



>>> diff.py databricks.yml.backup databricks.yml
--- databricks.yml.backup
+++ databricks.yml
@@ -26,4 +26,6 @@
custom_tags:
PolicyTag: from-policy
+ spark_conf:
+ spark.sql.shuffle.partitions: "7"
spark_python_task:
python_file: ./hello.py

>>> [CLI] bundle destroy --auto-approve
The following resources will be deleted:
delete resources.cluster_policies.policy
delete resources.jobs.test_job

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]

Destroy: 2 deleted
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
}
trap cleanup EXIT

trace $CLI bundle deploy
job_id=$(read_id.py test_job)

edit_resource.py jobs "$job_id" <<'EOF'
r["tasks"][0]["new_cluster"]["spark_conf"] = {"spark.sql.shuffle.partitions": "7"}
EOF

cp databricks.yml databricks.yml.backup
trace $CLI bundle config-remote-sync --save
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,4 @@
Cloud = true
EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"]
RecordRequests = false
Ignore = [".databricks", "databricks.yml", "databricks.yml.backup"]
Loading