Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions acceptance/bundle/refschema/out.fields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,11 @@ resources.clusters.*.jdbc_port int REMOTE
resources.clusters.*.kind compute.Kind ALL
resources.clusters.*.last_restarted_time int64 REMOTE
resources.clusters.*.last_state_loss_time int64 REMOTE
resources.clusters.*.lifecycle *dresources.ClusterStateLifecycle REMOTE STATE
resources.clusters.*.lifecycle *resources.LifecycleWithStarted INPUT
resources.clusters.*.lifecycle resources.Lifecycle INPUT
resources.clusters.*.lifecycle.prevent_destroy bool INPUT
resources.clusters.*.lifecycle.started *bool ALL
resources.clusters.*.modified_status string INPUT
resources.clusters.*.node_type_id string ALL
resources.clusters.*.num_workers int ALL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@
"cluster_name": "test-cluster-[UNIQUE_NAME]",
"driver_node_type_id": "[NODE_TYPE_ID]",
"enable_elastic_disk": false,
"lifecycle": {
"started": false
},
"node_type_id": "[NODE_TYPE_ID]",
"num_workers": 2,
"spark_version": "13.3.x-snapshot-scala2.12"
"spark_version": "13.3.x-snapshot-scala2.12",
"state": "TERMINATED"
},
"changes": {
"autoscale": {
Expand Down Expand Up @@ -76,6 +80,13 @@
"reason": "empty",
"remote": false
},
"lifecycle": {
"action": "skip",
"reason": "backend_default",
"remote": {
"started": false
}
},
"num_workers": {
"action": "update",
"old": 2,
Expand Down Expand Up @@ -119,6 +130,9 @@
"cluster_name": "test-cluster-[UNIQUE_NAME]",
"driver_node_type_id": "[NODE_TYPE_ID]",
"enable_elastic_disk": false,
"lifecycle": {
"started": false
},
"node_type_id": "[NODE_TYPE_ID]",
"spark_version": "13.3.x-snapshot-scala2.12"
},
Expand Down Expand Up @@ -152,6 +166,13 @@
"action": "skip",
"reason": "empty",
"remote": false
},
"lifecycle": {
"action": "skip",
"reason": "backend_default",
"remote": {
"started": false
}
}
}
}
Expand Down Expand Up @@ -191,6 +212,9 @@
"cluster_name": "test-cluster-[UNIQUE_NAME]",
"driver_node_type_id": "[NODE_TYPE_ID]",
"enable_elastic_disk": false,
"lifecycle": {
"started": true
},
"node_type_id": "[NODE_TYPE_ID]",
"spark_version": "13.3.x-snapshot-scala2.12",
"state": "RUNNING"
Expand Down Expand Up @@ -227,6 +251,13 @@
"action": "skip",
"reason": "empty",
"remote": false
},
"lifecycle": {
"action": "skip",
"reason": "backend_default",
"remote": {
"started": true
}
}
}
}
Expand Down Expand Up @@ -263,6 +294,9 @@
"cluster_name": "test-cluster-[UNIQUE_NAME]",
"driver_node_type_id": "[NODE_TYPE_ID]",
"enable_elastic_disk": false,
"lifecycle": {
"started": true
},
"node_type_id": "[NODE_TYPE_ID]",
"spark_version": "13.3.x-snapshot-scala2.12",
"state": "RUNNING"
Expand Down Expand Up @@ -298,6 +332,13 @@
"reason": "empty",
"remote": false
},
"lifecycle": {
"action": "skip",
"reason": "backend_default",
"remote": {
"started": true
}
},
"num_workers": {
"action": "resize",
"reason": "custom",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Deployment complete!
"autoscale": null
}

=== Terminating the cluster
{
"cluster_id": "[CLUSTER_ID]"
}

=== Adding autoscale section should call update API on stopped cluster

