Skip to content

Commit

Permalink
Added Python model REST protocol test on triton for Kserve (#2009)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raghul-M authored Nov 29, 2024
1 parent 0776346 commit 910dcc3
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"inputs":[{"name":"INPUT0","shape":[4],"datatype":"FP32","data":[0.7061783075332642,0.29758837819099426,0.12088008970022202,0.974242627620697]},{"name":"INPUT1","shape":[4],"datatype":"FP32","data":[0.21526464819908142,0.32474634051322937,0.6850584745407104,0.2836116552352905]}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"model_name":"python","model_version":"1","outputs":[{"name":"OUTPUT0","datatype":"FP32","shape":[4],"data":[0.921442985534668,0.6223347187042236,0.8059385418891907,1.2578542232513428]},{"name":"OUTPUT1","datatype":"FP32","shape":[4],"data":[0.49091365933418274,-0.027157962322235107,-0.5641784071922302,0.6906309723854065]}]}
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ spec:
name: triton
priority: 1
version: "2"
- autoSelect: true
name: python
version: "1"
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ ${TENSORFLOW_RUNTIME_NAME}= triton-tensorflow-grpc
${TENSORFLOW_GRPC_RUNTIME_NAME}= triton-tensorflow-grpc
${TENSORFLOW_RUNTIME_FILEPATH}= ${RESOURCES_DIRPATH}/triton_tensorflow_gRPC_servingruntime.yaml
${EXPECTED_INFERENCE_GRPC_OUTPUT_FILE_TENSORFLOW}= tests/Resources/Files/triton/kserve-triton-inception_graphdef-gRPC-output.json
${PYTHON_MODEL_NAME}= python
${EXPECTED_INFERENCE_PYTHON_REST_OUTPUT_FILE}= tests/Resources/Files/triton/kserve-triton-python-rest-output.json
${INFERENCE_REST_INPUT_PYTHON}= @tests/Resources/Files/triton/kserve-triton-python-rest-input.json
${KERAS_RUNTIME_NAME}= triton-keras-rest
${KERAS_MODEL_NAME}= resnet50
${KERAS_RUNTIME_FILEPATH}= ${RESOURCES_DIRPATH}/triton_keras_rest_servingruntime.yaml
Expand All @@ -55,7 +58,6 @@ ${PYTHON_MODEL_NAME}= python
${EXPECTED_INFERENCE_GRPC_OUTPUT_FILE_PYTHON}= tests/Resources/Files/triton/kserve-triton-python-gRPC-output.json
${INFERENCE_GRPC_INPUT_PYTHON}= tests/Resources/Files/triton/kserve-triton-python-gRPC-input.json


*** Test Cases ***
Test Onnx Model Rest Inference Via UI (Triton on Kserve) # robocop: off=too-long-test-case
[Documentation] Test the deployment of an onnx model in Kserve using Triton
Expand Down Expand Up @@ -243,7 +245,6 @@ Test KERAS Model Inference Via UI(Triton on Kserve)
... AND
... Delete Serving Runtime Template From CLI displayed_name=triton-keras-rest


Test Python Model Grpc Inference Via UI (Triton on Kserve) # robocop: off=too-long-test-case
[Documentation] Test the deployment of an python model in Kserve using Triton
[Tags] Tier2 RHOAIENG-15374
Expand Down Expand Up @@ -289,7 +290,36 @@ Test Python Model Grpc Inference Via UI (Triton on Kserve) # robocop: off=too
... Clean All Models Of Current User
... AND
... Delete Serving Runtime Template From CLI displayed_name=triton-kserve-grpc


Test Python Model Rest Inference Via UI (Triton on Kserve) # robocop: off=too-long-test-case
[Documentation] Test the deployment of an python model in Kserve using Triton
[Tags] Tier2 RHOAIENG-15374
Open Data Science Projects Home Page
Create Data Science Project title=${PRJ_TITLE} description=${PRJ_DESCRIPTION}
... existing_project=${FALSE}
Open Dashboard Settings settings_page=Serving runtimes
Upload Serving Runtime Template runtime_filepath=${ONNX_RUNTIME_FILEPATH}
... serving_platform=single runtime_protocol=REST
Serving Runtime Template Should Be Listed displayed_name=${ONNX_RUNTIME_NAME}
... serving_platform=single
Recreate S3 Data Connection project_title=${PRJ_TITLE} dc_name=model-serving-connection
... aws_access_key=${S3.AWS_ACCESS_KEY_ID} aws_secret_access=${S3.AWS_SECRET_ACCESS_KEY}
... aws_bucket_name=ods-ci-s3
Deploy Kserve Model Via UI model_name=${PYTHON_MODEL_NAME} serving_runtime=triton-kserve-rest
... data_connection=model-serving-connection path=triton/model_repository/ model_framework=python - 1
Wait For Pods To Be Ready label_selector=serving.kserve.io/inferenceservice=${PYTHON_MODEL_NAME}
... namespace=${PRJ_TITLE}
${EXPECTED_INFERENCE_REST_OUTPUT_PYTHON}= Load Json File file_path=${EXPECTED_INFERENCE_PYTHON_REST_OUTPUT_FILE}
... as_string=${TRUE}
Run Keyword And Continue On Failure Verify Model Inference With Retries
... ${PYTHON_MODEL_NAME} ${INFERENCE_REST_INPUT_PYTHON} ${EXPECTED_INFERENCE_REST_OUTPUT_PYTHON}
... token_auth=${FALSE} project_title=${PRJ_TITLE}
[Teardown] Run Keywords Get Kserve Events And Logs model_name=${PYTHON_MODEL_NAME}
... project_title=${PRJ_TITLE}
... AND
... Clean All Models Of Current User
... AND
... Delete Serving Runtime Template From CLI displayed_name=triton-kserve-rest

*** Keywords ***
Triton On Kserve Suite Setup
Expand Down

0 comments on commit 910dcc3

Please sign in to comment.