forked from opensearch-project/opensearch-api-specification
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ML Model APIs (load, upload, create metadata).
Signed-off-by: Nathalie Jonathan <[email protected]>
- Loading branch information
1 parent
49b2e50
commit 1809c51
Showing
5 changed files
with
370 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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,79 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test the deployment of a model using load API (deprecated). | ||
distributions: | ||
excluded: | ||
- amazon-managed | ||
- amazon-serverless | ||
warnings: | ||
multiple-paths-detected: false | ||
prologues: | ||
- path: /_plugins/_ml/models/_register | ||
id: register_model | ||
method: POST | ||
request: | ||
payload: | ||
name: huggingface/sentence-transformers/msmarco-distilbert-base-tas-b | ||
version: 1.0.1 | ||
model_format: TORCH_SCRIPT | ||
output: | ||
task_id: payload.task_id | ||
epilogues: | ||
- path: /_plugins/_ml/models/{model_id}/_undeploy | ||
method: POST | ||
parameters: | ||
model_id: ${get_completed_register_model_task.model_id} | ||
status: [200, 404] | ||
- path: /_plugins/_ml/models/{model_id} | ||
parameters: | ||
model_id: ${get_completed_register_model_task.model_id} | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Wait to get completed task. | ||
id: get_completed_register_model_task | ||
path: /_plugins/_ml/tasks/{task_id} | ||
method: GET | ||
parameters: | ||
task_id: ${register_model.task_id} | ||
response: | ||
status: 200 | ||
payload: | ||
state: COMPLETED | ||
output: | ||
model_id: payload.model_id | ||
retry: | ||
count: 3 | ||
wait: 10000 | ||
- synopsis: Deploy a model. | ||
id: load_model | ||
path: /_plugins/_ml/models/{model_id}/_load | ||
method: POST | ||
parameters: | ||
model_id: ${get_completed_register_model_task.model_id} | ||
output: | ||
task_id: payload.task_id | ||
response: | ||
status: 200 | ||
- synopsis: Wait to get completed task. | ||
id: get_completed_load_model_task | ||
path: /_plugins/_ml/tasks/{task_id} | ||
method: GET | ||
parameters: | ||
task_id: ${load_model.task_id} | ||
response: | ||
status: 200 | ||
payload: | ||
state: COMPLETED | ||
output: | ||
model_id: payload.model_id | ||
retry: | ||
count: 3 | ||
wait: 10000 | ||
- synopsis: Undeploy a model. | ||
path: /_plugins/_ml/models/{model_id}/_undeploy | ||
method: POST | ||
parameters: | ||
model_id: ${get_completed_register_model_task.model_id} | ||
response: | ||
status: 200 |
This file contains 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,75 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test the creation of model metadata. | ||
distributions: | ||
excluded: | ||
- amazon-managed | ||
- amazon-serverless | ||
version: '>= 2.11' | ||
warnings: | ||
multiple-paths-detected: false | ||
prologues: | ||
- path: /_plugins/_ml/models/_register | ||
id: register_model | ||
method: POST | ||
request: | ||
payload: | ||
name: huggingface/sentence-transformers/msmarco-distilbert-base-tas-b | ||
version: 1.0.1 | ||
model_format: TORCH_SCRIPT | ||
output: | ||
task_id: payload.task_id | ||
epilogues: | ||
- path: /_plugins/_ml/models/{model_id} | ||
parameters: | ||
model_id: ${get_completed_task.model_id} | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Create model metadata. | ||
id: model_metadata | ||
path: /_plugins/_ml/models/meta | ||
method: POST | ||
request: | ||
payload: | ||
name: huggingface/sentence-transformers/msmarco-distilbert-base-tas-b | ||
version: 1.0.1 | ||
model_format: TORCH_SCRIPT | ||
model_content_hash_value: 123abc | ||
total_chunks: 1 | ||
model_config: | ||
all_config: path | ||
model_type: bert | ||
embedding_dimension: 384 | ||
framework_type: sentence_transformers | ||
response: | ||
status: 200 | ||
output: | ||
model_id: payload.model_id | ||
- synopsis: Wait to get completed task. | ||
id: get_completed_task | ||
path: /_plugins/_ml/tasks/{task_id} | ||
method: GET | ||
parameters: | ||
task_id: ${register_model.task_id} | ||
response: | ||
status: 200 | ||
payload: | ||
state: COMPLETED | ||
output: | ||
model_id: payload.model_id | ||
retry: | ||
count: 5 | ||
wait: 30000 | ||
- synopsis: Get model. | ||
path: /_plugins/_ml/models/{model_id} | ||
method: GET | ||
parameters: | ||
model_id: ${get_completed_task.model_id} | ||
response: | ||
status: 200 | ||
- synopsis: Delete model. | ||
path: /_plugins/_ml/models/{model_id} | ||
parameters: | ||
model_id: ${get_completed_task.model_id} | ||
method: DELETE |
Oops, something went wrong.