Skip to content

Commit

Permalink
Merge pull request #1052 from anarkiwi/hc
Browse files Browse the repository at this point in the history
test with torchserve healthcheck.
  • Loading branch information
anarkiwi authored Dec 19, 2023
2 parents d00880d + f56ff37 commit b52d84a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 9 additions & 1 deletion tests/test_torchserve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion torchserve-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion torchserve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ networks:
services:
torchserve:
restart: always
image: iqtlabs/torchserve:v0.0.5
image: iqtlabs/torchserve:v0.0.6
networks:
- gamutrf
ports:
Expand Down

0 comments on commit b52d84a

Please sign in to comment.