Skip to content
Merged
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 numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
bundle:
name: drift-mse-recreated-same-name-$UNIQUE_NAME

sync:
paths: []

resources:
model_serving_endpoints:
my_endpoint:
name: mse-endpoint-$UNIQUE_NAME
permissions:
- level: CAN_VIEW
user_name: deco-test-user@databricks.com

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

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@

=== Initial deployment
>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/drift-mse-recreated-same-name-[UNIQUE_NAME]/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!

>>> [CLI] serving-endpoints get mse-endpoint-[UNIQUE_NAME]
{
"name": "mse-endpoint-[UNIQUE_NAME]",
"creator": "[USERNAME]"
}

=== Delete and recreate remotely with the same name
>>> [CLI] serving-endpoints delete mse-endpoint-[UNIQUE_NAME]

>>> [CLI] serving-endpoints create mse-endpoint-[UNIQUE_NAME] --no-wait
{
"name": "mse-endpoint-[UNIQUE_NAME]",
"creator": "[USERNAME]"
}

>>> [CLI] serving-endpoints get mse-endpoint-[UNIQUE_NAME]
{
"name": "mse-endpoint-[UNIQUE_NAME]",
"creator": "[USERNAME]"
}
Original endpoint id: [ORIGINAL_ENDPOINT_ID]
Remote recreated endpoint id: [REMOTE_RECREATED_ENDPOINT_ID]

=== Plan after out-of-band recreate
>>> [CLI] bundle plan
update model_serving_endpoints.my_endpoint.permissions

Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/drift-mse-recreated-same-name-[UNIQUE_NAME]/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!

>>> [CLI] serving-endpoints get mse-endpoint-[UNIQUE_NAME]
{
"name": "mse-endpoint-[UNIQUE_NAME]",
"creator": "[USERNAME]"
}

=== Persistent drift after deploy: V1 permissions API leaves an ACL on the deleted endpoint id, so plan keeps showing an update.
>>> [CLI] bundle plan
update model_serving_endpoints.my_endpoint.permissions

Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged

>>> [CLI] bundle destroy --auto-approve
The following resources will be deleted:
delete resources.model_serving_endpoints.my_endpoint

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/drift-mse-recreated-same-name-[UNIQUE_NAME]/default

Deleting files...
Destroy complete!
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
rm -f out.requests.txt
}
trap cleanup EXIT

endpoint_name="mse-endpoint-${UNIQUE_NAME}"

title "Initial deployment"
trace $CLI bundle deploy

original_endpoint_id=$($CLI serving-endpoints get "${endpoint_name}" | jq -r '.id')
add_repl.py "$original_endpoint_id" "ORIGINAL_ENDPOINT_ID"
trace $CLI serving-endpoints get "${endpoint_name}" | jq '{name, creator}'

title "Delete and recreate remotely with the same name"
trace $CLI serving-endpoints delete "${endpoint_name}"
trace $CLI serving-endpoints create "${endpoint_name}" --no-wait | jq '{name, creator}'

remote_recreated_endpoint_id=$($CLI serving-endpoints get "${endpoint_name}" | jq -r '.id')
add_repl.py "$remote_recreated_endpoint_id" "REMOTE_RECREATED_ENDPOINT_ID"
trace $CLI serving-endpoints get "${endpoint_name}" | jq '{name, creator}'

printf "Original endpoint id: %s\n" "$original_endpoint_id"
printf "Remote recreated endpoint id: %s\n" "$remote_recreated_endpoint_id"

if [ "$original_endpoint_id" = "$remote_recreated_endpoint_id" ]; then
echo "Expected remote recreation to assign a different endpoint id" >&2
exit 1
fi

title "Plan after out-of-band recreate"
trace $CLI bundle plan

trace $CLI bundle deploy
trace $CLI serving-endpoints get "${endpoint_name}" | jq '{name, creator}'

title "Persistent drift after deploy: V1 permissions API leaves an ACL on the deleted endpoint id, so plan keeps showing an update."
trace $CLI bundle plan
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
Badness = "After deleting and recreating a model serving endpoint remotely with the same name but a different endpoint_id, bundle plan/deploy ends up with a permanent update on permissions because the V1 permissions API does not delete ACLs immediately when the parent is gone."

Local = true
Cloud = true
RequiresUnityCatalog = true
RecordRequests = false

EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"]
Loading