From 788d0f42f5c4723ebc1911dcd58f95d625419bf8 Mon Sep 17 00:00:00 2001 From: Theo Truong Date: Sun, 11 Aug 2024 16:24:12 -0600 Subject: [PATCH 1/7] Fixed schema refs for ml.yaml Signed-off-by: Theo Truong --- spec/namespaces/ml.yaml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/spec/namespaces/ml.yaml b/spec/namespaces/ml.yaml index 54b5ea532..f7b860128 100644 --- a/spec/namespaces/ml.yaml +++ b/spec/namespaces/ml.yaml @@ -130,36 +130,44 @@ 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/ml._common.yaml#/components/schemas/ModelGroup' ml.register_model@200: content: application/json: - $ref: '../schemas/ml._common.yaml#/components/schemas/Task' + schema: + $ref: '../schemas/ml._common.yaml#/components/schemas/Task' ml.delete_model@200: content: application/json: - $ref: '../schemas/ml._common.yaml#/components/schemas/ModelGroup' + schema: + $ref: '../schemas/ml._common.yaml#/components/schemas/ModelGroup' 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 From 49eee04c186f979dc9be79e4ea6c47fbcff590b5 Mon Sep 17 00:00:00 2001 From: Theo Truong Date: Mon, 12 Aug 2024 12:50:13 -0600 Subject: [PATCH 2/7] # Signed-off-by: Theo Truong --- spec/namespaces/ml.yaml | 4 ++-- spec/schemas/ml._common.yaml | 9 +++++---- tests/default/ml/models.yaml | 12 +++++++++++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/spec/namespaces/ml.yaml b/spec/namespaces/ml.yaml index f7b860128..eaf1d07ae 100644 --- a/spec/namespaces/ml.yaml +++ b/spec/namespaces/ml.yaml @@ -147,7 +147,7 @@ components: content: application/json: schema: - $ref: '../schemas/ml._common.yaml#/components/schemas/ModelGroup' + $ref: '../schemas/_common.yaml#/components/schemas/WriteResponseBase' ml.register_model@200: content: application/json: @@ -157,7 +157,7 @@ components: content: application/json: schema: - $ref: '../schemas/ml._common.yaml#/components/schemas/ModelGroup' + $ref: '../schemas/_common.yaml#/components/schemas/WriteResponseBase' ml.get_task@200: content: application/json: diff --git a/spec/schemas/ml._common.yaml b/spec/schemas/ml._common.yaml index 3e06e2612..e5bfacd2b 100644 --- a/spec/schemas/ml._common.yaml +++ b/spec/schemas/ml._common.yaml @@ -108,10 +108,10 @@ components: properties: model_id: type: string - description: The model ID. - state: + task_id: + type: string + status: type: string - description: The state. enum: - CANCELLED - COMPLETED @@ -124,6 +124,7 @@ components: description: Task type. enum: - DEPLOY_MODEL + - REGISTER_MODEL function_name: type: string worker_node: @@ -139,4 +140,4 @@ components: is_async: type: boolean required: - - state + - status diff --git a/tests/default/ml/models.yaml b/tests/default/ml/models.yaml index ac386c0a4..b650f5ba9 100644 --- a/tests/default/ml/models.yaml +++ b/tests/default/ml/models.yaml @@ -11,6 +11,8 @@ prologues: plugins: ml_commons: only_run_on_ml_node: false + - path: /_plugins/_ml/tasks/* + method: DELETE chapters: - synopsis: Create model. id: create_model @@ -26,6 +28,7 @@ chapters: output: task_id: payload.task_id - synopsis: Wait for task. + id: register_model path: /_plugins/_ml/tasks/{task_id} method: GET warnings: @@ -36,6 +39,13 @@ chapters: 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: ${register_model.model_id} + method: DELETE From 3d74293d07288047f09882824d8dc4efa2a297f7 Mon Sep 17 00:00:00 2001 From: Theo Truong Date: Mon, 12 Aug 2024 12:55:42 -0600 Subject: [PATCH 3/7] # Signed-off-by: Theo Truong --- tests/default/ml/models.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/default/ml/models.yaml b/tests/default/ml/models.yaml index b650f5ba9..4e4a5e743 100644 --- a/tests/default/ml/models.yaml +++ b/tests/default/ml/models.yaml @@ -11,8 +11,6 @@ prologues: plugins: ml_commons: only_run_on_ml_node: false - - path: /_plugins/_ml/tasks/* - method: DELETE chapters: - synopsis: Create model. id: create_model From dafb656bbc7edbe02d573c8f336eacf51a1f4be0 Mon Sep 17 00:00:00 2001 From: Theo Truong Date: Mon, 12 Aug 2024 13:00:26 -0600 Subject: [PATCH 4/7] # Signed-off-by: Theo Truong --- spec/schemas/ml._common.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/schemas/ml._common.yaml b/spec/schemas/ml._common.yaml index e5bfacd2b..8d1b40d3e 100644 --- a/spec/schemas/ml._common.yaml +++ b/spec/schemas/ml._common.yaml @@ -110,7 +110,7 @@ components: type: string task_id: type: string - status: + state: type: string enum: - CANCELLED @@ -140,4 +140,4 @@ components: is_async: type: boolean required: - - status + - state From e3e61d72b809815951af79b6836ba8e0836c7ff8 Mon Sep 17 00:00:00 2001 From: Theo Truong Date: Mon, 12 Aug 2024 13:12:36 -0600 Subject: [PATCH 5/7] # Signed-off-by: Theo Truong --- spec/namespaces/ml.yaml | 10 +++++++++- tests/default/ml/models.yaml | 12 ++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/spec/namespaces/ml.yaml b/spec/namespaces/ml.yaml index eaf1d07ae..1cf5d989b 100644 --- a/spec/namespaces/ml.yaml +++ b/spec/namespaces/ml.yaml @@ -152,7 +152,15 @@ components: content: application/json: schema: - $ref: '../schemas/ml._common.yaml#/components/schemas/Task' + type: object + properties: + task_id: + type: string + status: + type: string + required: + - task_id + - status ml.delete_model@200: content: application/json: diff --git a/tests/default/ml/models.yaml b/tests/default/ml/models.yaml index 4e4a5e743..4bdac64e1 100644 --- a/tests/default/ml/models.yaml +++ b/tests/default/ml/models.yaml @@ -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: @@ -25,14 +25,14 @@ chapters: status: 200 output: task_id: payload.task_id - - synopsis: Wait for task. - id: register_model + - 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: @@ -45,5 +45,5 @@ chapters: - synopsis: Delete model. path: /_plugins/_ml/models/{model_id} parameters: - model_id: ${register_model.model_id} + model_id: ${get_completed_task.model_id} method: DELETE From ab8b31f5f836f646354cc65240684d000da8ec52 Mon Sep 17 00:00:00 2001 From: Theo Truong Date: Mon, 12 Aug 2024 13:15:21 -0600 Subject: [PATCH 6/7] # Signed-off-by: Theo Truong --- spec/namespaces/ml.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/namespaces/ml.yaml b/spec/namespaces/ml.yaml index 1cf5d989b..be2250869 100644 --- a/spec/namespaces/ml.yaml +++ b/spec/namespaces/ml.yaml @@ -154,10 +154,10 @@ components: schema: type: object properties: - task_id: - type: string status: type: string + task_id: + type: string required: - task_id - status From 3d82522d8ea4978c994437ebb05bca7b3600bc11 Mon Sep 17 00:00:00 2001 From: Theo Truong Date: Mon, 12 Aug 2024 13:20:51 -0600 Subject: [PATCH 7/7] # Signed-off-by: Theo Truong --- spec/namespaces/ml.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/namespaces/ml.yaml b/spec/namespaces/ml.yaml index be2250869..2822ceb89 100644 --- a/spec/namespaces/ml.yaml +++ b/spec/namespaces/ml.yaml @@ -159,8 +159,8 @@ components: task_id: type: string required: - - task_id - status + - task_id ml.delete_model@200: content: application/json: