Skip to content
Open
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
28 changes: 27 additions & 1 deletion acceptance/bundle/migrate/basic/out.new_state.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,33 @@
"volume_catalog_name": "mycat",
"volume_storage_location": "s3://deco-uc-prod-isolated-aws-us-east-1/metastore/[UUID]/volumes/[UUID]"
}
}
},
"depends_on": [
{
"node": "resources.jobs.test_job",
"label": "${resources.jobs.test_job.id}"
},
{
"node": "resources.jobs.test_job",
"label": "${resources.jobs.test_job.name}"
},
{
"node": "resources.jobs.test_job",
"label": "${resources.jobs.test_job.timeout_seconds}"
},
{
"node": "resources.volumes.test_volume",
"label": "${resources.volumes.test_volume.catalog_name}"
},
{
"node": "resources.volumes.test_volume",
"label": "${resources.volumes.test_volume.id}"
},
{
"node": "resources.volumes.test_volume",
"label": "${resources.volumes.test_volume.storage_location}"
}
]
},
"resources.volumes.test_volume": {
"__id__": "mycat.myschema.myvol",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@
"unit": "DAYS"
}
}
}
},
"depends_on": [
{
"node": "resources.pipelines.my_default_python_etl",
"label": "${resources.pipelines.my_default_python_etl.id}"
}
]
},
"resources.pipelines.my_default_python_etl": {
"__id__": "[UUID]",
Expand Down
40 changes: 35 additions & 5 deletions acceptance/bundle/migrate/grants/out.new_state.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
"comment": "mycomment",
"name": "mymodel",
"schema_name": "schema_grants"
}
},
"depends_on": [
{
"node": "resources.schemas.my_schema",
"label": "${resources.schemas.my_schema.name}"
}
]
},
"resources.registered_models.my_registered_model.grants": {
"__id__": "function/main.schema_grants.mymodel",
Expand All @@ -24,7 +30,13 @@
]
}
]
}
},
"depends_on": [
{
"node": "resources.registered_models.my_registered_model",
"label": "${resources.registered_models.my_registered_model.id}"
}
]
},
"resources.schemas.my_schema": {
"__id__": "main.schema_grants",
Expand All @@ -47,7 +59,13 @@
]
}
]
}
},
"depends_on": [
{
"node": "resources.schemas.my_schema",
"label": "${resources.schemas.my_schema.id}"
}
]
},
"resources.volumes.my_volume": {
"__id__": "main.schema_grants.volume_name",
Expand All @@ -56,7 +74,13 @@
"name": "volume_name",
"schema_name": "schema_grants",
"volume_type": "MANAGED"
}
},
"depends_on": [
{
"node": "resources.schemas.my_schema",
"label": "${resources.schemas.my_schema.name}"
}
]
},
"resources.volumes.my_volume.grants": {
"__id__": "volume/main.schema_grants.volume_name",
Expand All @@ -72,7 +96,13 @@
]
}
]
}
},
"depends_on": [
{
"node": "resources.volumes.my_volume",
"label": "${resources.volumes.my_volume.id}"
}
]
}
}
}
16 changes: 14 additions & 2 deletions acceptance/bundle/migrate/permissions/out.new_state.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@
"user_name": "[USERNAME]"
}
]
}
},
"depends_on": [
{
"node": "resources.jobs.test_job",
"label": "${resources.jobs.test_job.id}"
}
]
},
"resources.pipelines.test_pipeline": {
"__id__": "[UUID]",
Expand Down Expand Up @@ -75,7 +81,13 @@
"user_name": "[USERNAME]"
}
]
}
},
"depends_on": [
{
"node": "resources.pipelines.test_pipeline",
"label": "${resources.pipelines.test_pipeline.id}"
}
]
}
}
}
8 changes: 7 additions & 1 deletion acceptance/bundle/migrate/runas/out.new_state.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@
"user_name": "[USERNAME]"
}
]
}
},
"depends_on": [
{
"node": "resources.pipelines.foo",
"label": "${resources.pipelines.foo.id}"
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
}
},
"resources.jobs.foo": {
"depends_on": [
{
"node": "resources.jobs.bar",
"label": "${resources.jobs.bar.id}"
}
],
"action": "delete",
"remote_state": {
"created_time": [UNIX_TIME_MILLIS][1],
Expand Down
6 changes: 3 additions & 3 deletions acceptance/bundle/resource_deps/job_id/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ Deploying resources...
Updating deployment state...
Deployment complete!

>>> print_requests.py --sort //jobs
>>> print_requests.py //jobs
{
"method": "POST",
"path": "/api/2.2/jobs/delete",
"body": {
"job_id": [BAR_ID]
"job_id": [FOO_ID]
}
}
{
"method": "POST",
"path": "/api/2.2/jobs/delete",
"body": {
"job_id": [FOO_ID]
"job_id": [BAR_ID]
}
}

Expand Down
3 changes: 1 addition & 2 deletions acceptance/bundle/resource_deps/job_id/script
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ echo "$bar_id:BAR_ID" >> ACC_REPLS
cp empty.yml databricks.yml
trace $CLI bundle plan -o json > out.plan_delete.$DATABRICKS_BUNDLE_ENGINE.json
trace $CLI bundle deploy
# TODO sorting requests should not be needed one we persist depends_on in state
trace print_requests.py --sort //jobs
trace print_requests.py //jobs

trace $CLI bundle destroy --auto-approve
trace print_requests.py //jobs
78 changes: 78 additions & 0 deletions acceptance/bundle/resource_deps/job_id_big_graph/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
bundle:
name: test-bundle

# Complex graph combining: chain, diamond, independent, multi-deps
#
# independent1 independent2
#
# chain_top -> chain_mid -> chain_bottom
#
# diamond_top -> diamond_left -> diamond_bottom
# diamond_right ->
#
# multi_child -> multi_parent1
# -> multi_parent2

resources:
jobs:
# Independent nodes (no dependencies)
independent1:
name: job independent1
independent2:
name: job independent2

# Chain: chain_top -> chain_mid -> chain_bottom
chain_bottom:
name: job chain_bottom
chain_mid:
name: job chain_mid
tasks:
- task_key: t1
run_job_task:
job_id: ${resources.jobs.chain_bottom.id}
chain_top:
name: job chain_top
tasks:
- task_key: t1
run_job_task:
job_id: ${resources.jobs.chain_mid.id}

# Diamond: diamond_top -> diamond_left/right -> diamond_bottom
diamond_bottom:
name: job diamond_bottom
diamond_left:
name: job diamond_left
tasks:
- task_key: t1
run_job_task:
job_id: ${resources.jobs.diamond_bottom.id}
diamond_right:
name: job diamond_right
tasks:
- task_key: t1
run_job_task:
job_id: ${resources.jobs.diamond_bottom.id}
diamond_top:
name: job diamond_top
tasks:
- task_key: t1
run_job_task:
job_id: ${resources.jobs.diamond_left.id}
- task_key: t2
run_job_task:
job_id: ${resources.jobs.diamond_right.id}

# Multi-deps: multi_child -> multi_parent1, multi_parent2
multi_parent1:
name: job multi_parent1
multi_parent2:
name: job multi_parent2
multi_child:
name: job multi_child
tasks:
- task_key: t1
run_job_task:
job_id: ${resources.jobs.multi_parent1.id}
- task_key: t2
run_job_task:
job_id: ${resources.jobs.multi_parent2.id}
4 changes: 4 additions & 0 deletions acceptance/bundle/resource_deps/job_id_big_graph/empty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bundle:
name: test-bundle

resources: {}
Loading