diff --git a/docker/Dockerfile b/docker/Dockerfile index 333f585047..e028fb88da 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -63,6 +63,7 @@ RUN export USE_CUDA=1 ARG CUDA_VERSION="" +# Note: This is **only** used to install dependencies in this image - changing it will not build a custom image RUN git clone --depth 1 https://github.com/pytorch/serve.git WORKDIR "serve" diff --git a/docker/build_custom_images.sh b/docker/build_custom_images.sh index dcebdd06c3..bccfd5c27d 100755 --- a/docker/build_custom_images.sh +++ b/docker/build_custom_images.sh @@ -1,7 +1,15 @@ #!/bin/sh -# build 23mt-cpu -./build_image.sh -bt dev -b torchserve-23mt -t textshuttle/pytorch-serve:23mt-cpu +# increment when appropriate +VERSION=3 -# build 23mt-gpu -./build_image.sh -bt dev -g -cv cu113 -b torchserve-23mt -t textshuttle/pytorch-serve:23mt-gpu +# these need to be -bt dev, otherwise the pip torchserve version will be installed + +# build cpu +./build_image.sh -bt dev -b torchserve-23mt-v0.8.0 -t textshuttle/pytorch-serve:torchserve-23mt-v0.8.0-v${VERSION}-cpu + +# build gpu +./build_image.sh -bt dev -b torchserve-23mt-v0.8.0 -g -cv cu118 -t textshuttle/pytorch-serve:torchserve-23mt-v0.8.0-v${VERSION}-gpu + +# note that this will build arm/amd images depending on your OS +# for multi-platform building and tagging, see https://github.com/textshuttle/pytorch-serve/pull/15#issuecomment-1906360733 diff --git a/docker/build_image.sh b/docker/build_image.sh index 64f22252b0..16a094829f 100755 --- a/docker/build_image.sh +++ b/docker/build_image.sh @@ -3,9 +3,9 @@ set -o errexit -o nounset -o pipefail MACHINE=cpu -BRANCH_NAME="master" -DOCKER_TAG="pytorch/torchserve:latest-cpu" -BUILD_TYPE="production" +BRANCH_NAME="" +DOCKER_TAG="" +BUILD_TYPE="" BASE_IMAGE="ubuntu:20.04" USE_CUSTOM_TAG=false CUDA_VERSION="" diff --git a/requirements/torch_cu118_linux.txt b/requirements/torch_cu118_linux.txt index d34969ef55..5e8231e42a 100644 --- a/requirements/torch_cu118_linux.txt +++ b/requirements/torch_cu118_linux.txt @@ -1,7 +1,4 @@ #pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117 --extra-index-url https://download.pytorch.org/whl/cu118 -r torch_common.txt -torch==2.0.1+cu118; sys_platform == 'linux' -torchvision==0.15.2+cu118; sys_platform == 'linux' -torchtext==0.15.2; sys_platform == 'linux' -torchaudio==2.0.2+cu118; sys_platform == 'linux' +torch==2.1.0+cu118; sys_platform == 'linux' diff --git a/requirements/torch_linux.txt b/requirements/torch_linux.txt index 96424b9ca4..4788e3b49a 100644 --- a/requirements/torch_linux.txt +++ b/requirements/torch_linux.txt @@ -1,7 +1,4 @@ #pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu --extra-index-url https://download.pytorch.org/whl/cpu -r torch_common.txt -torch==2.0.1+cpu; sys_platform == 'linux' -torchvision==0.15.2+cpu; sys_platform == 'linux' -torchtext==0.15.2; sys_platform == 'linux' -torchaudio==2.0.2+cpu; sys_platform == 'linux' +torch==2.1.0+cpu; sys_platform == 'linux'