-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade pytorch to 1.13.1, including CI integration tests
- Loading branch information
1 parent
5ae7218
commit 7bd66ed
Showing
5 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ARG region | ||
FROM 763104351884.dkr.ecr.$region.amazonaws.com/pytorch-inference:1.13.1-cpu-py39-ubuntu20.04-sagemaker | ||
|
||
RUN pip uninstall torchserve -y && \ | ||
pip install torchserve-nightly==2022.3.23.post2 | ||
|
||
COPY dist/sagemaker_pytorch_inference-*.tar.gz /sagemaker_pytorch_inference.tar.gz | ||
RUN pip install --upgrade --no-cache-dir /sagemaker_pytorch_inference.tar.gz && \ | ||
rm /sagemaker_pytorch_inference.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ARG region | ||
FROM 763104351884.dkr.ecr.$region.amazonaws.com/pytorch-inference:1.13.1-gpu-py38-cu117-ubuntu20.04-sagemaker | ||
|
||
RUN pip uninstall torchserve -y && \ | ||
pip install torchserve-nightly==2022.3.23.post2 | ||
|
||
COPY dist/sagemaker_pytorch_inference-*.tar.gz /sagemaker_pytorch_inference.tar.gz | ||
RUN pip install --upgrade --no-cache-dir /sagemaker_pytorch_inference.tar.gz && \ | ||
rm /sagemaker_pytorch_inference.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime | ||
|
||
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true | ||
LABEL com.amazonaws.sagemaker.capabilities.multi-models=true | ||
|
||
ARG TS_VERSION=0.7.0 | ||
ARG TS_ARCHIVER_VERSION=0.7.0 | ||
|
||
ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main | ||
ENV TEMP=/home/model-server/tmp | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends software-properties-common \ | ||
&& add-apt-repository ppa:openjdk-r/ppa \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
libgl1-mesa-glx \ | ||
libglib2.0-0 \ | ||
libsm6 \ | ||
libxext6 \ | ||
libxrender-dev \ | ||
openjdk-11-jdk-headless \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN conda install -c conda-forge opencv \ | ||
&& ln -s /opt/conda/bin/pip /usr/local/bin/pip3 | ||
|
||
RUN pip install torchserve-nightly==2023.1.31 \ | ||
&& pip install torch-model-archiver==$TS_ARCHIVER_VERSION | ||
|
||
COPY dist/sagemaker_pytorch_inference-*.tar.gz /sagemaker_pytorch_inference.tar.gz | ||
RUN pip install --no-cache-dir /sagemaker_pytorch_inference.tar.gz && \ | ||
rm /sagemaker_pytorch_inference.tar.gz | ||
|
||
RUN useradd -m model-server \ | ||
&& mkdir -p /home/model-server/tmp \ | ||
&& chown -R model-server /home/model-server | ||
|
||
COPY artifacts/ts-entrypoint.py /usr/local/bin/dockerd-entrypoint.py | ||
COPY artifacts/config.properties /home/model-server | ||
|
||
RUN chmod +x /usr/local/bin/dockerd-entrypoint.py | ||
|
||
EXPOSE 8080 8081 | ||
ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] | ||
CMD ["torchserve", "--start", "--ts-config", "/home/model-server/config.properties", "--model-store", "/home/model-server/"] |