From ce9930498422b17ca5354f7d2dc225f3ee60143d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 01:38:35 +0000 Subject: [PATCH 1/3] Update ubuntu Docker tag to v24 --- docker/Dockerfile.torchserve | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile.torchserve b/docker/Dockerfile.torchserve index 6ba6e3e..5b4e1b4 100644 --- a/docker/Dockerfile.torchserve +++ b/docker/Dockerfile.torchserve @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG PIP_CACHE ENV DEBIAN_FRONTEND=noninteractive WORKDIR /root From 930cff1e64798fbb7ff839e23436c4bddf413833 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 23 May 2024 13:04:48 -0400 Subject: [PATCH 2/3] sort out pip issues in Ubuntu 24 and Python 3.12 --- docker/Dockerfile.torchserve | 5 ++++- torchserve/install-torchserve.sh | 9 ++++++++- torchserve/torchserve-entrypoint.sh | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile.torchserve b/docker/Dockerfile.torchserve index 5b4e1b4..411c540 100644 --- a/docker/Dockerfile.torchserve +++ b/docker/Dockerfile.torchserve @@ -2,13 +2,16 @@ FROM ubuntu:24.04 ARG PIP_CACHE ENV DEBIAN_FRONTEND=noninteractive WORKDIR /root +ENV PYENV_ROOT="/pyenv" +ENV PATH="${PATH}:${PYENV_ROOT}/bin:${PYENV_ROOT}/shims" COPY torchserve/pipcacheconfig.sh /torchserve/pipcacheconfig.sh COPY torchserve/clone-torchserve.sh /torchserve/clone-torchserve.sh COPY torchserve/install-common.sh /torchserve/install-common.sh COPY torchserve/install-torchserve.sh /torchserve/install-torchserve.sh RUN /torchserve/pipcacheconfig.sh RUN --mount=type=cache,target=/root/.cache /torchserve/install-torchserve.sh -RUN /usr/local/bin/torchserve --help +# ENTRYPOINT ["tail", "-f", "/dev/null"] +RUN $(which 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 diff --git a/torchserve/install-torchserve.sh b/torchserve/install-torchserve.sh index 71cb48b..13304df 100755 --- a/torchserve/install-torchserve.sh +++ b/torchserve/install-torchserve.sh @@ -4,7 +4,14 @@ set -e apt-get update && \ apt-get install -y \ git \ - python3-pip && \ + curl \ + gcc g++ libev-dev libyaml-dev tini ca-certificates \ + libjpeg-dev build-essential zlib1g-dev libffi-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev && \ + export PYENV_ROOT="/pyenv" && \ + curl https://pyenv.run | bash && \ + export PATH="${PATH}:${PYENV_ROOT}/bin:${PYENV_ROOT}/shims" && \ + pyenv install 3.11 && \ + pyenv global 3.11 && \ $(dirname $0)/clone-torchserve.sh && \ cd serve && \ python3 ./ts_scripts/install_dependencies.py --environment prod $* && \ diff --git a/torchserve/torchserve-entrypoint.sh b/torchserve/torchserve-entrypoint.sh index f14b3ad..65a62a1 100755 --- a/torchserve/torchserve-entrypoint.sh +++ b/torchserve/torchserve-entrypoint.sh @@ -1,2 +1,2 @@ #!/bin/sh -exec /usr/local/bin/torchserve --start --model-store /model_store --ts-config /torchserve/config.properties --ncs --foreground $* +exec $(which torchserve) --start --model-store /model_store --ts-config /torchserve/config.properties --ncs --foreground $* From 3c348ecc54c1cefb99db366cda101d9ba116772b Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 23 May 2024 13:53:59 -0400 Subject: [PATCH 3/3] sort out consequences for cuda builds --- docker/Dockerfile.cuda-torchserve | 4 +++- torchserve/clone-torchserve.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.cuda-torchserve b/docker/Dockerfile.cuda-torchserve index a55e69a..3b07c5c 100644 --- a/docker/Dockerfile.cuda-torchserve +++ b/docker/Dockerfile.cuda-torchserve @@ -2,13 +2,15 @@ FROM nvidia/cuda:12.4.0-runtime-ubuntu22.04 ARG PIP_CACHE ENV DEBIAN_FRONTEND=noninteractive WORKDIR /root +ENV PYENV_ROOT="/pyenv" +ENV PATH="${PATH}:${PYENV_ROOT}/bin:${PYENV_ROOT}/shims" COPY torchserve/pipcacheconfig.sh /torchserve/pipcacheconfig.sh COPY torchserve/clone-torchserve.sh /torchserve/clone-torchserve.sh COPY torchserve/install-common.sh /torchserve/install-common.sh COPY torchserve/install-torchserve.sh /torchserve/install-torchserve.sh RUN /torchserve/pipcacheconfig.sh RUN --mount=type=cache,target=/root/.cache /torchserve/install-torchserve.sh --cuda cu121 -RUN /usr/local/bin/torchserve --help +RUN $(which 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 diff --git a/torchserve/clone-torchserve.sh b/torchserve/clone-torchserve.sh index 73dc7c8..adcad5b 100755 --- a/torchserve/clone-torchserve.sh +++ b/torchserve/clone-torchserve.sh @@ -1,2 +1,2 @@ #!/bin/sh -git clone https://github.com/pytorch/serve -b v0.10.0 +git clone --depth=1 https://github.com/pytorch/serve -b v0.10.0