-
Notifications
You must be signed in to change notification settings - Fork 62
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]>
- Loading branch information
1 parent
5177c0a
commit 1a18da6
Showing
7 changed files
with
420 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
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,65 @@ | ||
$schema: ../../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test the creation of a controller. | ||
version: '>= 2.12' | ||
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 | ||
- 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,69 @@ | ||
$schema: ../../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test the deletion of a controller. | ||
version: '>= 2.12' | ||
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 | ||
- 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 |
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,69 @@ | ||
$schema: ../../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test the retrieval of a controller. | ||
version: '>= 2.12' | ||
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 | ||
- 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: Get a controller. | ||
path: /_plugins/_ml/controllers/{model_id} | ||
method: GET | ||
parameters: | ||
model_id: ${create_controller.model_id} | ||
response: | ||
status: 200 |
Oops, something went wrong.