-
Notifications
You must be signed in to change notification settings - Fork 112
direct: Add model serving endpoints #3890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shreyas-goenka
wants to merge
29
commits into
main
Choose a base branch
from
direct-model-serving
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,852
−24
Open
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
8a94154
merge
shreyas-goenka 596ee57
update acceptance tests
shreyas-goenka b0c4760
ipdate the test
shreyas-goenka 56e675f
proper replacements
shreyas-goenka a229f71
merge
shreyas-goenka b33549b
make permissions work
shreyas-goenka a169e35
update to cloud only
shreyas-goenka 291b9b8
use jq to sort'
shreyas-goenka 55717cd
0
shreyas-goenka 6a329b4
update
shreyas-goenka 2623ef0
make test work:
shreyas-goenka d9ffaa6
mergE
shreyas-goenka 09f12d1
better update operation
shreyas-goenka d2c3358
-
shreyas-goenka 34df3b0
udpate tests
shreyas-goenka ea6dbec
remove update testS
shreyas-goenka 9f6db59
test server
shreyas-goenka 7ef4323
address comments
shreyas-goenka 0827578
lint
shreyas-goenka cf0aabb
-
shreyas-goenka d48d41c
lint
shreyas-goenka f977b72
fix recreate route-optimized
shreyas-goenka aac0d6c
Merge remote-tracking branch 'origin' into direct-model-serving
shreyas-goenka 4fb3923
fix test
shreyas-goenka 4a2bcfd
fix TestAll
shreyas-goenka 474e3b5
-
shreyas-goenka 167ccf4
cleanup
shreyas-goenka 03228e7
-
shreyas-goenka 9b13fea
tests
shreyas-goenka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
acceptance/bundle/resources/model_serving_endpoints/basic/databricks.yml.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
5 changes: 5 additions & 0 deletions
5
acceptance/bundle/resources/model_serving_endpoints/basic/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
90 changes: 90 additions & 0 deletions
90
acceptance/bundle/resources/model_serving_endpoints/basic/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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! |
27 changes: 27 additions & 0 deletions
27
acceptance/bundle/resources/model_serving_endpoints/basic/script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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}' |
5 changes: 5 additions & 0 deletions
5
acceptance/bundle/resources/model_serving_endpoints/basic/test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Local = true | ||
| Cloud = true | ||
|
|
||
| [EnvMatrix] | ||
| DATABRICKS_BUNDLE_ENGINE = ["direct-exp"] | ||
23 changes: 23 additions & 0 deletions
23
...ptance/bundle/resources/model_serving_endpoints/recreate/catalog-name/databricks.yml.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
32 changes: 32 additions & 0 deletions
32
...le/resources/model_serving_endpoints/recreate/catalog-name/out.first-plan.direct-exp.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
...dle/resources/model_serving_endpoints/recreate/catalog-name/out.first-plan.terraform.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "plan": { | ||
| "resources.model_serving_endpoints.test_endpoint": { | ||
| "action": "create" | ||
| } | ||
| } | ||
| } |
39 changes: 39 additions & 0 deletions
39
...e/resources/model_serving_endpoints/recreate/catalog-name/out.second-plan.direct-exp.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
...le/resources/model_serving_endpoints/recreate/catalog-name/out.second-plan.terraform.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "plan": { | ||
| "resources.model_serving_endpoints.test_endpoint": { | ||
| "action": "recreate" | ||
| } | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
acceptance/bundle/resources/model_serving_endpoints/recreate/catalog-name/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
93 changes: 93 additions & 0 deletions
93
acceptance/bundle/resources/model_serving_endpoints/recreate/catalog-name/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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! |
25 changes: 25 additions & 0 deletions
25
acceptance/bundle/resources/model_serving_endpoints/recreate/catalog-name/script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' |
7 changes: 7 additions & 0 deletions
7
acceptance/bundle/resources/model_serving_endpoints/recreate/catalog-name/test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Local = true | ||
| Cloud = false | ||
| RecordRequests = true | ||
|
|
||
| Ignore = [ | ||
| "databricks.yml", | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.