Dockerfile.2204cu101 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 as builder
  2. ENV DEBIAN_FRONTEND=noninteractive
  3. RUN apt-get update; apt-get install -y git curl
  4. RUN curl https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-Linux-x86_64.sh -o /tmp/Miniconda3-py38_4.12.0-Linux-x86_64.sh && bash /tmp/Miniconda3-py38_4.12.0-Linux-x86_64.sh -b -p /opt/miniconda
  5. RUN apt-get install -y libboost-dev libre2-dev rapidjson-dev libnuma-dev libssl-dev libb64-dev libarchive-dev libzip-dev
  6. RUN cd /tmp && git clone https://github.com/triton-inference-server/server.git -b r22.04 --recursive
  7. RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3-linux-x86_64.tar.gz | tar -xz -C /tmp
  8. ENV PATH=$PATH:/tmp/cmake-3.24.3-linux-x86_64/bin:/opt/miniconda/bin/
  9. RUN cd /tmp/server && python build.py --build-dir=/tmp/build --enable-gpu --no-container-source --no-container-build --enable-logging --endpoint=http --endpoint=grpc
  10. RUN cd /tmp && git clone https://github.com/microsoft/onnxruntime.git -b rel-1.10.0 --recursive
  11. ENV CUDA_VERSION=10.1
  12. RUN cd /tmp/onnxruntime && ./build.sh --config Release --build_shared_lib --parallel --skip_tests --skip_onnx_tests --use_cuda --cuda_version=$CUDA_VERSION --cuda_home=/usr/local/cuda-$CUDA_VERSION --cudnn_home=/usr/local/cuda-$CUDA_VERSION --cmake_extra_defines 'CMAKE_CUDA_ARCHITECTURES=61;70'
  13. RUN cd /tmp/onnxruntime/build/Linux/Release/ && make install
  14. RUN cd /tmp && git clone https://github.com/triton-inference-server/onnxruntime_backend.git -b r22.04 --recursive
  15. RUN cd /tmp/onnxruntime_backend && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install -DTRITON_ENABLE_GPU=ON -DTRITON_BUILD_CONTAINER_VERSION=22.04 -DTRITON_ONNXRUNTIME_DOCKER_BUILD=OFF -DTRITON_ONNXRUNTIME_LIB_PATHS=/usr/local/lib/ -DTRITON_BUILD_ONNXRUNTIME_VERSION=1.10.0 -DTRITON_BACKEND_REPO_TAG=r22.04 -DTRITON_CORE_REPO_TAG=r22.04 -DTRITON_COMMON_REPO_TAG=r22.04 ..
  16. ENV C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/include/onnxruntime/core/session
  17. ENV CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/include/onnxruntime/core/session
  18. RUN cd /tmp/onnxruntime_backend/build && make -j && make install
  19. RUN cd /tmp && git clone https://github.com/triton-inference-server/python_backend.git -b r22.04 --recursive
  20. RUN cd /tmp/python_backend && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install -DTRITON_ENABLE_GPU=OFF -DTRITON_BUILD_CONTAINER_VERSION=22.04 -DTRITON_BACKEND_REPO_TAG=r22.04 -DTRITON_CORE_REPO_TAG=r22.04 -DTRITON_COMMON_REPO_TAG=r22.04 ..
  21. RUN cd /tmp/python_backend/build && make -j && make install
  22. RUN cp -r /tmp/build/tritonserver/install /opt/tritonserver && cp -r /tmp/python_backend/build/install/backends /opt/tritonserver && cp -r /tmp/onnxruntime_backend/build/install/backends/onnxruntime /opt/tritonserver/backends
  23. RUN cp /usr/local/lib/libonnxruntime* /opt/tritonserver/backends/onnxruntime
  24. FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04
  25. COPY --from=builder /opt /opt
  26. RUN apt-get update; apt-get install -y --no-install-recommends libre2-4 rapidjson-dev libnuma1 libssl1.1 libb64-0d libarchive13 libicu60 liblzo2-2 libxml2 libzip4 curl
  27. ENV PATH=$PATH:/opt/tritonserver/bin
  28. EXPOSE 8000
  29. EXPOSE 8001