diff --git a/pytorch/serving/README.md b/pytorch/serving/README.md index d6e3ba53..133c48f4 100644 --- a/pytorch/serving/README.md +++ b/pytorch/serving/README.md @@ -49,6 +49,12 @@ docker container stop server As demonstrated in the above example, models must be registered before they can be used for predictions. The best way to ensure models are pre-registered with ideal settings is to modify the included [config file](./config.properties) for the torchserve server. +> [!NOTE] +> Since torchserve 0.11.1 torchserve asks for token authentication for security. We've disabled it in the config.properties by setting `disable_token_authorization=true`. If you want to enable the authentication you can find more details in the [documentation](https://github.com/pytorch/serve/blob/master/docs/token_authorization_api.md). + +> [!NOTE] +> Since torchserve 0.11.1 the model API has been disabled by default. We enable the model API by setting `enable_model_api=true` in provided config.properties. + 1. Add your model to the config file ```properties diff --git a/pytorch/serving/config.properties b/pytorch/serving/config.properties index 48e1db6a..8f17094d 100644 --- a/pytorch/serving/config.properties +++ b/pytorch/serving/config.properties @@ -10,3 +10,5 @@ allowed_urls=https://s3.amazonaws.com/.*,https://torchserve.pytorch.org/.* ipex_enable=true cpu_launcher_enable=true cpu_launcher_args=--use_logical_core +disable_token_authorization=true +enable_model_api=true diff --git a/pytorch/serving/model-store/grpc-test.sh b/pytorch/serving/model-store/grpc-test.sh index 793e2294..17011bd4 100644 --- a/pytorch/serving/model-store/grpc-test.sh +++ b/pytorch/serving/model-store/grpc-test.sh @@ -25,6 +25,7 @@ # # For reference: # https://docs.docker.com/develop/develop-images/build_enhancements/ +set -e apt-get -y update apt-get -y install curl diff --git a/pytorch/serving/model-store/rest-test.sh b/pytorch/serving/model-store/rest-test.sh index 4580814c..5ea6eaef 100644 --- a/pytorch/serving/model-store/rest-test.sh +++ b/pytorch/serving/model-store/rest-test.sh @@ -26,6 +26,8 @@ # For reference: # https://docs.docker.com/develop/develop-images/build_enhancements/ +set -e + apt-get -y update apt-get -y install curl # curl -O https://torchserve.pytorch.org/mar_files/squeezenet1_1.mar diff --git a/pytorch/serving/tests.yaml b/pytorch/serving/tests.yaml index ae8e92e4..3c91eced 100644 --- a/pytorch/serving/tests.yaml +++ b/pytorch/serving/tests.yaml @@ -54,6 +54,8 @@ ipex-serving-rest-inference: volumes: - src: $PWD/pytorch/serving/model-store dst: /home/model-server/model-store + - src: $PWD/pytorch/serving/wf-store + dst: /home/model-server/wf-store env: ENABLE_TORCH_PROFILER: 'true' shm_size: 1g @@ -65,6 +67,8 @@ ipex-serving-grpc-inference: volumes: - src: $PWD/pytorch/serving/model-store dst: /home/model-server/model-store + - src: $PWD/pytorch/serving/wf-store + dst: /home/model-server/wf-store env: ENABLE_TORCH_PROFILER: 'true' shm_size: 1g diff --git a/pytorch/serving/wf-store/rest-test.sh b/pytorch/serving/wf-store/rest-test.sh index 2bf72e52..2e5850aa 100644 --- a/pytorch/serving/wf-store/rest-test.sh +++ b/pytorch/serving/wf-store/rest-test.sh @@ -26,6 +26,8 @@ # For reference: # https://docs.docker.com/develop/develop-images/build_enhancements/ +set -e + apt-get -y update apt-get -y install curl @@ -47,4 +49,4 @@ curl --fail -X POST http://127.0.0.1:8080/wfpredict/dog_breed_wf -T Dog1.jpg curl --fail -O https://raw.githubusercontent.com/pytorch/serve/master/examples/Workflows/dog_breed_classification/model_input/Dog2.jpg curl --fail -X POST http://127.0.0.1:8080/wfpredict/dog_breed_wf -T Dog2.jpg -rm -rf ./*.war ./Cat.jpg ./Dog1.jpg ./Dog2.jpg ../model-store/*.mar +rm -rf ./*.war ./Cat.jpg ./Dog1.jpg ./Dog2.jpg