From 9c72a0da0a8cab90fe6e1d55832051eeb40f2e3b Mon Sep 17 00:00:00 2001 From: Nathalie Jonathan Date: Tue, 7 Jan 2025 11:17:30 -0800 Subject: [PATCH] Fixed merge conflicts, added support for payload properties into the prologue, attempted to fix errors in predict.yaml. Signed-off-by: Nathalie Jonathan --- CHANGELOG.md | 1 - json_schemas/test_story.schema.yaml | 2 + spec/namespaces/ml.yaml | 50 +------------------------ tests/plugins/ml/ml/models/predict.yaml | 8 ++++ 4 files changed, 11 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad2836fc..43295753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added the ability to skip an individual chapter test ([#765](https://github.com/opensearch-project/opensearch-api-specification/pull/765)) - Added uploading of test spec logs ([#767](https://github.com/opensearch-project/opensearch-api-specification/pull/767)) - Added `GET /_plugins/_ml/models/{model_id}`, `POST /_plugins/_ml/models/_search`, `POST /_plugins/_ml/models/_unload`, `_undeploy`, `_upload`, `meta`, `_register_meta`, `POST /_plugins/_ml/models/{model_id}/_load`, `_predict`, `_unload`, `chunk/{chunk_number}`, `upload_chunk/{chunk_number}`, and `PUT /_plugins/_ml/models/{model_id}` ([#733](https://github.com/opensearch-project/opensearch-api-specification/pull/733)) -- Added `POST /_plugins/_ml/_train/{algorithm_name}`, `_predict/{algorithm_name}/{model_id}`, and `_train_predict/{algorithm_name}` ([#755](https://github.com/opensearch-project/opensearch-api-specification/pull/755)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) diff --git a/json_schemas/test_story.schema.yaml b/json_schemas/test_story.schema.yaml index 333f2498..01b742b5 100644 --- a/json_schemas/test_story.schema.yaml +++ b/json_schemas/test_story.schema.yaml @@ -105,6 +105,8 @@ definitions: $ref: '#/definitions/Distributions' retry: $ref: '#/definitions/Retry' + response: + $ref: '#/definitions/ExpectedResponse' required: [method, path] Output: diff --git a/spec/namespaces/ml.yaml b/spec/namespaces/ml.yaml index b2077f7f..2716049b 100644 --- a/spec/namespaces/ml.yaml +++ b/spec/namespaces/ml.yaml @@ -641,8 +641,6 @@ components: items: $ref: '../schemas/ml._common.yaml#/components/schemas/Sort' description: The sort order. - ml.predict: - ml.update_model: content: application/json: @@ -673,23 +671,12 @@ components: interface: type: object description: The model interface. - ml.train: ml.undeploy_model: content: application/json: schema: type: object properties: - parameters: - $ref: '../schemas/ml._common.yaml#/components/schemas/TrainParameters' - input_query: - $ref: '../schemas/ml._common.yaml#/components/schemas/InputQuery' - input_index: - type: array - description: The input index. - items: - type: string - ml.train_predict: node_ids: type: array items: @@ -706,41 +693,6 @@ components: schema: type: object properties: - parameters: - $ref: '../schemas/ml._common.yaml#/components/schemas/TrainParameters' - input_query: - $ref: '../schemas/ml._common.yaml#/components/schemas/InputQuery' - input_index: - type: array - description: The input index. - items: - type: string - input_data: - $ref: '../schemas/ml._common.yaml#/components/schemas/PredictionResult' - connector: - type: object - description: The connector to use for the model. - connector_id: - type: string - description: The connector ID. - is_enabled: - type: boolean - description: Whether the model is enabled. - description: - type: string - description: The model description. - model_config: - $ref: '../schemas/ml._common.yaml#/components/schemas/ModelConfig' - name: - type: string - description: The model name. - rate_limiter: - $ref: '../schemas/ml._common.yaml#/components/schemas/RateLimiter' - guardrails: - $ref: '../schemas/ml._common.yaml#/components/schemas/Guardrails' - interface: - type: object - description: The model interface. node_ids: type: array items: @@ -766,7 +718,7 @@ components: type: string description: The text documents. required: - - text_docs + - text_docs ml.predict: content: application/json: diff --git a/tests/plugins/ml/ml/models/predict.yaml b/tests/plugins/ml/ml/models/predict.yaml index 4c5c7a39..a904ca5b 100644 --- a/tests/plugins/ml/ml/models/predict.yaml +++ b/tests/plugins/ml/ml/models/predict.yaml @@ -37,6 +37,10 @@ prologues: retry: count: 3 wait: 10000 + response: + status: 200 + payload: + state: COMPLETED output: model_id: payload.model_id - path: /_plugins/_ml/models/{model_id}/_deploy @@ -54,6 +58,10 @@ prologues: retry: count: 3 wait: 10000 + response: + status: 200 + payload: + state: COMPLETED output: model_id: payload.model_id epilogues: