diff --git a/docker/1.1.0/base/Dockerfile.cpu b/docker/1.1.0/base/Dockerfile.cpu deleted file mode 100644 index f2d6cf0f..00000000 --- a/docker/1.1.0/base/Dockerfile.cpu +++ /dev/null @@ -1,40 +0,0 @@ -FROM ubuntu:16.04 - -ENV py_version=3 - -# Validate that arguments are specified -RUN test $py_version || exit 1 - -# Install python and nginx -RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common && \ - add-apt-repository ppa:deadsnakes/ppa -y && \ - apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - curl \ - jq \ - libsm6 \ - libxext6 \ - libxrender-dev \ - nginx && \ - if [ $py_version -eq 3 ]; \ - then apt-get install -y --no-install-recommends python3.6-dev \ - && ln -s -f /usr/bin/python3.6 /usr/bin/python; \ - else apt-get install -y --no-install-recommends python-dev; fi && \ - rm -rf /var/lib/apt/lists/* - -# Install pip -RUN cd /tmp && \ - curl -O https://bootstrap.pypa.io/get-pip.py && \ - python get-pip.py 'pip<=18.1' && rm get-pip.py - -# Python won’t try to write .pyc or .pyo files on the import of source modules -# Force stdin, stdout and stderr to be totally unbuffered. Good for logging -ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PYTHONIOENCODING=UTF-8 LANG=C.UTF-8 LC_ALL=C.UTF-8 - -# Install dependencies from pip -RUN if [ $py_version -eq 3 ]; \ - then pip install --no-cache-dir https://download.pytorch.org/whl/cpu/torch-1.1.0-cp36-cp36m-linux_x86_64.whl \ - https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp36-cp36m-linux_x86_64.whl fastai==1.0.39; \ - else pip install --no-cache-dir https://download.pytorch.org/whl/cpu/torch-1.1.0-cp27-cp27mu-linux_x86_64.whl \ - https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp27-cp27mu-linux_x86_64.whl; fi && \ - pip install --no-cache-dir 'opencv-python>=4.0,<4.1' Pillow retrying six diff --git a/docker/1.1.0/base/Dockerfile.gpu b/docker/1.1.0/base/Dockerfile.gpu deleted file mode 100644 index c7a78441..00000000 --- a/docker/1.1.0/base/Dockerfile.gpu +++ /dev/null @@ -1,35 +0,0 @@ -FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu16.04 - -ENV py_version=3 - -# Validate that arguments are specified -RUN test $py_version || exit 1 - -# Install python and nginx -RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common && \ - add-apt-repository ppa:deadsnakes/ppa -y && \ - apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - curl \ - jq \ - libsm6 \ - libxext6 \ - libxrender-dev \ - nginx && \ - if [ $py_version -eq 3 ]; \ - then apt-get install -y --no-install-recommends python3.6-dev \ - && ln -s -f /usr/bin/python3.6 /usr/bin/python; \ - else apt-get install -y --no-install-recommends python-dev; fi && \ - rm -rf /var/lib/apt/lists/* - -# Install pip -RUN cd /tmp && \ - curl -O https://bootstrap.pypa.io/get-pip.py && \ - python get-pip.py 'pip<=18.1' && rm get-pip.py - -# Python won’t try to write .pyc or .pyo files on the import of source modules -# Force stdin, stdout and stderr to be totally unbuffered. Good for logging -ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PYTHONIOENCODING=UTF-8 LANG=C.UTF-8 LC_ALL=C.UTF-8 - -RUN pip install --no-cache-dir 'opencv-python>=4.0,<4.1' Pillow retrying six torch==1.1.0 torchvision==0.3.0 && \ - if [ $py_version -eq 3 ]; then pip install --no-cache-dir fastai==1.0.39; fi diff --git a/docker/1.1.0/final/Dockerfile.cpu b/docker/1.1.0/final/Dockerfile.cpu deleted file mode 100644 index 9a9d2c06..00000000 --- a/docker/1.1.0/final/Dockerfile.cpu +++ /dev/null @@ -1,18 +0,0 @@ -ARG py_version -FROM pytorch-base:1.1.0-cpu-py$py_version - -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -# Copy workaround script for incorrect hostname -COPY lib/changehostname.c / -COPY lib/start_with_right_hostname.sh /usr/local/bin/start_with_right_hostname.sh -RUN chmod +x /usr/local/bin/start_with_right_hostname.sh - -COPY dist/sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl -RUN pip install --no-cache-dir /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl && \ - rm /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl - -ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main - -# Starts framework -ENTRYPOINT ["bash", "-m", "start_with_right_hostname.sh"] diff --git a/docker/1.1.0/final/Dockerfile.gpu b/docker/1.1.0/final/Dockerfile.gpu deleted file mode 100644 index d72e53ea..00000000 --- a/docker/1.1.0/final/Dockerfile.gpu +++ /dev/null @@ -1,18 +0,0 @@ -ARG py_version -FROM pytorch-base:1.1.0-gpu-py$py_version - -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -# Copy workaround script for incorrect hostname -COPY lib/changehostname.c / -COPY lib/start_with_right_hostname.sh /usr/local/bin/start_with_right_hostname.sh -RUN chmod +x /usr/local/bin/start_with_right_hostname.sh - -COPY dist/sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl -RUN pip install --no-cache-dir /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl && \ - rm /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl - -ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main - -# Starts framework -ENTRYPOINT ["bash", "-m", "start_with_right_hostname.sh"] diff --git a/docker/1.2.0/py2/Dockerfile.cpu b/docker/1.2.0/py2/Dockerfile.cpu deleted file mode 100644 index 346fd43e..00000000 --- a/docker/1.2.0/py2/Dockerfile.cpu +++ /dev/null @@ -1,77 +0,0 @@ -FROM ubuntu:16.04 - -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - cmake \ - curl \ - git \ - wget \ - vim \ - jq \ - libsm6 \ - libxext6 \ - libxrender-dev \ - build-essential \ - zlib1g-dev \ - libglib2.0-0 \ - libgl1-mesa-glx \ - openjdk-8-jdk-headless - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 - -# Add arguments to achieve the version, python and url -ARG PYTHON_VERSION=2.7 - -RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ - chmod +x ~/miniconda.sh && \ - ~/miniconda.sh -b -p /opt/conda && \ - rm ~/miniconda.sh && \ - /opt/conda/bin/conda update conda && \ - /opt/conda/bin/conda install -y python=$PYTHON_VERSION \ - numpy==1.16.4 \ - scipy==1.2.1 \ - ipython==5.8.0 \ - mkl==2019.4 \ - mkl-include==2019.4 \ - cython==0.29.12 \ - typing==3.7.4 && \ - /opt/conda/bin/conda clean -ya -ENV PATH /opt/conda/bin:$PATH - -ARG PYTORCH_VERSION=1.2.0 -ARG TORCHVISION_VERSION=0.4.0 -ARG MMS_VERSION=1.0.7 -RUN conda install -c conda-forge awscli==1.16.210 opencv==4.0.1 && \ - conda install -y scikit-learn==0.20.3 \ - pandas==0.24.2 \ - pillow==6.1.0 \ - h5py==2.9.0 \ - requests==2.22.0 && \ - conda install pytorch==$PYTORCH_VERSION torchvision==$TORCHVISION_VERSION cpuonly -c pytorch && \ - conda clean -ya && \ - pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org && \ - pip install mxnet-model-server==$MMS_VERSION - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY docker/$PYTORCH_VERSION/py2/mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY docker/$PYTORCH_VERSION/py2/config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -COPY dist/sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl -RUN pip install --no-cache-dir /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl && \ - rm /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl - -ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main - -EXPOSE 8080 8081 -ENV TEMP=/home/model-server/tmp -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.2.0/py2/Dockerfile.gpu b/docker/1.2.0/py2/Dockerfile.gpu deleted file mode 100644 index 165db15d..00000000 --- a/docker/1.2.0/py2/Dockerfile.gpu +++ /dev/null @@ -1,98 +0,0 @@ -FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04 -# NCCL_VERSION=2.4.7, CUDNN_VERSION=7.6.2.24 -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -RUN apt-get update && apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \ - build-essential \ - ca-certificates \ - cmake \ - libgomp1 \ - libibverbs-dev \ - curl \ - git \ - wget \ - vim \ - jq \ - libsm6 \ - libxext6 \ - libxrender-dev \ - build-essential \ - zlib1g-dev \ - libglib2.0-0 \ - libgl1-mesa-glx \ - openjdk-8-jdk-headless - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 - -# Add arguments to achieve the version, python and url -ARG PYTHON_VERSION=2.7 - -# Install OpenSSH, Allow OpenSSH to talk to containers without asking for confirmation -RUN apt-get install -y --no-install-recommends openssh-client openssh-server && \ - mkdir -p /var/run/sshd && \ - cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new && \ - echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new && \ - mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config - -RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ - chmod +x ~/miniconda.sh && \ - ~/miniconda.sh -b -p /opt/conda && \ - rm ~/miniconda.sh && \ - /opt/conda/bin/conda update conda && \ - /opt/conda/bin/conda install -y python=$PYTHON_VERSION \ - numpy==1.16.4 \ - scipy==1.2.1 \ - ipython==5.8.0 \ - mkl==2019.4 \ - mkl-include==2019.4 \ - cython==0.29.12 \ - typing==3.7.4 && \ - /opt/conda/bin/conda clean -ya -ENV PATH /opt/conda/bin:$PATH - -ARG PYTORCH_VERSION=1.2.0 -ARG TORCHVISION_VERSION=0.4.0 -ARG MMS_VERSION=1.0.7 -RUN conda install -c pytorch magma-cuda100 && \ - conda install -c conda-forge awscli==1.16.210 opencv==4.0.1 && \ - conda install -y scikit-learn==0.20.3 \ - pandas==0.24.2 \ - pillow==6.1.0 \ - h5py==2.9.0 \ - requests==2.22.0 && \ - conda install pytorch==$PYTORCH_VERSION torchvision==$TORCHVISION_VERSION cudatoolkit=10.0 -c pytorch && \ - conda clean -ya && \ - /opt/conda/bin/conda config --set ssl_verify False && \ - pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org && \ - pip install mxnet-model-server==$MMS_VERSION - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY docker/$PYTORCH_VERSION/py2/mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY docker/$PYTORCH_VERSION/py2/config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -# Install OpenSSH for MPI to communicate between containers, Allow OpenSSH to talk to containers without asking for confirmation -RUN apt-get install -y --no-install-recommends openssh-client openssh-server && \ - mkdir -p /var/run/sshd && \ - cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new && \ - echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new && \ - mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config - -# RUN pip install --no-cache-dir 'opencv-python>=4.0,<4.1' - -COPY dist/sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl -RUN pip install --no-cache-dir /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl && \ - rm /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl - -ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main - -EXPOSE 8080 8081 -ENV TEMP=/home/model-server/tmp -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.2.0/py2/config.properties b/docker/1.2.0/py2/config.properties deleted file mode 100644 index f731b819..00000000 --- a/docker/1.2.0/py2/config.properties +++ /dev/null @@ -1,26 +0,0 @@ -vmargs=-Xmx128m -XX:-UseLargePages -XX:+UseG1GC -XX:MaxMetaspaceSize=32M -XX:MaxDirectMemorySize=10m -XX:+ExitOnOutOfMemoryError -model_store=/opt/ml/model -load_models=ALL -inference_address=http://0.0.0.0:8080 -management_address=http://0.0.0.0:8081 -# management_address=unix:/tmp/management.sock -# number_of_netty_threads=0 -# netty_client_threads=0 -# default_response_timeout=120 -# default_workers_per_model=0 -# job_queue_size=100 -# async_logging=false -# number_of_gpu=1 -# cors_allowed_origin -# cors_allowed_methods -# cors_allowed_headers -# keystore=src/test/resources/keystore.p12 -# keystore_pass=changeit -# keystore_type=PKCS12 -# private_key_file=src/test/resources/key.pem -# certificate_file=src/test/resources/certs.pem -# max_response_size=6553500 -# max_request_size=6553500 -# blacklist_env_vars= -# decode_input_request=false -# enable_envvars_config=false diff --git a/docker/1.2.0/py2/mms-entrypoint.py b/docker/1.2.0/py2/mms-entrypoint.py deleted file mode 100644 index 0b24a416..00000000 --- a/docker/1.2.0/py2/mms-entrypoint.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). You -# may not use this file except in compliance with the License. A copy of -# the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF -# ANY KIND, either express or implied. See the License for the specific -# language governing permissions and limitations under the License. -from __future__ import absolute_import - -import shlex -import subprocess -import sys - -from sagemaker_pytorch_serving_container import serving - - -if sys.argv[1] == 'serve': - serving.main() -else: - subprocess.check_call(shlex.split(' '.join(sys.argv[1:]))) - -# prevent docker exit -subprocess.call(['tail', '-f', '/dev/null']) diff --git a/docker/1.2.0/py3/Dockerfile.cpu b/docker/1.2.0/py3/Dockerfile.cpu deleted file mode 100644 index fb172ce3..00000000 --- a/docker/1.2.0/py3/Dockerfile.cpu +++ /dev/null @@ -1,78 +0,0 @@ -FROM ubuntu:16.04 - -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - cmake \ - curl \ - git \ - wget \ - vim \ - jq \ - libsm6 \ - libxext6 \ - libxrender-dev \ - build-essential \ - zlib1g-dev \ - libglib2.0-0 \ - libgl1-mesa-glx \ - openjdk-8-jdk-headless - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 - -# Add arguments to achieve the version, python and url -ARG PYTHON_VERSION=3.6.6 - -RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ - chmod +x ~/miniconda.sh && \ - ~/miniconda.sh -b -p /opt/conda && \ - rm ~/miniconda.sh && \ - /opt/conda/bin/conda update conda && \ - /opt/conda/bin/conda install -y python=$PYTHON_VERSION \ - numpy==1.16.4 \ - scipy==1.3.0 \ - ipython==7.7.0 \ - mkl==2019.4 \ - mkl-include==2019.4 \ - cython==0.29.12 \ - typing==3.6.4 && \ - /opt/conda/bin/conda clean -ya -ENV PATH /opt/conda/bin:$PATH - -ARG PYTORCH_VERSION=1.2.0 -ARG TORCHVISION_VERSION=0.4.0 -ARG MMS_VERSION=1.0.7 -RUN conda install -c conda-forge awscli==1.16.210 opencv==4.0.1 && \ - conda install -y scikit-learn==0.21.2 \ - pandas==0.25.0 \ - pillow==5.4.1 \ - h5py==2.9.0 \ - requests==2.22.0 && \ - conda install pytorch==$PYTORCH_VERSION torchvision==$TORCHVISION_VERSION cpuonly -c pytorch && \ - conda clean -ya && \ - pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org && \ - ln -s /opt/conda/bin/pip /usr/local/bin/pip3 && \ - pip install mxnet-model-server==$MMS_VERSION - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY docker/$PYTORCH_VERSION/py3/mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY docker/$PYTORCH_VERSION/py3/config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -COPY dist/sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl -RUN pip install --no-cache-dir /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl && \ - rm /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl - -ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main - -EXPOSE 8080 8081 -ENV TEMP=/home/model-server/tmp -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.2.0/py3/Dockerfile.gpu b/docker/1.2.0/py3/Dockerfile.gpu deleted file mode 100644 index 79eb1d57..00000000 --- a/docker/1.2.0/py3/Dockerfile.gpu +++ /dev/null @@ -1,90 +0,0 @@ -FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04 -# NCCL_VERSION=2.4.7, CUDNN_VERSION=7.6.2.24 -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -RUN apt-get update && apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \ - build-essential \ - ca-certificates \ - cmake \ - libgomp1 \ - libibverbs-dev \ - curl \ - git \ - wget \ - vim \ - jq \ - libsm6 \ - libxext6 \ - libxrender-dev \ - build-essential \ - zlib1g-dev \ - libglib2.0-0 \ - libgl1-mesa-glx \ - openjdk-8-jdk-headless - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 - -# Add arguments to achieve the version, python and url -ARG PYTHON_VERSION=3.6.6 - -# Install OpenSSH. Allow OpenSSH to talk to containers without asking for confirmation -RUN apt-get install -y --no-install-recommends openssh-client openssh-server && \ - mkdir -p /var/run/sshd && \ - cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new && \ - echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new && \ - mv /etc/ssh/ssh_config.new /etc/ssh/ssh_configs - -RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ - chmod +x ~/miniconda.sh && \ - ~/miniconda.sh -b -p /opt/conda && \ - rm ~/miniconda.sh && \ - /opt/conda/bin/conda update conda && \ - /opt/conda/bin/conda install -y python=$PYTHON_VERSION \ - numpy==1.16.4 \ - scipy==1.3.0 \ - ipython==7.7.0 \ - mkl==2019.4 \ - mkl-include==2019.4 \ - cython==0.29.12 \ - typing==3.6.4 && \ - /opt/conda/bin/conda clean -ya -ENV PATH /opt/conda/bin:$PATH - -ARG PYTORCH_VERSION=1.2.0 -ARG TORCHVISION_VERSION=0.4.0 -ARG MMS_VERSION=1.0.7 -RUN conda install -c pytorch magma-cuda100 && \ - conda install -c conda-forge awscli==1.16.210 opencv==4.0.1 && \ - conda install -y scikit-learn==0.21.2 \ - pandas==0.25.0 \ - pillow==5.4.1 \ - h5py==2.9.0 \ - requests==2.22.0 && \ - conda install pytorch==$PYTORCH_VERSION torchvision==$TORCHVISION_VERSION cudatoolkit=10.0 -c pytorch && \ - conda clean -ya && \ - /opt/conda/bin/conda config --set ssl_verify False && \ - pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org && \ - ln -s /opt/conda/bin/pip /usr/local/bin/pip3 && \ - pip install mxnet-model-server==$MMS_VERSION - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY docker/$PYTORCH_VERSION/py3/mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY docker/$PYTORCH_VERSION/py3/config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -COPY dist/sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl -RUN pip install --no-cache-dir /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl && \ - rm /sagemaker_pytorch_serving_container-1.2-py2.py3-none-any.whl - -ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main - -EXPOSE 8080 8081 -ENV TEMP=/home/model-server/tmp -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.2.0/py3/config.properties b/docker/1.2.0/py3/config.properties deleted file mode 100644 index f731b819..00000000 --- a/docker/1.2.0/py3/config.properties +++ /dev/null @@ -1,26 +0,0 @@ -vmargs=-Xmx128m -XX:-UseLargePages -XX:+UseG1GC -XX:MaxMetaspaceSize=32M -XX:MaxDirectMemorySize=10m -XX:+ExitOnOutOfMemoryError -model_store=/opt/ml/model -load_models=ALL -inference_address=http://0.0.0.0:8080 -management_address=http://0.0.0.0:8081 -# management_address=unix:/tmp/management.sock -# number_of_netty_threads=0 -# netty_client_threads=0 -# default_response_timeout=120 -# default_workers_per_model=0 -# job_queue_size=100 -# async_logging=false -# number_of_gpu=1 -# cors_allowed_origin -# cors_allowed_methods -# cors_allowed_headers -# keystore=src/test/resources/keystore.p12 -# keystore_pass=changeit -# keystore_type=PKCS12 -# private_key_file=src/test/resources/key.pem -# certificate_file=src/test/resources/certs.pem -# max_response_size=6553500 -# max_request_size=6553500 -# blacklist_env_vars= -# decode_input_request=false -# enable_envvars_config=false diff --git a/docker/1.2.0/py3/mms-entrypoint.py b/docker/1.2.0/py3/mms-entrypoint.py deleted file mode 100644 index 0b24a416..00000000 --- a/docker/1.2.0/py3/mms-entrypoint.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). You -# may not use this file except in compliance with the License. A copy of -# the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF -# ANY KIND, either express or implied. See the License for the specific -# language governing permissions and limitations under the License. -from __future__ import absolute_import - -import shlex -import subprocess -import sys - -from sagemaker_pytorch_serving_container import serving - - -if sys.argv[1] == 'serve': - serving.main() -else: - subprocess.check_call(shlex.split(' '.join(sys.argv[1:]))) - -# prevent docker exit -subprocess.call(['tail', '-f', '/dev/null']) diff --git a/docker/1.3.1/py2/Dockerfile.cpu b/docker/1.3.1/py2/Dockerfile.cpu deleted file mode 100644 index a5091ecd..00000000 --- a/docker/1.3.1/py2/Dockerfile.cpu +++ /dev/null @@ -1,88 +0,0 @@ -FROM ubuntu:16.04 - -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -ARG PYTHON_VERSION=2.7 -ARG PYTORCH_VERSION=1.3.1 -ARG TORCHVISION_VERSION=0.4.2 -ARG MMS_VERSION=1.0.8 - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 -ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH -ENV PATH /opt/conda/bin:$PATH -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 \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - git \ - jq \ - libgl1-mesa-glx \ - libglib2.0-0 \ - libsm6 \ - libxext6 \ - libxrender-dev \ - openjdk-8-jdk-headless \ - vim \ - wget \ - zlib1g-dev - - -RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && chmod +x ~/miniconda.sh \ - && ~/miniconda.sh -b -p /opt/conda \ - && rm ~/miniconda.sh \ - && /opt/conda/bin/conda update conda \ - && /opt/conda/bin/conda install -y \ - python=$PYTHON_VERSION \ - cython==0.29.12 \ - ipython==5.8.0 \ - mkl-include==2019.4 \ - mkl==2019.4 \ - numpy==1.16.4 \ - scipy==1.2.1 \ - typing==3.7.4 \ - && /opt/conda/bin/conda clean -ya - -RUN conda install -c \ - conda-forge \ - awscli==1.16.296 \ - opencv==4.0.1 \ - && conda install -y \ - scikit-learn==0.20.3 \ - pandas==0.24.2 \ - pillow==6.2.1 \ - h5py==2.9.0 \ - requests==2.22.0 \ - && conda install \ - pytorch==$PYTORCH_VERSION \ - torchvision==$TORCHVISION_VERSION cpuonly -c pytorch \ - && conda clean -ya \ - && pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \ - && pip install mxnet-model-server==$MMS_VERSION - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -COPY 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 curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch/license.txt -o /license.txt - -EXPOSE 8080 8081 -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.3.1/py2/Dockerfile.gpu b/docker/1.3.1/py2/Dockerfile.gpu deleted file mode 100644 index 9a626a8c..00000000 --- a/docker/1.3.1/py2/Dockerfile.gpu +++ /dev/null @@ -1,113 +0,0 @@ -FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04 -# NCCL_VERSION=2.4.7, CUDNN_VERSION=7.6.2.24 -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -ARG PYTHON_VERSION=2.7 -ARG PYTORCH_VERSION=1.3.1 -ARG TORCHVISION_VERSION=0.4.2 -ARG MMS_VERSION=1.0.8 - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 -ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH -ENV PATH /opt/conda/bin:$PATH -ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main -ENV TEMP=/home/model-server/tmp - -RUN apt-get update \ - && apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \ - build-essential \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - git \ - jq \ - libgl1-mesa-glx \ - libglib2.0-0 \ - libgomp1 \ - libibverbs-dev \ - libsm6 \ - libxext6 \ - libxrender-dev \ - openjdk-8-jdk-headless \ - vim \ - wget \ - zlib1g-dev - -# Install OpenSSH, Allow OpenSSH to talk to containers without asking for confirmation -RUN apt-get install -y --no-install-recommends \ - openssh-client openssh-server \ - && mkdir -p /var/run/sshd \ - && cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new \ - && echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new \ - && mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config - -RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && chmod +x ~/miniconda.sh \ - && ~/miniconda.sh -b -p /opt/conda \ - && rm ~/miniconda.sh \ - && /opt/conda/bin/conda update conda \ - && /opt/conda/bin/conda install -y \ - python=$PYTHON_VERSION \ - cython==0.29.12 \ - ipython==5.8.0 \ - mkl-include==2019.4 \ - mkl==2019.4 \ - numpy==1.16.4 \ - scipy==1.2.1 \ - typing==3.7.4 \ - && /opt/conda/bin/conda clean -ya - - -RUN conda install -c \ - pytorch magma-cuda100 \ - && conda install -c \ - conda-forge \ - awscli==1.16.296 \ - opencv==4.0.1 \ - && conda install -y scikit-learn==0.20.3 \ - h5py==2.9.0 \ - pandas==0.24.2 \ - pillow==6.2.1 \ - requests==2.22.0 \ - && conda install -c \ - pytorch \ - cudatoolkit=10.0 \ - pytorch==$PYTORCH_VERSION \ - torchvision==$TORCHVISION_VERSION \ - && conda clean -ya \ - && /opt/conda/bin/conda config --set ssl_verify False \ - && pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \ - && pip install mxnet-model-server==$MMS_VERSION - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -# Install OpenSSH for MPI to communicate between containers, Allow OpenSSH to talk to containers without asking for confirmation -RUN apt-get install -y --no-install-recommends \ - openssh-client openssh-server \ - && mkdir -p /var/run/sshd \ - && cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new \ - && echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new \ - && mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config - -# RUN pip install --no-cache-dir 'opencv-python>=4.0,<4.1' - -COPY 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 curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch/license.txt -o /license.txt - -EXPOSE 8080 8081 -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.3.1/py3/Dockerfile.cpu b/docker/1.3.1/py3/Dockerfile.cpu deleted file mode 100644 index 47d545aa..00000000 --- a/docker/1.3.1/py3/Dockerfile.cpu +++ /dev/null @@ -1,87 +0,0 @@ -FROM ubuntu:16.04 - -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -ARG PYTHON_VERSION=3.6.6 -ARG PYTORCH_VERSION=1.3.1 -ARG TORCHVISION_VERSION=0.4.2 -ARG MMS_VERSION=1.0.8 - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 -ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH -ENV PATH /opt/conda/bin:$PATH -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 \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - git \ - jq \ - libgl1-mesa-glx \ - libglib2.0-0 \ - libsm6 \ - libxext6 \ - libxrender-dev \ - openjdk-8-jdk-headless \ - vim \ - wget \ - zlib1g-dev - -RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && chmod +x ~/miniconda.sh \ - && ~/miniconda.sh -b -p /opt/conda \ - && rm ~/miniconda.sh \ - && /opt/conda/bin/conda update conda \ - && /opt/conda/bin/conda install -y \ - python=$PYTHON_VERSION \ - cython==0.29.12 \ - ipython==7.7.0 \ - mkl-include==2019.4 \ - mkl==2019.4 \ - numpy==1.16.4 \ - scipy==1.3.0 \ - typing==3.6.4 \ - && /opt/conda/bin/conda clean -ya - -RUN conda install -c \ - conda-forge \ - awscli==1.16.296 \ - opencv==4.0.1 \ - && conda install -y \ - scikit-learn==0.21.2 \ - pandas==0.25.0 \ - pillow==6.2.1 \ - h5py==2.9.0 \ - requests==2.22.0 \ - && conda install \ - pytorch==$PYTORCH_VERSION \ - torchvision==$TORCHVISION_VERSION cpuonly -c pytorch \ - && conda clean -ya \ - && pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \ - && ln -s /opt/conda/bin/pip /usr/local/bin/pip3 \ - && pip install mxnet-model-server==$MMS_VERSION - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -COPY 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 curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch/license.txt -o /license.txt - -EXPOSE 8080 8081 -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.3.1/py3/Dockerfile.eia b/docker/1.3.1/py3/Dockerfile.eia deleted file mode 100644 index a8f7ee30..00000000 --- a/docker/1.3.1/py3/Dockerfile.eia +++ /dev/null @@ -1,110 +0,0 @@ -FROM ubuntu:16.04 -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -# Add arguments to achieve the version, python and url -ARG PYTHON_VERSION=3.6.6 -ARG PYTORCH_VERSION=1.3.1 -ARG TORCHVISION_VERSION=0.4.2 -ARG GRAPHVIZ_VERSION=0.13.2 -ARG MMS_VERSION=1.0.8 -ARG HEALTH_CHECK_VERSION=1.6.2 - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 -ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH -ENV PATH /opt/conda/bin:$PATH -ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main -ENV TEMP=/home/model-server/tmp - -RUN apt-get update \ - && apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - git \ - jq \ - libgl1-mesa-glx \ - libglib2.0-0 \ - libgomp1 \ - libibverbs-dev \ - libsm6 \ - libxext6 \ - libxrender-dev \ - openjdk-8-jdk-headless \ - vim \ - wget \ - zlib1g-dev - -# Install OpenSSH. Allow OpenSSH to talk to containers without asking for confirmation -RUN apt-get install -y --no-install-recommends \ - openssh-client \ - openssh-server \ - && mkdir -p /var/run/sshd \ - && cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new \ - && echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new \ - && mv /etc/ssh/ssh_config.new /etc/ssh/ssh_configs - -RUN curl -L -o ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && chmod +x ~/miniconda.sh \ - && ~/miniconda.sh -b -p /opt/conda \ - && rm ~/miniconda.sh \ - && /opt/conda/bin/conda update conda \ - && /opt/conda/bin/conda install -y \ - python=$PYTHON_VERSION \ - cython==0.29.12 \ - ipython==7.7.0 \ - numpy==1.16.4 \ - scipy==1.3.0 \ - typing==3.6.4 \ - && /opt/conda/bin/conda clean -ya - -RUN conda install -c \ - conda-forge \ - opencv==4.0.1 \ - && conda install -y \ - scikit-learn==0.21.2 \ - pandas==0.25.0 \ - h5py==2.9.0 \ - requests==2.22.0 \ - && conda clean -ya \ - && /opt/conda/bin/conda config --set ssl_verify False \ - && pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \ - && ln -s /opt/conda/bin/pip /usr/local/bin/pip3 \ - # Torchvision wheel must be installed first, so that PyTorch-EI framework is not overwritten. - && pip install https://download.pytorch.org/whl/cpu/torchvision-0.4.2%2Bcpu-cp36-cp36m-linux_x86_64.whl \ - && pip install https://s3.amazonaws.com/amazonei-pytorch/torch_eia-1.3.1-cp36-cp36m-manylinux1_x86_64.whl \ - && pip install graphviz==$GRAPHVIZ_VERSION \ - && pip install mxnet-model-server==$MMS_VERSION \ - && pip install pillow==7.1.0 - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -RUN pip install --no-cache-dir "sagemaker-pytorch-inference<2" - -RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch/license.txt -o /license.txt - -RUN conda install -y -c conda-forge pyyaml==5.3.1 \ - && pip install -U \ - sagemaker-containers==2.8.6 \ - awscli - -RUN wget https://amazonei-tools.s3.amazonaws.com/v${HEALTH_CHECK_VERSION}/ei_tools_${HEALTH_CHECK_VERSION}.tar.gz -O /opt/ei_tools_${HEALTH_CHECK_VERSION}.tar.gz \ - && tar -xvf /opt/ei_tools_${HEALTH_CHECK_VERSION}.tar.gz -C /opt/ \ - && rm -rf /opt/ei_tools_${HEALTH_CHECK_VERSION}.tar.gz \ - && chmod a+x /opt/ei_tools/bin/health_check \ - && mkdir -p /opt/ei_health_check/bin \ - && ln -s /opt/ei_tools/bin/health_check /opt/ei_health_check/bin/health_check \ - && ln -s /opt/ei_tools/lib /opt/ei_health_check/lib - -EXPOSE 8080 8081 -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.3.1/py3/Dockerfile.gpu b/docker/1.3.1/py3/Dockerfile.gpu deleted file mode 100644 index fd23f785..00000000 --- a/docker/1.3.1/py3/Dockerfile.gpu +++ /dev/null @@ -1,105 +0,0 @@ -FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04 -# NCCL_VERSION=2.4.7, CUDNN_VERSION=7.6.2.24 -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -# Add arguments to achieve the version, python and url -ARG PYTHON_VERSION=3.6.6 -ARG PYTORCH_VERSION=1.3.1 -ARG TORCHVISION_VERSION=0.4.2 -ARG MMS_VERSION=1.0.8 - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 -ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH -ENV PATH /opt/conda/bin:$PATH -ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main -ENV TEMP=/home/model-server/tmp - -RUN apt-get update \ - && apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - git \ - jq \ - libgl1-mesa-glx \ - libglib2.0-0 \ - libgomp1 \ - libibverbs-dev \ - libsm6 \ - libxext6 \ - libxrender-dev \ - openjdk-8-jdk-headless \ - vim \ - wget \ - zlib1g-dev - -# Install OpenSSH. Allow OpenSSH to talk to containers without asking for confirmation -RUN apt-get install -y --no-install-recommends \ - openssh-client \ - openssh-server \ - && mkdir -p /var/run/sshd \ - && cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new \ - && echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new \ - && mv /etc/ssh/ssh_config.new /etc/ssh/ssh_configs - -RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && chmod +x ~/miniconda.sh \ - && ~/miniconda.sh -b -p /opt/conda \ - && rm ~/miniconda.sh \ - && /opt/conda/bin/conda update conda \ - && /opt/conda/bin/conda install -y \ - python=$PYTHON_VERSION \ - cython==0.29.12 \ - ipython==7.7.0 \ - mkl-include==2019.4 \ - mkl==2019.4 \ - numpy==1.16.4 \ - scipy==1.3.0 \ - typing==3.6.4 \ - && /opt/conda/bin/conda clean -ya - -RUN conda install -c \ - pytorch magma-cuda100 \ - && conda install -c \ - conda-forge \ - awscli==1.16.296 \ - opencv==4.0.1 \ - && conda install -y \ - scikit-learn==0.21.2 \ - pandas==0.25.0 \ - pillow==6.2.1 \ - h5py==2.9.0 \ - requests==2.22.0 \ - && conda install -c \ - pytorch \ - pytorch==$PYTORCH_VERSION \ - torchvision==$TORCHVISION_VERSION \ - cudatoolkit=10.0 \ - && conda clean -ya \ - && /opt/conda/bin/conda config --set ssl_verify False \ - && pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \ - && ln -s /opt/conda/bin/pip /usr/local/bin/pip3 \ - && pip install mxnet-model-server==$MMS_VERSION - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -COPY 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 curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch/license.txt -o /license.txt - -EXPOSE 8080 8081 -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.4.0/py2/Dockerfile.cpu b/docker/1.4.0/py2/Dockerfile.cpu deleted file mode 100644 index b32f16a7..00000000 --- a/docker/1.4.0/py2/Dockerfile.cpu +++ /dev/null @@ -1,88 +0,0 @@ -FROM ubuntu:16.04 - -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true -LABEL com.amazonaws.sagemaker.capabilities.multi-models=true - -ARG PYTHON_VERSION=2.7 -ARG PYTORCH_VERSION=1.4.0 -ARG TORCHVISION_VERSION=0.5.0 -ARG MMS_VERSION=1.0.8 - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 -ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH -ENV PATH /opt/conda/bin:$PATH -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 \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - git \ - jq \ - libgl1-mesa-glx \ - libglib2.0-0 \ - libsm6 \ - libxext6 \ - libxrender-dev \ - openjdk-8-jdk-headless \ - vim \ - wget \ - zlib1g-dev - - -RUN curl -L -o ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && chmod +x ~/miniconda.sh \ - && ~/miniconda.sh -b -p /opt/conda \ - && rm ~/miniconda.sh \ - && /opt/conda/bin/conda update conda \ - && /opt/conda/bin/conda install -y \ - python=$PYTHON_VERSION \ - cython==0.29.12 \ - ipython==5.8.0 \ - mkl-include==2019.4 \ - mkl==2019.4 \ - numpy==1.16.4 \ - scipy==1.2.1 \ - typing==3.7.4 \ - && /opt/conda/bin/conda clean -ya - -RUN conda install -c \ - conda-forge \ - awscli==1.18.23 \ - opencv==4.0.1 \ - && conda install -y \ - scikit-learn==0.20.3 \ - pandas==0.24.2 \ - h5py==2.9.0 \ - requests==2.22.0 \ - && conda install \ - pytorch==$PYTORCH_VERSION \ - torchvision==$TORCHVISION_VERSION cpuonly -c pytorch \ - && conda clean -ya \ - && pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \ - && pip install mxnet-model-server==$MMS_VERSION - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -RUN pip install --no-cache-dir "sagemaker-pytorch-inference<2" - -RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch-1.4.0/license.txt -o /license.txt - -RUN conda install -y -c conda-forge pyyaml==5.3.1 -RUN pip install sagemaker-containers==2.8.6 pillow==6.2.2 urllib3==1.25.8 awscli==1.18.35 - -EXPOSE 8080 8081 -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.4.0/py2/Dockerfile.gpu b/docker/1.4.0/py2/Dockerfile.gpu deleted file mode 100644 index ae657d77..00000000 --- a/docker/1.4.0/py2/Dockerfile.gpu +++ /dev/null @@ -1,112 +0,0 @@ -FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04 -# NCCL_VERSION=2.4.7, CUDNN_VERSION=7.6.2.24 -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -ARG PYTHON_VERSION=2.7 -ARG PYTORCH_VERSION=1.4.0 -ARG TORCHVISION_VERSION=0.5.0 -ARG MMS_VERSION=1.0.8 - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 -ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH -ENV PATH /opt/conda/bin:$PATH -ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main -ENV TEMP=/home/model-server/tmp - -RUN apt-get update \ - && apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \ - build-essential \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - git \ - jq \ - libgl1-mesa-glx \ - libglib2.0-0 \ - libgomp1 \ - libibverbs-dev \ - libsm6 \ - libxext6 \ - libxrender-dev \ - openjdk-8-jdk-headless \ - vim \ - wget \ - zlib1g-dev - -# Install OpenSSH, Allow OpenSSH to talk to containers without asking for confirmation -RUN apt-get install -y --no-install-recommends \ - openssh-client openssh-server \ - && mkdir -p /var/run/sshd \ - && cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new \ - && echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new \ - && mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config - -RUN curl -L -o ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && chmod +x ~/miniconda.sh \ - && ~/miniconda.sh -b -p /opt/conda \ - && rm ~/miniconda.sh \ - && /opt/conda/bin/conda update conda \ - && /opt/conda/bin/conda install -y \ - python=$PYTHON_VERSION \ - cython==0.29.12 \ - ipython==5.8.0 \ - mkl-include==2019.4 \ - mkl==2019.4 \ - numpy==1.16.4 \ - scipy==1.2.1 \ - typing==3.7.4 \ - && /opt/conda/bin/conda clean -ya - - -RUN conda install -c \ - pytorch magma-cuda101==2.5.1 \ - && conda install -c \ - conda-forge \ - awscli==1.18.23 \ - opencv==4.0.1 \ - && conda install -y scikit-learn==0.20.3 \ - h5py==2.9.0 \ - pandas==0.24.2 \ - requests==2.22.0 \ - && conda install -c \ - pytorch \ - cudatoolkit=10.1 \ - pytorch==$PYTORCH_VERSION \ - torchvision==$TORCHVISION_VERSION \ - && conda clean -ya \ - && /opt/conda/bin/conda config --set ssl_verify False \ - && pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \ - && pip install mxnet-model-server==$MMS_VERSION - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -# Install OpenSSH for MPI to communicate between containers, Allow OpenSSH to talk to containers without asking for confirmation -RUN apt-get install -y --no-install-recommends \ - openssh-client openssh-server \ - && mkdir -p /var/run/sshd \ - && cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new \ - && echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new \ - && mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config - -# RUN pip install --no-cache-dir 'opencv-python>=4.0,<4.1' - -RUN pip install --no-cache-dir "sagemaker-pytorch-inference<2" - -RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch-1.4.0/license.txt -o /license.txt - -RUN conda install -y -c conda-forge pyyaml==5.3.1 -RUN pip install sagemaker-containers==2.8.6 pillow==6.2.2 urllib3==1.25.8 awscli==1.18.35 - -EXPOSE 8080 8081 -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.4.0/py3/Dockerfile.cpu b/docker/1.4.0/py3/Dockerfile.cpu deleted file mode 100644 index 9f211367..00000000 --- a/docker/1.4.0/py3/Dockerfile.cpu +++ /dev/null @@ -1,87 +0,0 @@ -FROM ubuntu:16.04 - -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true -LABEL com.amazonaws.sagemaker.capabilities.multi-models=true - -ARG PYTHON_VERSION=3.6.6 -ARG PYTORCH_VERSION=1.4.0 -ARG TORCHVISION_VERSION=0.5.0 -ARG MMS_VERSION=1.0.8 - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 -ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH -ENV PATH /opt/conda/bin:$PATH -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 \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - git \ - jq \ - libgl1-mesa-glx \ - libglib2.0-0 \ - libsm6 \ - libxext6 \ - libxrender-dev \ - openjdk-8-jdk-headless \ - vim \ - wget \ - zlib1g-dev - -RUN curl -L -o ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && chmod +x ~/miniconda.sh \ - && ~/miniconda.sh -b -p /opt/conda \ - && rm ~/miniconda.sh \ - && /opt/conda/bin/conda update conda \ - && /opt/conda/bin/conda install -y \ - python=$PYTHON_VERSION \ - cython==0.29.12 \ - ipython==7.7.0 \ - mkl-include==2019.4 \ - mkl==2019.4 \ - numpy==1.16.4 \ - scipy==1.3.0 \ - typing==3.6.4 \ - && /opt/conda/bin/conda clean -ya - -RUN conda install -c \ - conda-forge \ - awscli==1.18.23 \ - opencv==4.0.1 \ - && conda install -y \ - scikit-learn==0.21.2 \ - pandas==0.25.0 \ - h5py==2.9.0 \ - requests==2.22.0 \ - && conda install \ - pytorch==$PYTORCH_VERSION \ - torchvision==$TORCHVISION_VERSION cpuonly -c pytorch \ - && conda clean -ya \ - && pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \ - && ln -s /opt/conda/bin/pip /usr/local/bin/pip3 \ - && pip install mxnet-model-server==$MMS_VERSION - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -RUN pip install --no-cache-dir "sagemaker-pytorch-inference<2" - -RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch-1.4.0/license.txt -o /license.txt - -RUN conda install -y -c conda-forge pyyaml==5.3.1 -RUN pip install sagemaker-containers==2.8.6 pillow==7.1.0 awscli==1.18.35 - -EXPOSE 8080 8081 -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.4.0/py3/Dockerfile.gpu b/docker/1.4.0/py3/Dockerfile.gpu deleted file mode 100644 index 1a4e5cd8..00000000 --- a/docker/1.4.0/py3/Dockerfile.gpu +++ /dev/null @@ -1,104 +0,0 @@ -FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04 -# NCCL_VERSION=2.4.7, CUDNN_VERSION=7.6.2.24 -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -# Add arguments to achieve the version, python and url -ARG PYTHON_VERSION=3.6.6 -ARG PYTORCH_VERSION=1.4.0 -ARG TORCHVISION_VERSION=0.5.0 -ARG MMS_VERSION=1.0.8 - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 -ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH -ENV PATH /opt/conda/bin:$PATH -ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main -ENV TEMP=/home/model-server/tmp - -RUN apt-get update \ - && apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - git \ - jq \ - libgl1-mesa-glx \ - libglib2.0-0 \ - libgomp1 \ - libibverbs-dev \ - libsm6 \ - libxext6 \ - libxrender-dev \ - openjdk-8-jdk-headless \ - vim \ - wget \ - zlib1g-dev - -# Install OpenSSH. Allow OpenSSH to talk to containers without asking for confirmation -RUN apt-get install -y --no-install-recommends \ - openssh-client \ - openssh-server \ - && mkdir -p /var/run/sshd \ - && cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new \ - && echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new \ - && mv /etc/ssh/ssh_config.new /etc/ssh/ssh_configs - -RUN curl -L -o ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && chmod +x ~/miniconda.sh \ - && ~/miniconda.sh -b -p /opt/conda \ - && rm ~/miniconda.sh \ - && /opt/conda/bin/conda update conda \ - && /opt/conda/bin/conda install -y \ - python=$PYTHON_VERSION \ - cython==0.29.12 \ - ipython==7.7.0 \ - mkl-include==2019.4 \ - mkl==2019.4 \ - numpy==1.16.4 \ - scipy==1.3.0 \ - typing==3.6.4 \ - && /opt/conda/bin/conda clean -ya - -RUN conda install -c \ - pytorch magma-cuda101==2.5.1 \ - && conda install -c \ - conda-forge \ - awscli==1.18.23 \ - opencv==4.0.1 \ - && conda install -y \ - scikit-learn==0.21.2 \ - pandas==0.25.0 \ - h5py==2.9.0 \ - requests==2.22.0 \ - && conda install -c \ - pytorch \ - pytorch==$PYTORCH_VERSION \ - torchvision==$TORCHVISION_VERSION \ - cudatoolkit=10.1 \ - && conda clean -ya \ - && /opt/conda/bin/conda config --set ssl_verify False \ - && pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \ - && ln -s /opt/conda/bin/pip /usr/local/bin/pip3 \ - && pip install mxnet-model-server==$MMS_VERSION - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -RUN pip install --no-cache-dir "sagemaker-pytorch-inference<2" - -RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch-1.4.0/license.txt -o /license.txt - -RUN conda install -y -c conda-forge pyyaml==5.3.1 -RUN pip install sagemaker-containers==2.8.6 pillow==7.1.0 awscli==1.18.35 - -EXPOSE 8080 8081 -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.5.0/py3/Dockerfile.cpu b/docker/1.5.0/py3/Dockerfile.cpu deleted file mode 100644 index 2c13e9eb..00000000 --- a/docker/1.5.0/py3/Dockerfile.cpu +++ /dev/null @@ -1,88 +0,0 @@ -FROM ubuntu:16.04 - -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true -LABEL com.amazonaws.sagemaker.capabilities.multi-models=true - -ARG PYTHON_VERSION=3.6.6 -ARG PYTORCH_VERSION=1.5.0 -ARG TORCHVISION_VERSION=0.6.0 -ARG MMS_VERSION=1.0.8 - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 -ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH -ENV PATH /opt/conda/bin:$PATH -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 \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - git \ - jq \ - libgl1-mesa-glx \ - libglib2.0-0 \ - libsm6 \ - libxext6 \ - libxrender-dev \ - openjdk-8-jdk-headless \ - vim \ - wget \ - zlib1g-dev - -RUN curl -L -o ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && chmod +x ~/miniconda.sh \ - && ~/miniconda.sh -b -p /opt/conda \ - && rm ~/miniconda.sh \ - && /opt/conda/bin/conda update conda \ - && /opt/conda/bin/conda install -y \ - python=$PYTHON_VERSION \ - cython==0.29.12 \ - ipython==7.7.0 \ - mkl-include==2019.4 \ - mkl==2019.4 \ - numpy==1.16.4 \ - scipy==1.3.0 \ - typing==3.6.4 \ - && /opt/conda/bin/conda clean -ya - -RUN conda install -c \ - conda-forge \ - opencv==4.0.1 \ - && conda install -y \ - scikit-learn==0.21.2 \ - pandas==0.25.0 \ - h5py==2.9.0 \ - requests==2.22.0 \ - && conda clean -ya \ - && pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \ - && ln -s /opt/conda/bin/pip /usr/local/bin/pip3 \ - && pip install mxnet-model-server==$MMS_VERSION - - # Uninstall and re-install torch and torchvision from the PyTorch website -RUN pip uninstall -y torch \ - && pip uninstall -y torchvision \ - && pip install torch==$PYTORCH_VERSION+cpu torchvision==$TORCHVISION_VERSION+cpu -f https://download.pytorch.org/whl/torch_stable.html - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -RUN pip install --no-cache-dir "sagemaker-pytorch-inference<2" - -RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch-1.5.0/license.txt -o /license.txt - -RUN conda install -y -c conda-forge pyyaml==5.3.1 -RUN pip install sagemaker-containers==2.8.6 pillow==7.1.0 awscli - -EXPOSE 8080 8081 -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/1.5.0/py3/Dockerfile.gpu b/docker/1.5.0/py3/Dockerfile.gpu deleted file mode 100644 index 403660f0..00000000 --- a/docker/1.5.0/py3/Dockerfile.gpu +++ /dev/null @@ -1,103 +0,0 @@ -FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04 -# NCCL_VERSION=2.4.7, CUDNN_VERSION=7.6.2.24 -LABEL maintainer="Amazon AI" -LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true - -# Add arguments to achieve the version, python and url -ARG PYTHON_VERSION=3.6.6 -ARG PYTORCH_VERSION=1.5.0 -ARG TORCHVISION_VERSION=0.6.0 -ARG MMS_VERSION=1.0.8 - -# See http://bugs.python.org/issue19846 -ENV LANG C.UTF-8 -ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH -ENV PATH /opt/conda/bin:$PATH -ENV SAGEMAKER_SERVING_MODULE sagemaker_pytorch_serving_container.serving:main -ENV TEMP=/home/model-server/tmp - -RUN apt-get update \ - && apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \ - build-essential \ - ca-certificates \ - cmake \ - curl \ - git \ - jq \ - libgl1-mesa-glx \ - libglib2.0-0 \ - libgomp1 \ - libibverbs-dev \ - libsm6 \ - libxext6 \ - libxrender-dev \ - openjdk-8-jdk-headless \ - vim \ - wget \ - zlib1g-dev - -# Install OpenSSH. Allow OpenSSH to talk to containers without asking for confirmation -RUN apt-get install -y --no-install-recommends \ - openssh-client \ - openssh-server \ - && mkdir -p /var/run/sshd \ - && cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new \ - && echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new \ - && mv /etc/ssh/ssh_config.new /etc/ssh/ssh_configs - -RUN curl -L -o ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && chmod +x ~/miniconda.sh \ - && ~/miniconda.sh -b -p /opt/conda \ - && rm ~/miniconda.sh \ - && /opt/conda/bin/conda update conda \ - && /opt/conda/bin/conda install -y \ - python=$PYTHON_VERSION \ - cython==0.29.12 \ - ipython==7.7.0 \ - mkl-include==2019.4 \ - mkl==2019.4 \ - numpy==1.16.4 \ - scipy==1.3.0 \ - typing==3.6.4 \ - && /opt/conda/bin/conda clean -ya - -RUN conda install -c \ - pytorch magma-cuda101 \ - && conda install -c \ - conda-forge \ - opencv==4.0.1 \ - && conda install -y \ - scikit-learn==0.21.2 \ - pandas==0.25.0 \ - h5py==2.9.0 \ - requests==2.22.0 \ - && conda clean -ya \ - && /opt/conda/bin/conda config --set ssl_verify False \ - && pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \ - && ln -s /opt/conda/bin/pip /usr/local/bin/pip3 \ - && pip install mxnet-model-server==$MMS_VERSION - -# Uninstall and re-install torch and torchvision from the PyTorch website -RUN pip uninstall -y torch \ - && pip uninstall -y torchvision \ - && pip install torch==$PYTORCH_VERSION+cu101 torchvision==$TORCHVISION_VERSION+cu101 -f https://download.pytorch.org/whl/torch_stable.html - -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp \ - && chown -R model-server /home/model-server - -COPY mms-entrypoint.py /usr/local/bin/dockerd-entrypoint.py -COPY config.properties /home/model-server - -RUN chmod +x /usr/local/bin/dockerd-entrypoint.py - -RUN pip install --no-cache-dir "sagemaker-pytorch-inference<2" - -RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch-1.5.0/license.txt -o /license.txt - -RUN conda install -y -c conda-forge pyyaml==5.3.1 -RUN pip install sagemaker-containers==2.8.6 pillow==7.1.0 awscli - -EXPOSE 8080 8081 -ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"] -CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 00000000..a1b7357c --- /dev/null +++ b/docker/README.md @@ -0,0 +1 @@ +In order to make changes to the docker files, please, use [https://github.com/aws/deep-learning-containers](https://github.com/aws/deep-learning-containers) repository. diff --git a/docker/build_artifacts/changehostname.c b/docker/build_artifacts/changehostname.c deleted file mode 100644 index 1ae5ee1a..00000000 --- a/docker/build_artifacts/changehostname.c +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include - -/* - * Modifies gethostname to return algo-1, algo-2, etc. when running on SageMaker. - * - * Without this gethostname() on SageMaker returns 'aws', leading NCCL/MPI to think there is only one host, - * not realizing that it needs to use NET/Socket. - * - * When docker container starts we read 'current_host' value from /opt/ml/input/config/resourceconfig.json - * and replace PLACEHOLDER_HOSTNAME with it before compiling this code into a shared library. - */ -int gethostname(char *name, size_t len) -{ - const char *val = PLACEHOLDER_HOSTNAME; - strncpy(name, val, len); - return 0; -} diff --git a/docker/build_artifacts/config.properties b/docker/build_artifacts/config.properties deleted file mode 100644 index f731b819..00000000 --- a/docker/build_artifacts/config.properties +++ /dev/null @@ -1,26 +0,0 @@ -vmargs=-Xmx128m -XX:-UseLargePages -XX:+UseG1GC -XX:MaxMetaspaceSize=32M -XX:MaxDirectMemorySize=10m -XX:+ExitOnOutOfMemoryError -model_store=/opt/ml/model -load_models=ALL -inference_address=http://0.0.0.0:8080 -management_address=http://0.0.0.0:8081 -# management_address=unix:/tmp/management.sock -# number_of_netty_threads=0 -# netty_client_threads=0 -# default_response_timeout=120 -# default_workers_per_model=0 -# job_queue_size=100 -# async_logging=false -# number_of_gpu=1 -# cors_allowed_origin -# cors_allowed_methods -# cors_allowed_headers -# keystore=src/test/resources/keystore.p12 -# keystore_pass=changeit -# keystore_type=PKCS12 -# private_key_file=src/test/resources/key.pem -# certificate_file=src/test/resources/certs.pem -# max_response_size=6553500 -# max_request_size=6553500 -# blacklist_env_vars= -# decode_input_request=false -# enable_envvars_config=false diff --git a/docker/build_artifacts/mms-entrypoint.py b/docker/build_artifacts/mms-entrypoint.py deleted file mode 100644 index 40254f09..00000000 --- a/docker/build_artifacts/mms-entrypoint.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). You -# may not use this file except in compliance with the License. A copy of -# the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF -# ANY KIND, either express or implied. See the License for the specific -# language governing permissions and limitations under the License. -from __future__ import absolute_import - -import shlex -import subprocess -import sys - - -if sys.argv[1] == 'serve': - from sagemaker_pytorch_serving_container import serving - serving.main() -else: - subprocess.check_call(shlex.split(' '.join(sys.argv[1:]))) - -# prevent docker exit -subprocess.call(['tail', '-f', '/dev/null']) diff --git a/docker/build_artifacts/start_with_right_hostname.sh b/docker/build_artifacts/start_with_right_hostname.sh deleted file mode 100644 index 662cb15b..00000000 --- a/docker/build_artifacts/start_with_right_hostname.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -if [ $1 == 'train' ] -then - CURRENT_HOST=$(jq .current_host /opt/ml/input/config/resourceconfig.json) - - sed -ie "s/PLACEHOLDER_HOSTNAME/$CURRENT_HOST/g" changehostname.c - - gcc -o changehostname.o -c -fPIC -Wall changehostname.c - gcc -o libchangehostname.so -shared -export-dynamic changehostname.o -ldl - - LD_PRELOAD=/libchangehostname.so train -else - serve -fi