>>> [CLI] bundle deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ CLUSTER_ID=$($CLI bundle summary -o json | jq -r '.resources.clusters.test_clust
echo "$CLUSTER_ID:CLUSTER_ID" >> ACC_REPLS
$CLI clusters get "${CLUSTER_ID}" | jq '{cluster_name,num_workers,autoscale}'

title "Terminating the cluster\n"
$CLI clusters delete "${CLUSTER_ID}" | jq '{cluster_id}'

title "Adding autoscale section should call update API on stopped cluster\n"
update_file.py databricks.yml " num_workers: 2" " autoscale:
min_workers: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"serial": 1,
"plan": {
"resources.clusters.test_cluster": {
"action": "update",
"action": "resize",
"new_state": {
"value": {
"autotermination_minutes": 60,
Expand All @@ -49,12 +49,16 @@
"cluster_name": "test-cluster-[UNIQUE_NAME]",
"driver_node_type_id": "[NODE_TYPE_ID]",
"enable_elastic_disk": false,
"lifecycle": {
"started": true
},
"node_type_id": "[NODE_TYPE_ID]",
"num_workers": 2,
"spark_conf": {
"spark.executor.memory": "2g"
},
"spark_version": "13.3.x-snapshot-scala2.12"
"spark_version": "13.3.x-snapshot-scala2.12",
"state": "RUNNING"
},
"changes": {
"aws_attributes": {
Expand All @@ -75,8 +79,16 @@
"reason": "empty",
"remote": false
},
"lifecycle": {
"action": "skip",
"reason": "backend_default",
"remote": {
"started": true
}
},
"num_workers": {
"action": "update",
"action": "resize",
"reason": "custom",
"old": 2,
"new": 3,
"remote": 2
Expand Down Expand Up @@ -115,6 +127,9 @@
"cluster_name": "test-cluster-[UNIQUE_NAME]",
"driver_node_type_id": "[NODE_TYPE_ID]",
"enable_elastic_disk": false,
"lifecycle": {
"started": true
},
"node_type_id": "[NODE_TYPE_ID]",
"num_workers": 3,
"spark_conf": {
Expand Down Expand Up @@ -142,6 +157,13 @@
"reason": "empty",
"remote": false
},
"lifecycle": {
"action": "skip",
"reason": "backend_default",
"remote": {
"started": true
}
},
"num_workers": {
"action": "resize",
"reason": "custom",
Expand Down Expand Up @@ -183,6 +205,9 @@
"cluster_name": "test-cluster-[UNIQUE_NAME]",
"driver_node_type_id": "[NODE_TYPE_ID]",
"enable_elastic_disk": false,
"lifecycle": {
"started": true
},
"node_type_id": "[NODE_TYPE_ID]",
"num_workers": 4,
"spark_conf": {
Expand Down Expand Up @@ -210,6 +235,13 @@
"reason": "empty",
"remote": false
},
"lifecycle": {
"action": "skip",
"reason": "backend_default",
"remote": {
"started": true
}
},
"num_workers": {
"action": "resize",
"reason": "custom",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
create clusters.test_cluster

Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged
update clusters.test_cluster
resize clusters.test_cluster
Comment thread
andrewnester marked this conversation as resolved.

Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged
resize clusters.test_cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,6 @@ Updating deployment state...
Deployment complete!

>>> jq select(.method == "POST" and (.path | contains("/clusters/edit"))) | del(.body.aws_attributes, .body.driver_node_type_id, .body.data_security_mode, .body.enable_elastic_disk) out.requests.txt
{
"method": "POST",
"path": "/api/2.1/clusters/edit",
"body": {
"autotermination_minutes": 60,
"cluster_id": "[CLUSTER_ID]",
"cluster_name": "test-cluster-[UNIQUE_NAME]",
"node_type_id": "[NODE_TYPE_ID]",
"num_workers": 3,
"spark_conf": {
"spark.executor.memory": "2g"
},
"spark_version": "13.3.x-snapshot-scala2.12"
}
}

=== Cluster should have new num_workers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bundle:
name: lifecycle-started-$UNIQUE_NAME

workspace:
root_path: ~/.bundle/$UNIQUE_NAME

resources:
clusters:
mycluster:
cluster_name: $UNIQUE_NAME
spark_version: "15.4.x-scala2.12"
node_type_id: "i3.xlarge"
num_workers: 1
lifecycle:
started: true

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

=== bundle plan fails with lifecycle.started on terraform engine
>>> errcode [CLI] bundle plan
Error: lifecycle.started is only supported in direct deployment mode
in databricks.yml:15:18


Exit code: 1

=== bundle deploy fails with lifecycle.started on terraform engine
>>> errcode [CLI] bundle deploy
Error: lifecycle.started is only supported in direct deployment mode
in databricks.yml:15:18


Exit code: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

title "bundle plan fails with lifecycle.started on terraform engine"
trace errcode $CLI bundle plan

title "bundle deploy fails with lifecycle.started on terraform engine"
trace errcode $CLI bundle deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Local = true
Cloud = true
RecordRequests = false

[EnvMatrix]
DATABRICKS_BUNDLE_ENGINE = ["terraform"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bundle:
name: lifecycle-started-toggle-$UNIQUE_NAME

workspace:
root_path: ~/.bundle/$UNIQUE_NAME

resources:
clusters:
mycluster:
cluster_name: $UNIQUE_NAME
spark_version: "15.4.x-scala2.12"
node_type_id: "i3.xlarge"
num_workers: 1
lifecycle:
started: false

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading