Skip to content
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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
469 changes: 469 additions & 0 deletions acceptance/bundle/refschema/out.fields.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
bundle:
name: acc-$UNIQUE_NAME

resources:
model_serving_endpoints:
my_endpoint:
name: $ENDPOINT_NAME

permissions:
- level: CAN_VIEW
user_name: [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"plan": {
"resources.model_serving_endpoints.my_endpoint": {
"action": "create",
"new_state": {
"config": {
"name": "[ENDPOINT_NAME_1]"
}
}
},
"resources.model_serving_endpoints.my_endpoint.permissions": {
"depends_on": [
{
"node": "resources.model_serving_endpoints.my_endpoint",
"label": "${resources.model_serving_endpoints.my_endpoint.endpoint_id}"
}
],
"action": "create",
"new_state": {
"config": {
"object_id": "",
"permissions": [
{
"permission_level": "CAN_VIEW",
"user_name": "[email protected]"
},
{
"permission_level": "CAN_MANAGE",
"service_principal_name": "[USERNAME]"
}
]
},
"vars": {
"object_id": "/serving-endpoints/${resources.model_serving_endpoints.my_endpoint.endpoint_id}"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plan": {
"resources.model_serving_endpoints.my_endpoint": {
"action": "create"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"body": {
"name": "[ENDPOINT_NAME_1]"
},
"method": "POST",
"path": "/api/2.0/serving-endpoints"
}
{
"body": {
"access_control_list": [
{
"permission_level": "CAN_VIEW",
"user_name": "[email protected]"
},
{
"permission_level": "CAN_MANAGE",
"service_principal_name": "[USERNAME]"
}
]
},
"method": "PUT",
"path": "/api/2.0/permissions/serving-endpoints/[ENDPOINT_ID_1]"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"body": {
"name": "[ENDPOINT_NAME_1]"
},
"method": "POST",
"path": "/api/2.0/serving-endpoints"
}
{
"body": {
"access_control_list": [
{
"permission_level": "CAN_MANAGE",
"service_principal_name": "[USERNAME]"
},
{
"permission_level": "CAN_VIEW",
"user_name": "[email protected]"
}
]
},
"method": "PUT",
"path": "/api/2.0/permissions/serving-endpoints/[ENDPOINT_ID_1]"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"plan": {
"resources.model_serving_endpoints.my_endpoint": {
"action": "recreate",
"new_state": {
"config": {
"name": "[ENDPOINT_NAME_2]"
}
},
"changes": {
"local": {
"name": {
"action": "recreate"
}
}
}
},
"resources.model_serving_endpoints.my_endpoint.permissions": {
"depends_on": [
{
"node": "resources.model_serving_endpoints.my_endpoint",
"label": "${resources.model_serving_endpoints.my_endpoint.endpoint_id}"
}
],
"action": "update",
"new_state": {
"config": {
"object_id": "",
"permissions": [
{
"permission_level": "CAN_VIEW",
"user_name": "[email protected]"
},
{
"permission_level": "CAN_MANAGE",
"service_principal_name": "[USERNAME]"
}
]
},
"vars": {
"object_id": "/serving-endpoints/${resources.model_serving_endpoints.my_endpoint.endpoint_id}"
}
},
"remote_state": {
"object_id": "/serving-endpoints/[ENDPOINT_ID_1]",
"permissions": [
{
"permission_level": "CAN_VIEW",
"user_name": "[email protected]"
},
{
"permission_level": "CAN_MANAGE",
"service_principal_name": "[USERNAME]"
}
]
},
"changes": {
"local": {
"object_id": {
"action": "update"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plan": {
"resources.model_serving_endpoints.my_endpoint": {
"action": "recreate"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"method": "DELETE",
"path": "/api/2.0/serving-endpoints/[ENDPOINT_NAME_1]"
}
{
"body": {
"name": "[ENDPOINT_NAME_2]"
},
"method": "POST",
"path": "/api/2.0/serving-endpoints"
}
{
"body": {
"access_control_list": [
{
"permission_level": "CAN_VIEW",
"user_name": "[email protected]"
},
{
"permission_level": "CAN_MANAGE",
"service_principal_name": "[USERNAME]"
}
]
},
"method": "PUT",
"path": "/api/2.0/permissions/serving-endpoints/[ENDPOINT_ID_2]"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"body": {
"access_control_list": [
{
"permission_level": "CAN_MANAGE",
"user_name": "[USERNAME]"
}
]
},
"method": "PUT",
"path": "/api/2.0/permissions/serving-endpoints/[ENDPOINT_ID_1]"
}
{
"method": "DELETE",
"path": "/api/2.0/serving-endpoints/[ENDPOINT_NAME_1]"
}
{
"body": {
"name": "[ENDPOINT_NAME_2]"
},
"method": "POST",
"path": "/api/2.0/serving-endpoints"
}
{
"body": {
"access_control_list": [
{
"permission_level": "CAN_MANAGE",
"service_principal_name": "[USERNAME]"
},
{
"permission_level": "CAN_VIEW",
"user_name": "[email protected]"
}
]
},
"method": "PUT",
"path": "/api/2.0/permissions/serving-endpoints/[ENDPOINT_ID_2]"
}

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

>>> [CLI] bundle debug plan

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

>>> print_requests.py //serving-endpoints

=== Print the GET endpoint details
{
"name": "[ENDPOINT_NAME_1]",
"creator": "[USERNAME]"
}

>>> [CLI] bundle debug plan

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

>>> print_requests.py //serving-endpoints

=== Print the GET endpoint details
{
"name": "[ENDPOINT_NAME_2]",
"creator": "[USERNAME]"
}

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

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

Deleting files...
Destroy complete!
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
export ENDPOINT_NAME="test-endpoint-$UNIQUE_NAME-1"

envsubst < databricks.yml.tmpl > databricks.yml

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

trace $CLI bundle debug plan > out.first-plan.$DATABRICKS_BUNDLE_ENGINE.json
trace $CLI bundle deploy
trace print_requests.py //serving-endpoints | jq --sort-keys > out.first-requests.$DATABRICKS_BUNDLE_ENGINE.json

echo "$ENDPOINT_NAME:ENDPOINT_NAME_1" >> ACC_REPLS

# Record the endpoint ID for the first endpoint
get_output=$($CLI serving-endpoints get $ENDPOINT_NAME)
endpoint_id=$(echo "$get_output" | jq -r '.id')
echo "$endpoint_id:ENDPOINT_ID_1" >> ACC_REPLS

title "Print the GET endpoint details\n"
echo "$get_output" | jq '{name, creator}'

export ENDPOINT_NAME="test-endpoint-$UNIQUE_NAME-2"
envsubst < databricks.yml.tmpl > databricks.yml
trace $CLI bundle debug plan > out.second-plan.$DATABRICKS_BUNDLE_ENGINE.json
trace $CLI bundle deploy
trace print_requests.py //serving-endpoints | jq --sort-keys > out.second-requests.$DATABRICKS_BUNDLE_ENGINE.json

echo "$ENDPOINT_NAME:ENDPOINT_NAME_2" >> ACC_REPLS

# Record the endpoint ID for the second endpoint
get_output=$($CLI serving-endpoints get $ENDPOINT_NAME)
endpoint_id=$(echo "$get_output" | jq -r '.id')
echo "$endpoint_id:ENDPOINT_ID_2" >> ACC_REPLS

title "Print the GET endpoint details\n"
echo "$get_output" | jq '{name, creator}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Local = false
Cloud = true
RecordRequests = true

[EnvMatrix]
DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
bundle:
name: test-mse-catalog-$UNIQUE_NAME

workspace:
root_path: ~/.bundle/$UNIQUE_NAME

resources:
model_serving_endpoints:
test_endpoint:
name: test-endpoint-$UNIQUE_NAME
config:
served_entities:
- name: prod
external_model:
name: gpt-4o-mini
provider: openai
task: llm/v1/chat
openai_config:
openai_api_key: "{{secrets/test-scope/openai-key}}"
auto_capture_config:
catalog_name: main
schema_name: default
table_name_prefix: my_table
Loading