Skip to content

Commit 41af29b

Browse files
torchserve 0.11.0 tests update (#271)
Signed-off-by: sharvil10 <sharvil.shah@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 3e4b6e7 commit 41af29b

File tree

6 files changed

+18
-1
lines changed

6 files changed

+18
-1
lines changed

pytorch/serving/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ docker container stop server
4949

5050
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.
5151

52+
> [!NOTE]
53+
> 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).
54+
55+
> [!NOTE]
56+
> 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.
57+
5258
1. Add your model to the config file
5359

5460
```properties

pytorch/serving/config.properties

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ allowed_urls=https://s3.amazonaws.com/.*,https://torchserve.pytorch.org/.*
1010
ipex_enable=true
1111
cpu_launcher_enable=true
1212
cpu_launcher_args=--use_logical_core
13+
disable_token_authorization=true
14+
enable_model_api=true

pytorch/serving/model-store/grpc-test.sh

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#
2626
# For reference:
2727
# https://docs.docker.com/develop/develop-images/build_enhancements/
28+
set -e
2829

2930
apt-get -y update
3031
apt-get -y install curl

pytorch/serving/model-store/rest-test.sh

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
# For reference:
2727
# https://docs.docker.com/develop/develop-images/build_enhancements/
2828

29+
set -e
30+
2931
apt-get -y update
3032
apt-get -y install curl
3133
# curl -O https://torchserve.pytorch.org/mar_files/squeezenet1_1.mar

pytorch/serving/tests.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ ipex-serving-rest-inference:
5454
volumes:
5555
- src: $PWD/pytorch/serving/model-store
5656
dst: /home/model-server/model-store
57+
- src: $PWD/pytorch/serving/wf-store
58+
dst: /home/model-server/wf-store
5759
env:
5860
ENABLE_TORCH_PROFILER: 'true'
5961
shm_size: 1g
@@ -65,6 +67,8 @@ ipex-serving-grpc-inference:
6567
volumes:
6668
- src: $PWD/pytorch/serving/model-store
6769
dst: /home/model-server/model-store
70+
- src: $PWD/pytorch/serving/wf-store
71+
dst: /home/model-server/wf-store
6872
env:
6973
ENABLE_TORCH_PROFILER: 'true'
7074
shm_size: 1g

pytorch/serving/wf-store/rest-test.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
# For reference:
2727
# https://docs.docker.com/develop/develop-images/build_enhancements/
2828

29+
set -e
30+
2931
apt-get -y update
3032
apt-get -y install curl
3133

@@ -47,4 +49,4 @@ curl --fail -X POST http://127.0.0.1:8080/wfpredict/dog_breed_wf -T Dog1.jpg
4749
curl --fail -O https://raw.githubusercontent.com/pytorch/serve/master/examples/Workflows/dog_breed_classification/model_input/Dog2.jpg
4850
curl --fail -X POST http://127.0.0.1:8080/wfpredict/dog_breed_wf -T Dog2.jpg
4951

50-
rm -rf ./*.war ./Cat.jpg ./Dog1.jpg ./Dog2.jpg ../model-store/*.mar
52+
rm -rf ./*.war ./Cat.jpg ./Dog1.jpg ./Dog2.jpg

0 commit comments

Comments
 (0)