From f56ff377f1938b837fa9b5246dc90057cec7368f Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Tue, 19 Dec 2023 01:51:49 +0000 Subject: [PATCH] test with torchserve healthcheck. --- .github/workflows/docker-test.yml | 2 +- tests/test_torchserve.sh | 10 +++++++++- torchserve-cuda.yml | 2 +- torchserve.yml | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index b6633872..784b311d 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -7,7 +7,7 @@ jobs: - uses: actions/checkout@v4 - name: docker build run: | - ./tests/test_torchserve.sh + timeout 600s ./tests/test_torchserve.sh test-gamutrf-extra-images: runs-on: ubuntu-latest steps: diff --git a/tests/test_torchserve.sh b/tests/test_torchserve.sh index 09a8f138..c1e7b82a 100755 --- a/tests/test_torchserve.sh +++ b/tests/test_torchserve.sh @@ -16,7 +16,15 @@ torch-model-archiver --force --model-name yolov8n --version 1.0 --serialized-fil rm -rf model_store && mkdir model_store mv yolov8n.mar model_store/ # TODO: --runtime nvidia is required for Orin, --gpus all for x86 -docker run -v $(pwd)/model_store:/model_store -p 8080:8080 --rm --name testts --entrypoint timeout -d iqtlabs/torchserve:v0.0.5 180s /torchserve/torchserve-entrypoint.sh --models yolov8n=yolov8n.mar +docker run -v $(pwd)/model_store:/model_store -p 8080:8080 --rm --name testts --entrypoint timeout -d iqtlabs/torchserve:v0.0.6 600s /torchserve/torchserve-entrypoint.sh --models yolov8n=yolov8n.mar +echo waiting for healthcheck +HC="" +while [ "$HC" != "healthy" ] ; do + sleep 1 + HC=$(docker inspect --format='{{json .State.Health}}' testts |jq -r .Status) + echo $HC + docker logs testts +done PRED=$(wget -q --retry-connrefused --retry-on-host-error --body-file=persons.jpg --method=PUT -O- --header='Content-Type: image/jpg' http://127.0.0.1:8080/predictions/yolov8n | jq) echo $PRED if [ "$PRED" = "" ] ; then diff --git a/torchserve-cuda.yml b/torchserve-cuda.yml index 15fcb3e0..476dcf18 100644 --- a/torchserve-cuda.yml +++ b/torchserve-cuda.yml @@ -4,7 +4,7 @@ networks: services: torchserve: restart: always - image: iqtlabs/cuda-torchserve:v0.0.5 + image: iqtlabs/cuda-torchserve:v0.0.6 networks: - gamutrf ports: diff --git a/torchserve.yml b/torchserve.yml index d76ec958..62c23930 100644 --- a/torchserve.yml +++ b/torchserve.yml @@ -4,7 +4,7 @@ networks: services: torchserve: restart: always - image: iqtlabs/torchserve:v0.0.5 + image: iqtlabs/torchserve:v0.0.6 networks: - gamutrf ports: