Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

healthcheck. #12

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker/Dockerfile.cuda-torchserve
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ RUN --mount=type=cache,target=/root/.cache /torchserve/install-torchserve.sh --c
RUN /usr/local/bin/torchserve --help
COPY torchserve/config.properties /torchserve/config.properties
COPY torchserve/torchserve-entrypoint.sh /torchserve/torchserve-entrypoint.sh
COPY torchserve/healthcheck.sh /torchserve/healthcheck.sh
HEALTHCHECK CMD /torchserve/healthcheck.sh || exit 1
ENTRYPOINT ["/torchserve/torchserve-entrypoint.sh"]

# see Dockerfile.torchserve for example, but use
2 changes: 2 additions & 0 deletions docker/Dockerfile.orin-torchserve
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ RUN --mount=type=cache,target=/root/.cache /torchserve/install-orin-torchserve.s
RUN /usr/local/bin/torchserve --help
COPY torchserve/config.properties /torchserve/config.properties
COPY torchserve/torchserve-entrypoint.sh /torchserve/torchserve-entrypoint.sh
COPY torchserve/healthcheck.sh /torchserve/healthcheck.sh
HEALTHCHECK CMD /torchserve/healthcheck.sh || exit 1
ENTRYPOINT ["/torchserve/torchserve-entrypoint.sh"]

# 0. Always start from a clean sdkmanager, installation of Ubuntu 20.04. DO NOT attempt an in-place JetPack upgrade, DO NOT try to install docker-ce, and DO NOT try to re-install/replace CUDA without re-imaging the entire system.
2 changes: 2 additions & 0 deletions docker/Dockerfile.rocm-torchserve
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ RUN --mount=type=cache,target=/root/.cache /torchserve/install-rocm-torchserve.s
RUN torchserve --help
COPY torchserve/config.properties /torchserve/config.properties
COPY torchserve/torchserve-rocm-entrypoint.sh /torchserve/torchserve-entrypoint.sh
COPY torchserve/healthcheck.sh /torchserve/healthcheck.sh
HEALTHCHECK CMD /torchserve/healthcheck.sh || exit 1
ENTRYPOINT ["/torchserve/torchserve-entrypoint.sh"]

# TODO: must build locally - 20+GB required, which is too much for Github.
2 changes: 2 additions & 0 deletions docker/Dockerfile.torchserve
Original file line number Diff line number Diff line change
@@ -8,4 +8,6 @@ RUN --mount=type=cache,target=/root/.cache /torchserve/install-torchserve.sh
RUN /usr/local/bin/torchserve --help
COPY torchserve/config.properties /torchserve/config.properties
COPY torchserve/torchserve-entrypoint.sh /torchserve/torchserve-entrypoint.sh
COPY torchserve/healthcheck.sh /torchserve/healthcheck.sh
HEALTHCHECK CMD /torchserve/healthcheck.sh || exit 1
ENTRYPOINT ["/torchserve/torchserve-entrypoint.sh"]
7 changes: 7 additions & 0 deletions torchserve/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

RESPONSE=$(curl localhost:8080/ping | jq .status)
if [ "${RESPONSE}" == '"Healthy"' ]; then
exit 0
fi
exit 1
1 change: 1 addition & 0 deletions torchserve/install-common.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/sh
apt-get update && apt-get install wget jq
pip install opencv-python pandas py-cpuinfo scipy seaborn thop