Skip to content

Commit 9cc1574

Browse files
committed
Update DLC Containers
1 parent 5dada25 commit 9cc1574

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
ARG region
22
FROM 763104351884.dkr.ecr.$region.amazonaws.com/pytorch-inference:1.5.0-cpu-py3
33

4+
ARG TS_VERSION=0.1.1
5+
RUN apt-get update \
6+
&& apt-get install -y --no-install-recommends software-properties-common \
7+
&& add-apt-repository ppa:openjdk-r/ppa \
8+
&& apt-get update \
9+
&& apt-get install -y --no-install-recommends openjdk-11-jdk
10+
11+
RUN pip install torchserve==$TS_VERSION \
12+
&& pip install torch-model-archiver==$TS_VERSION
13+
14+
RUN pip uninstall torch \
15+
&& pip uninstall torchvision \
16+
&& pip install torch=1.6.0 \
17+
&& pip install torchvision=0.7.0
18+
419
COPY dist/sagemaker_pytorch_inference-*.tar.gz /sagemaker_pytorch_inference.tar.gz
520
RUN pip install --upgrade --no-cache-dir /sagemaker_pytorch_inference.tar.gz && \
621
rm /sagemaker_pytorch_inference.tar.gz
22+
23+
CMD ["torchserve", "--start", "--ts-config", "/home/model-server/config.properties", "--model-store", "/home/model-server/"]
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
ARG region
2-
FROM 763104351884.dkr.ecr.$region.amazonaws.com/pytorch-inference:1.5.0-gpu-py3
2+
FROM 763104351884.dkr.ecr.$region.amazonaws.com/pytorch-inference:1.5.0-cpu-py3
3+
4+
ARG TS_VERSION=0.1.1
5+
RUN apt-get update \
6+
&& apt-get install -y --no-install-recommends software-properties-common \
7+
&& add-apt-repository ppa:openjdk-r/ppa \
8+
&& apt-get update \
9+
&& apt-get install -y --no-install-recommends openjdk-11-jdk
10+
11+
RUN pip install torchserve==$TS_VERSION \
12+
&& pip install torch-model-archiver==$TS_VERSION
13+
14+
RUN pip uninstall torch \
15+
&& pip uninstall torchvision \
16+
&& pip install torch=1.6.0 \
17+
&& pip install torchvision=0.7.0
318

419
COPY dist/sagemaker_pytorch_inference-*.tar.gz /sagemaker_pytorch_inference.tar.gz
520
RUN pip install --upgrade --no-cache-dir /sagemaker_pytorch_inference.tar.gz && \
621
rm /sagemaker_pytorch_inference.tar.gz
22+
23+
CMD ["torchserve", "--start", "--ts-config", "/home/model-server/config.properties", "--model-store", "/home/model-server/"]

0 commit comments

Comments
 (0)