Skip to content

Commit

Permalink
Rebase with main, fixed test-spec.yml content, added response propert…
Browse files Browse the repository at this point in the history
…y in prologues of predict.yaml, undeploy.yaml, unload.yaml, added version for ML Model APIs.

Signed-off-by: Nathalie Jonathan <nathhjo@amazon.com>
  • Loading branch information
nathaliellenaa committed Jan 9, 2025
1 parent a83c308 commit 5d536df
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 30 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ jobs:
--opensearch-url=${{ matrix.entry.url || 'https://localhost:9200'}} \
--opensearch-cert=${{ matrix.entry.cert }} \
--opensearch-key=${{ matrix.entry.key }} \
--tests=tests/${{ matrix.entry.tests || 'default' }}
--tests=tests/${{ matrix.entry.tests || 'default' }} \
--log logs/test-spec-${{ steps.tests.outputs.hash }}.log
- name: Get Container Logs
if: failure()
Expand Down Expand Up @@ -206,4 +207,4 @@ jobs:
if: github.event_name == 'pull_request'
with:
name: pr-comment
path: pr-comment.json
path: pr-comment.json
22 changes: 18 additions & 4 deletions spec/namespaces/ml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ paths:
post:
operationId: ml.register_model.0
x-operation-group: ml.register_model
x-version-added: '2.7'
description: Registers a model.
requestBody:
$ref: '#/components/requestBodies/ml.register_model'
Expand All @@ -81,6 +82,7 @@ paths:
operationId: ml.create_model_meta.0
x-operation-group: ml.create_model_meta
deprecated: true
x-version-deprecated: '2.7'
x-deprecation-message: Use `_register_meta` instead.
description: Registers model metadata.
requestBody:
Expand All @@ -92,6 +94,7 @@ paths:
post:
operationId: ml.register_model_meta.0
x-operation-group: ml.register_model_meta
x-version-added: '2.7'
description: Registers model metadata.
requestBody:
$ref: '#/components/requestBodies/ml.register_model_meta'
Expand All @@ -103,6 +106,7 @@ paths:
operationId: ml.chunk_model.0
x-operation-group: ml.chunk_model
deprecated: true
x-version-deprecated: '2.7'
x-deprecation-message: Use `upload_chunk` instead.
description: Uploads model chunk.
parameters:
Expand All @@ -117,6 +121,7 @@ paths:
post:
operationId: ml.upload_chunk.0
x-operation-group: ml.upload_chunk
x-version-added: '2.7'
description: Uploads model chunk.
parameters:
- $ref: '#/components/parameters/ml.upload_chunk::path.chunk_number'
Expand All @@ -131,7 +136,7 @@ paths:
operationId: ml.upload_model.0
x-operation-group: ml.upload_model
deprecated: true
x-version-deprecated: 2.7.0
x-version-deprecated: '2.7'
x-deprecation-message: Use `register_model` instead.
description: Registers a model.
requestBody:
Expand All @@ -143,6 +148,7 @@ paths:
get:
operationId: ml.get_model.0
x-operation-group: ml.get_model
x-version-added: '1.3'
description: Retrieves a model.
parameters:
- $ref: '#/components/parameters/ml.get_model::path.model_id'
Expand All @@ -152,6 +158,7 @@ paths:
put:
operationId: ml.update_model.0
x-operation-group: ml.update_model
x-version-added: '2.12'
description: Updates a model.
parameters:
- $ref: '#/components/parameters/ml.update_model::path.model_id'
Expand All @@ -163,6 +170,7 @@ paths:
delete:
operationId: ml.delete_model.0
x-operation-group: ml.delete_model
x-version-added: '1.3'
description: Deletes a model.
parameters:
- $ref: '#/components/parameters/ml.delete_model::path.model_id'
Expand All @@ -173,6 +181,7 @@ paths:
post:
operationId: ml.deploy_model.0
x-operation-group: ml.deploy_model
x-version-added: '2.7'
description: Deploys a model.
parameters:
- $ref: '#/components/parameters/ml.deploy_model::path.model_id'
Expand All @@ -184,7 +193,7 @@ paths:
operationId: ml.load_model.0
x-operation-group: ml.load_model
deprecated: true
x-version-deprecated: 2.7.0
x-version-deprecated: '2.7'
x-deprecation-message: Use `deploy_model` instead.
description: Deploys a model.
parameters:
Expand All @@ -196,6 +205,7 @@ paths:
post:
operationId: ml.undeploy_model.0
x-operation-group: ml.undeploy_model
x-version-added: '2.7'
description: Undeploys a model.
parameters:
- $ref: '#/components/parameters/ml.undeploy_model::path.model_id'
Expand All @@ -208,6 +218,7 @@ paths:
post:
operationId: ml.undeploy_model.1
x-operation-group: ml.undeploy_model
x-version-added: '2.7'
description: Undeploys a model.
requestBody:
$ref: '#/components/requestBodies/ml.undeploy_model'
Expand All @@ -219,7 +230,7 @@ paths:
operationId: ml.unload_model.0
x-operation-group: ml.unload_model
deprecated: true
x-version-deprecated: 2.7.0
x-version-deprecated: '2.7'
x-deprecation-message: Use `undeploy_model` instead.
description: Unloads a model.
parameters:
Expand All @@ -234,7 +245,7 @@ paths:
operationId: ml.unload_model.1
x-operation-group: ml.unload_model
deprecated: true
x-version-deprecated: 2.7.0
x-version-deprecated: '2.7'
x-deprecation-message: Use `undeploy_model` instead.
description: Unloads a model.
requestBody:
Expand All @@ -246,6 +257,7 @@ paths:
post:
operationId: ml.predict_model.0
x-operation-group: ml.predict_model
x-version-added: '2.12'
description: Predicts a model.
parameters:
- $ref: '#/components/parameters/ml.predict_model::path.model_id'
Expand Down Expand Up @@ -277,6 +289,7 @@ paths:
get:
operationId: ml.search_models.0
x-operation-group: ml.search_models
x-version-added: '1.3'
description: Searches for models.
requestBody:
$ref: '#/components/requestBodies/ml.search_models'
Expand All @@ -286,6 +299,7 @@ paths:
post:
operationId: ml.search_models.1
x-operation-group: ml.search_models
x-version-added: '1.3'
description: Searches for models.
requestBody:
$ref: '#/components/requestBodies/ml.search_models'
Expand Down
1 change: 1 addition & 0 deletions tests/plugins/ml/ml/models/chunk.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test deprecated chunk API for chunk upload.
version: '>= 2.7'
prologues:
- path: /_cluster/settings
method: PUT
Expand Down
35 changes: 16 additions & 19 deletions tests/plugins/ml/ml/models/load.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test the deployment of a model using load API (deprecated).
warnings:
multiple-paths-detected: false
description: Test the deployment of a model using deprecated load API.
prologues:
- path: /_plugins/_ml/models/_register
id: register_model
Expand All @@ -25,6 +23,20 @@ prologues:
output:
model_id: payload.model_id
epilogues:
- path: /_plugins/_ml/tasks/{task_id}
id: get_completed_load_model_task
method: GET
parameters:
task_id: ${load_model.task_id}
retry:
count: 3
wait: 10000
response:
status: 200
payload:
state: RUNNING
output:
model_id: payload.model_id
- path: /_plugins/_ml/models/{model_id}/_undeploy
method: POST
parameters:
Expand All @@ -45,19 +57,4 @@ chapters:
output:
task_id: payload.task_id
response:
status: 200
- synopsis: Wait to get completed task.
id: get_completed_load_model_task
path: /_plugins/_ml/tasks/{task_id}
method: GET
parameters:
task_id: ${load_model.task_id}
response:
status: 200
payload:
state: COMPLETED
output:
model_id: payload.model_id
retry:
count: 3
wait: 10000
status: 200
3 changes: 2 additions & 1 deletion tests/plugins/ml/ml/models/predict.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test the prediction of new data.
version: '>= 2.12'
prologues:
- path: /_cluster/settings
method: PUT
Expand Down Expand Up @@ -61,7 +62,7 @@ prologues:
response:
status: 200
payload:
state: COMPLETED
state: RUNNING
output:
model_id: payload.model_id
epilogues:
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/ml/ml/models/register_meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test the creation of model metadata.
version: '>= 2.11'
version: '>= 2.7'
prologues:
- path: /_cluster/settings
method: PUT
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/ml/ml/models/search.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test the search of models.
version: '>= 2.11'
version: '>= 2.7'
prologues:
- path: /_plugins/_ml/models/_register
id: register_model
Expand Down
10 changes: 9 additions & 1 deletion tests/plugins/ml/ml/models/undeploy.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test the undeployment of specific models from specific nodes and a model from all nodes.
version: '>= 2.11'
version: '>= 2.7'
prologues:
- path: /_cluster/settings
method: PUT
Expand All @@ -27,6 +27,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
Expand All @@ -44,6 +48,10 @@ prologues:
retry:
count: 3
wait: 10000
response:
status: 200
payload:
state: RUNNING
output:
node_id: payload.worker_node[0]
model_id: payload.model_id
Expand Down
8 changes: 8 additions & 0 deletions tests/plugins/ml/ml/models/unload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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
Expand All @@ -43,6 +47,10 @@ prologues:
retry:
count: 3
wait: 10000
response:
status: 200
payload:
state: RUNNING
output:
node_id: payload.worker_node[0]
model_id: payload.model_id
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/ml/ml/models/upload_chunk.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test uploading model chunk.
version: '>= 2.11'
version: '>= 2.7'
prologues:
- path: /_cluster/settings
method: PUT
Expand Down

0 comments on commit 5d536df

Please sign in to comment.