Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bundle:
name: acc-$UNIQUE_NAME

resources:
model_serving_endpoints:
my_endpoint:
name: $ENDPOINT_NAME

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

>>> [CLI] bundle debug plan
{
"plan": {
"resources.model_serving_endpoints.my_endpoint": {
"action": "create",
"new_state": {
"config": {
"name": "[ENDPOINT_NAME_1]"
}
}
}
}
}

>>> [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
{
"method": "POST",
"path": "/api/2.0/serving-endpoints",
"body": {
"name": "[ENDPOINT_NAME_1]"
}
}

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

>>> [CLI] bundle debug plan
{
"plan": {
"resources.model_serving_endpoints.my_endpoint": {
"action": "recreate",
"new_state": {
"config": {
"name": "[ENDPOINT_NAME_2]"
}
},
"changes": {
"local": {
"name": {
"action": "recreate"
}
}
}
}
}
}

>>> [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
{
"method": "DELETE",
"path": "/api/2.0/serving-endpoints/[ENDPOINT_NAME_1]"
}
{
"method": "POST",
"path": "/api/2.0/serving-endpoints",
"body": {
"name": "[ENDPOINT_NAME_2]"
}
}

>>> [CLI] serving-endpoints get [ENDPOINT_NAME_2]
{
"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,27 @@
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
trace $CLI bundle deploy

trace print_requests.py //serving-endpoints

echo "$ENDPOINT_NAME:ENDPOINT_NAME_1" >> ACC_REPLS
trace $CLI serving-endpoints get $ENDPOINT_NAME | jq '{name, creator}'

export ENDPOINT_NAME="test-endpoint-$UNIQUE_NAME-2"
envsubst < databricks.yml.tmpl > databricks.yml
trace $CLI bundle debug plan
trace $CLI bundle deploy

trace print_requests.py //serving-endpoints

echo "$ENDPOINT_NAME:ENDPOINT_NAME_2" >> ACC_REPLS
trace $CLI serving-endpoints get $ENDPOINT_NAME | jq '{name, creator}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Local = true
Cloud = true

[EnvMatrix]
DATABRICKS_BUNDLE_ENGINE = ["direct-exp"]
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"plan": {
"resources.model_serving_endpoints.test_endpoint": {
"action": "create",
"new_state": {
"config": {
"config": {
"auto_capture_config": {
"catalog_name": "main",
"schema_name": "default",
"table_name_prefix": "my_table"
},
"served_entities": [
{
"external_model": {
"name": "gpt-4o-mini",
"openai_config": {
"openai_api_key": "{{secrets/test-scope/openai-key}}"
},
"provider": "openai",
"task": "llm/v1/chat"
},
"name": "prod"
}
]
},
"name": "[ORIGINAL_ENDPOINT_ID]"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plan": {
"resources.model_serving_endpoints.test_endpoint": {
"action": "create"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"plan": {
"resources.model_serving_endpoints.test_endpoint": {
"action": "recreate",
"new_state": {
"config": {
"config": {
"auto_capture_config": {
"catalog_name": "other_catalog",
"schema_name": "default",
"table_name_prefix": "my_table"
},
"served_entities": [
{
"external_model": {
"name": "gpt-4o-mini",
"openai_config": {
"openai_api_key": "{{secrets/test-scope/openai-key}}"
},
"provider": "openai",
"task": "llm/v1/chat"
},
"name": "prod"
}
]
},
"name": "[ORIGINAL_ENDPOINT_ID]"
}
},
"changes": {
"local": {
"config.auto_capture_config.catalog_name": {
"action": "recreate"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plan": {
"resources.model_serving_endpoints.test_endpoint": {
"action": "recreate"
}
}
}

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

>>> CLI bundle debug plan

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

>>> [CLI] serving-endpoints get [ORIGINAL_ENDPOINT_ID]
"main"

>>> update_file.py databricks.yml catalog_name: main catalog_name: other_catalog

>>> [CLI] bundle debug plan

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

>>> print_requests.py //serving-endpoints
{
"method": "POST",
"path": "/api/2.0/serving-endpoints",
"body": {
"config": {
"auto_capture_config": {
"catalog_name": "main",
"schema_name": "default",
"table_name_prefix": "my_table"
},
"served_entities": [
{
"external_model": {
"name": "gpt-4o-mini",
"openai_config": {
"openai_api_key": "{{secrets/test-scope/openai-key}}"
},
"provider": "openai",
"task": "llm/v1/chat"
},
"name": "prod"
}
]
},
"name": "[ORIGINAL_ENDPOINT_ID]"
}
}
{
"method": "DELETE",
"path": "/api/2.0/serving-endpoints/[ORIGINAL_ENDPOINT_ID]"
}
{
"method": "POST",
"path": "/api/2.0/serving-endpoints",
"body": {
"config": {
"auto_capture_config": {
"catalog_name": "other_catalog",
"schema_name": "default",
"table_name_prefix": "my_table"
},
"served_entities": [
{
"external_model": {
"name": "gpt-4o-mini",
"openai_config": {
"openai_api_key": "{{secrets/test-scope/openai-key}}"
},
"provider": "openai",
"task": "llm/v1/chat"
},
"name": "prod"
}
]
},
"name": "[ORIGINAL_ENDPOINT_ID]"
}
}

>>> [CLI] serving-endpoints get [ORIGINAL_ENDPOINT_ID]
"other_catalog"

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

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

Deleting files...
Destroy complete!
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
envsubst < databricks.yml.tmpl > databricks.yml

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

trace CLI bundle debug plan > out.first-plan.$DATABRICKS_BUNDLE_ENGINE.json
trace $CLI bundle deploy

ENDPOINT_ID=$($CLI bundle summary -o json | jq -r '.resources.model_serving_endpoints.test_endpoint.id')
echo "$ENDPOINT_ID:ORIGINAL_ENDPOINT_ID" >> ACC_REPLS
trace $CLI serving-endpoints get "${ENDPOINT_ID}" | jq '.config.auto_capture_config.catalog_name'

trace update_file.py databricks.yml "catalog_name: main" "catalog_name: other_catalog"
trace $CLI bundle debug plan > out.second-plan.$DATABRICKS_BUNDLE_ENGINE.json
trace $CLI bundle deploy

trace print_requests.py //serving-endpoints

NEW_ENDPOINT_ID=$($CLI bundle summary -o json | jq -r '.resources.model_serving_endpoints.test_endpoint.id')
echo "$NEW_ENDPOINT_ID:NEW_ENDPOINT_ID" >> ACC_REPLS
trace $CLI serving-endpoints get "${NEW_ENDPOINT_ID}" | jq '.config.auto_capture_config.catalog_name'
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Local = true
Cloud = false
RecordRequests = true

Ignore = [
"databricks.yml",
]
Loading