-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added ML create, update, get, delete controller APIs. Signed-off-by: Nathalie Jonathan <[email protected]> * Added memory threshold settings in Controller API tests. Signed-off-by: Nathalie Jonathan <[email protected]> * Remove logs folder and add it to .gitignore. Signed-off-by: Nathalie Jonathan <[email protected]> --------- Signed-off-by: Nathalie Jonathan <[email protected]>
- Loading branch information
1 parent
bf353a7
commit 0d63cdb
Showing
8 changed files
with
446 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ build/ | |
# coverage output | ||
/coverage/ | ||
|
||
# log files | ||
/logs/ |
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
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,71 @@ | ||
$schema: ../../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test the creation of a controller. | ||
version: '>= 2.12' | ||
prologues: | ||
- path: /_cluster/settings | ||
method: PUT | ||
request: | ||
payload: | ||
persistent: | ||
plugins.ml_commons.native_memory_threshold: 100 | ||
- 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 | ||
- path: /_plugins/_ml/tasks/{task_id} | ||
id: get_completed_task | ||
method: GET | ||
parameters: | ||
task_id: ${register_model.task_id} | ||
retry: | ||
count: 3 | ||
wait: 10000 | ||
response: | ||
status: 200 | ||
payload: | ||
state: COMPLETED | ||
output: | ||
model_id: payload.model_id | ||
epilogues: | ||
- path: /_plugins/_ml/controllers/{model_id} | ||
parameters: | ||
model_id: ${create_controller.model_id} | ||
method: DELETE | ||
status: [200, 404] | ||
- path: /_plugins/_ml/models/{model_id} | ||
parameters: | ||
model_id: ${get_completed_task.model_id} | ||
method: DELETE | ||
status: [200, 404] | ||
- path: /_plugins/_ml/tasks/{task_id} | ||
parameters: | ||
task_id: ${register_model.task_id} | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Create a controller. | ||
id: create_controller | ||
path: /_plugins/_ml/controllers/{model_id} | ||
method: POST | ||
parameters: | ||
model_id: ${get_completed_task.model_id} | ||
request: | ||
payload: | ||
user_rate_limiter: | ||
user1: | ||
limit: 4 | ||
unit: MINUTES | ||
user2: | ||
limit: 4 | ||
unit: MINUTES | ||
response: | ||
status: 200 | ||
output: | ||
model_id: payload.model_id |
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 deletion of a controller. | ||
version: '>= 2.12' | ||
prologues: | ||
- path: /_cluster/settings | ||
method: PUT | ||
request: | ||
payload: | ||
persistent: | ||
plugins.ml_commons.native_memory_threshold: 100 | ||
- 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 | ||
- path: /_plugins/_ml/tasks/{task_id} | ||
id: get_completed_task | ||
method: GET | ||
parameters: | ||
task_id: ${register_model.task_id} | ||
retry: | ||
count: 3 | ||
wait: 10000 | ||
response: | ||
status: 200 | ||
payload: | ||
state: COMPLETED | ||
output: | ||
model_id: payload.model_id | ||
- path: /_plugins/_ml/controllers/{model_id} | ||
id: create_controller | ||
method: POST | ||
parameters: | ||
model_id: ${get_completed_task.model_id} | ||
request: | ||
payload: | ||
user_rate_limiter: | ||
user1: | ||
limit: 4 | ||
unit: MINUTES | ||
user2: | ||
limit: 4 | ||
unit: MINUTES | ||
output: | ||
model_id: payload.model_id | ||
epilogues: | ||
- path: /_plugins/_ml/controllers/{model_id} | ||
parameters: | ||
model_id: ${create_controller.model_id} | ||
method: DELETE | ||
status: [200, 404] | ||
- path: /_plugins/_ml/models/{model_id} | ||
parameters: | ||
model_id: ${get_completed_task.model_id} | ||
method: DELETE | ||
status: [200, 404] | ||
- path: /_plugins/_ml/tasks/{task_id} | ||
parameters: | ||
task_id: ${register_model.task_id} | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Delete a controller. | ||
path: /_plugins/_ml/controllers/{model_id} | ||
method: DELETE | ||
parameters: | ||
model_id: ${create_controller.model_id} | ||
response: | ||
status: 200 |
Oops, something went wrong.