Skip to content

Commit

Permalink
Fixed schema refs for ml.yaml (#489)
Browse files Browse the repository at this point in the history
* Fixed schema refs for ml.yaml

Signed-off-by: Theo Truong <theotr@amazon.com>

* #

Signed-off-by: Theo Truong <theotr@amazon.com>

* #

Signed-off-by: Theo Truong <theotr@amazon.com>

* #

Signed-off-by: Theo Truong <theotr@amazon.com>

* #

Signed-off-by: Theo Truong <theotr@amazon.com>

* #

Signed-off-by: Theo Truong <theotr@amazon.com>

* #

Signed-off-by: Theo Truong <theotr@amazon.com>

---------

Signed-off-by: Theo Truong <theotr@amazon.com>
  • Loading branch information
nhtruong committed Aug 12, 2024
1 parent 2ee3104 commit 42fd4d7
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 15 deletions.
32 changes: 24 additions & 8 deletions spec/namespaces/ml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,36 +130,52 @@ components:
ml.search_models:
content:
application/json:
$ref: '../schemas/ml._common.yaml#/components/schemas/SearchModelsQuery'
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/SearchModelsQuery'
responses:
ml.register_model_group@200:
content:
application/json:
$ref: '../schemas/ml._common.yaml#/components/schemas/ModelGroupRegistration'
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/ModelGroupRegistration'
ml.get_model_group@200:
content:
application/json:
$ref: '../schemas/ml._common.yaml#/components/schemas/ModelGroup'
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/ModelGroup'
ml.delete_model_group@200:
content:
application/json:
$ref: '../schemas/ml._common.yaml#/components/schemas/ModelGroup'
schema:
$ref: '../schemas/_common.yaml#/components/schemas/WriteResponseBase'
ml.register_model@200:
content:
application/json:
$ref: '../schemas/ml._common.yaml#/components/schemas/Task'
schema:
type: object
properties:
status:
type: string
task_id:
type: string
required:
- status
- task_id
ml.delete_model@200:
content:
application/json:
$ref: '../schemas/ml._common.yaml#/components/schemas/ModelGroup'
schema:
$ref: '../schemas/_common.yaml#/components/schemas/WriteResponseBase'
ml.get_task@200:
content:
application/json:
$ref: '../schemas/ml._common.yaml#/components/schemas/Task'
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/Task'
ml.search_models@200:
content:
application/json:
$ref: '../schemas/ml._common.yaml#/components/schemas/SearchModelsResponse'
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/SearchModelsResponse'
parameters:
ml.get_model_group::path.model_group_id:
name: model_group_id
Expand Down
5 changes: 3 additions & 2 deletions spec/schemas/ml._common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ components:
properties:
model_id:
type: string
description: The model ID.
task_id:
type: string
state:
type: string
description: The state.
enum:
- CANCELLED
- COMPLETED
Expand All @@ -124,6 +124,7 @@ components:
description: Task type.
enum:
- DEPLOY_MODEL
- REGISTER_MODEL
function_name:
type: string
worker_node:
Expand Down
18 changes: 13 additions & 5 deletions tests/default/ml/models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ prologues:
ml_commons:
only_run_on_ml_node: false
chapters:
- synopsis: Create model.
id: create_model
- synopsis: Register model.
id: register_model
path: /_plugins/_ml/models/_register
method: POST
request:
Expand All @@ -25,17 +25,25 @@ chapters:
status: 200
output:
task_id: payload.task_id
- synopsis: Wait for task.
- synopsis: Wait to get completed task.
id: get_completed_task
path: /_plugins/_ml/tasks/{task_id}
method: GET
warnings:
multiple-paths-detected: false
parameters:
task_id: ${create_model.task_id}
task_id: ${register_model.task_id}
response:
status: 200
payload:
state: COMPLETED
output:
model_id: payload.model_id
retry:
count: 3
count: 5
wait: 30000
- synopsis: Delete model.
path: /_plugins/_ml/models/{model_id}
parameters:
model_id: ${get_completed_task.model_id}
method: DELETE

0 comments on commit 42fd4d7

Please sign in to comment.