-
Notifications
You must be signed in to change notification settings - Fork 136
Granular updates for model serving endpoints #3988
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b1306e8
Make DoUpdate optional for direct resources
shreyas-goenka e368d45
Merge remote-tracking branch 'origin' into make-update-optional
shreyas-goenka ef6fbde
address comments
shreyas-goenka 7dd5dad
Granular updates for model serving endpoints
shreyas-goenka fd244e3
fix update
shreyas-goenka a37cf2c
add and update tests
shreyas-goenka a9d1b50
Merge main and rename DoUpdateWithChanges to DoUpdate
shreyas-goenka a1852cd
Use Changes alias in DoUpdate signatures to match main's style
shreyas-goenka ebdb49e
cleanup
shreyas-goenka 1f05a2e
add back test
shreyas-goenka 655542f
claeanup:'
shreyas-goenka dbdbdf5
address comments
shreyas-goenka 169b99a
-
shreyas-goenka 70bb49b
Merge remote-tracking branch 'origin' into better-model-serving-update
shreyas-goenka 3d96602
address feedback
shreyas-goenka a82bbcd
fewer test cases
shreyas-goenka c8f9369
add regex test cases
shreyas-goenka 91070ef
update test
shreyas-goenka 9641e1c
address comments
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
22 changes: 22 additions & 0 deletions
22
acceptance/bundle/resources/model_serving_endpoints/update/ai-gateway/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,22 @@ | ||
| bundle: | ||
| name: test-mse-update-ai-gateway-$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}}" | ||
| ai_gateway: | ||
| inference_table_config: | ||
| catalog_name: "first-inference-catalog" |
70 changes: 70 additions & 0 deletions
70
acceptance/bundle/resources/model_serving_endpoints/update/ai-gateway/out.plan.direct.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,70 @@ | ||
| { | ||
| "plan": { | ||
| "resources.model_serving_endpoints.test_endpoint": { | ||
| "action": "update", | ||
| "new_state": { | ||
| "value": { | ||
| "ai_gateway": { | ||
| "inference_table_config": { | ||
| "catalog_name": "second-inference-catalog" | ||
| } | ||
| }, | ||
| "config": { | ||
| "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": "[ENDPOINT_ID]" | ||
| } | ||
| }, | ||
| "remote_state": { | ||
| "endpoint_details": { | ||
| "ai_gateway": { | ||
| "inference_table_config": { | ||
| "catalog_name": "first-inference-catalog" | ||
| } | ||
| }, | ||
| "config": { | ||
| "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" | ||
| } | ||
| ] | ||
| }, | ||
| "creator": "[USERNAME]", | ||
| "id": "[UUID]", | ||
| "name": "[ENDPOINT_ID]", | ||
| "state": { | ||
| "config_update": "NOT_UPDATING" | ||
| } | ||
| }, | ||
| "endpoint_id": "[UUID]" | ||
| }, | ||
| "changes": { | ||
| "local": { | ||
| "ai_gateway.inference_table_config.catalog_name": { | ||
| "action": "update" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
...ptance/bundle/resources/model_serving_endpoints/update/ai-gateway/out.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": "update" | ||
| } | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
acceptance/bundle/resources/model_serving_endpoints/update/ai-gateway/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
77 changes: 77 additions & 0 deletions
77
acceptance/bundle/resources/model_serving_endpoints/update/ai-gateway/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,77 @@ | ||
|
|
||
| >>> [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 [ENDPOINT_ID] | ||
| { | ||
| "inference_table_config": { | ||
| "catalog_name": "first-inference-catalog" | ||
| } | ||
| } | ||
|
|
||
| >>> update_file.py databricks.yml catalog_name: "first-inference-catalog" catalog_name: "second-inference-catalog" | ||
|
|
||
| >>> [CLI] bundle plan -o json | ||
|
|
||
| >>> [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": { | ||
| "ai_gateway": { | ||
| "inference_table_config": { | ||
| "catalog_name": "first-inference-catalog" | ||
| } | ||
| }, | ||
| "config": { | ||
| "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": "[ENDPOINT_ID]" | ||
| } | ||
| } | ||
| { | ||
| "method": "PUT", | ||
| "path": "/api/2.0/serving-endpoints/[ENDPOINT_ID]/ai-gateway", | ||
| "body": { | ||
| "inference_table_config": { | ||
| "catalog_name": "second-inference-catalog" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| >>> [CLI] serving-endpoints get [ENDPOINT_ID] | ||
| { | ||
| "inference_table_config": { | ||
| "catalog_name": "second-inference-catalog" | ||
| } | ||
| } | ||
|
|
||
| >>> [CLI] bundle destroy --auto-approve | ||
| The following resources will be deleted: | ||
| delete resources.model_serving_endpoints.test_endpoint | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME] | ||
|
|
||
| Deleting files... | ||
| Destroy complete! |
23 changes: 23 additions & 0 deletions
23
acceptance/bundle/resources/model_serving_endpoints/update/ai-gateway/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,23 @@ | ||
| #!/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 deploy | ||
|
|
||
| ENDPOINT_ID=$($CLI bundle summary -o json | jq -r '.resources.model_serving_endpoints.test_endpoint.id') | ||
| echo "$ENDPOINT_ID:ENDPOINT_ID" >> ACC_REPLS | ||
| trace $CLI serving-endpoints get "${ENDPOINT_ID}" | jq '.ai_gateway' | ||
|
|
||
| trace update_file.py databricks.yml 'catalog_name: "first-inference-catalog"' 'catalog_name: "second-inference-catalog"' | ||
|
|
||
| trace $CLI bundle plan -o json > out.plan.$DATABRICKS_BUNDLE_ENGINE.json | ||
| trace $CLI bundle deploy | ||
|
|
||
| trace print_requests.py //serving-endpoints | ||
|
|
||
| trace $CLI serving-endpoints get "${ENDPOINT_ID}" | jq '.ai_gateway' | ||
26 changes: 26 additions & 0 deletions
26
...bundle/resources/model_serving_endpoints/update/both_gateway_and_tags/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,26 @@ | ||
| bundle: | ||
| name: test-mse-update-ai-gateway-$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}}" | ||
| ai_gateway: | ||
| inference_table_config: | ||
| catalog_name: "first-inference-catalog" | ||
|
|
||
| tags: | ||
| - key: team | ||
| value: my-team-one |
85 changes: 85 additions & 0 deletions
85
...undle/resources/model_serving_endpoints/update/both_gateway_and_tags/out.plan.direct.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,85 @@ | ||
| { | ||
| "plan": { | ||
| "resources.model_serving_endpoints.test_endpoint": { | ||
| "action": "update", | ||
| "new_state": { | ||
| "value": { | ||
| "ai_gateway": { | ||
| "inference_table_config": { | ||
| "catalog_name": "second-inference-catalog" | ||
| } | ||
| }, | ||
| "config": { | ||
| "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": "[ENDPOINT_ID]", | ||
| "tags": [ | ||
| { | ||
| "key": "team", | ||
| "value": "my-team-two" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "remote_state": { | ||
| "endpoint_details": { | ||
| "ai_gateway": { | ||
| "inference_table_config": { | ||
| "catalog_name": "first-inference-catalog" | ||
| } | ||
| }, | ||
| "config": { | ||
| "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" | ||
| } | ||
| ] | ||
| }, | ||
| "creator": "[USERNAME]", | ||
| "id": "[UUID]", | ||
| "name": "[ENDPOINT_ID]", | ||
| "state": { | ||
| "config_update": "NOT_UPDATING" | ||
| }, | ||
| "tags": [ | ||
| { | ||
| "key": "team", | ||
| "value": "my-team-one" | ||
| } | ||
| ] | ||
| }, | ||
| "endpoint_id": "[UUID]" | ||
| }, | ||
| "changes": { | ||
| "local": { | ||
| "ai_gateway.inference_table_config.catalog_name": { | ||
| "action": "update" | ||
| }, | ||
| "tags[0].value": { | ||
| "action": "update" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
...le/resources/model_serving_endpoints/update/both_gateway_and_tags/out.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": "update" | ||
| } | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
...tance/bundle/resources/model_serving_endpoints/update/both_gateway_and_tags/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.