|
ARG PYTORCH="1.9.0" |
|
ARG CUDA="11.1" |
|
ARG CUDNN="8" |
|
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel |
|
|
|
ARG MMCV="2.0.0rc4" |
|
ARG MMDET="3.3.0" |
|
ARG MMDET3D="1.4.0" |
|
|
|
ENV PYTHONUNBUFFERED TRUE |
|
|
|
|
|
|
|
RUN rm /etc/apt/sources.list.d/cuda.list \ |
|
&& rm /etc/apt/sources.list.d/nvidia-ml.list \ |
|
&& apt-key del 7fa2af80 \ |
|
&& apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub \ |
|
&& apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub |
|
|
|
|
|
|
|
|
|
|
|
RUN apt-get update && \ |
|
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ |
|
ca-certificates \ |
|
g++ \ |
|
openjdk-11-jre-headless \ |
|
|
|
ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
ENV PATH="/opt/conda/bin:$PATH" \ |
|
FORCE_CUDA="1" |
|
|
|
|
|
RUN pip install torchserve torch-model-archiver |
|
|
|
|
|
ARG PYTORCH |
|
ARG CUDA |
|
RUN pip install openmim |
|
RUN mim install mmengine |
|
RUN mim install mmcv==${MMCV} |
|
RUN mim install mmdet==${MMDET} |
|
RUN mim install mmdet3d==${MMDET3D} |
|
|
|
RUN useradd -m model-server \ |
|
&& mkdir -p /home/model-server/tmp |
|
|
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh |
|
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh \ |
|
&& chown -R model-server /home/model-server |
|
|
|
COPY config.properties /home/model-server/config.properties |
|
RUN mkdir /home/model-server/model-store && chown -R model-server /home/model-server/model-store |
|
|
|
EXPOSE 8080 8081 8082 |
|
|
|
USER model-server |
|
WORKDIR /home/model-server |
|
ENV TEMP=/home/model-server/tmp |
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
|
CMD ["serve"] |
|
|