# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. FROM mcr.microsoft.com/azureml/o16n-base/python-assets@sha256:20ba3085141845301907d7ce6e9ee8388a0e43074f56c262d6de7efebf2ba98f AS inferencing-assets # Tag: cuda:10.0-cudnn7-devel-ubuntu18.04 # Env: CUDA_VERSION=10.0.130 # Env: CUDA_PKG_VERSION=10-0=10.0.130-1 # Env: NCCL_VERSION=2.4.8 # Env: CUDNN_VERSION=7.6.3.30 # Env: NVIDIA_VISIBLE_DEVICES=all # Env: NVIDIA_DRIVER_CAPABILITIES=compute,utility # Env: NVIDIA_REQUIRE_CUDA=cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411 # Label: com.nvidia.cuda.version=10.0.130 # Label: com.nvidia.cudnn.version=7.6.3.30 # Label: com.nvidia.volumes.needed=nvidia_driver # Ubuntu 18.04 FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 USER root:root ENV com.nvidia.cuda.version $CUDA_VERSION ENV com.nvidia.volumes.needed nvidia_driver ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 ENV DEBIAN_FRONTEND noninteractive ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64 ENV NCCL_DEBUG=INFO ENV HOROVOD_GPU_ALLREDUCE=NCCL # Inference COPY --from=inferencing-assets /artifacts /var/ # Install Common Dependencies RUN apt-get update && \ apt-get install -y --no-install-recommends \ # SSH and RDMA libmlx4-1 \ libmlx5-1 \ librdmacm1 \ libibverbs1 \ libmthca1 \ libdapl2 \ dapl2-utils \ openssh-client \ openssh-server \ iproute2 && \ # Others apt-get install -y \ build-essential \ bzip2=1.0.6-8.1ubuntu0.2 \ libbz2-1.0=1.0.6-8.1ubuntu0.2 \ systemd \ git=1:2.17.1-1ubuntu0.4 \ wget \ cpio \ libsm6 \ libxext6 \ libxrender-dev \ fuse && \ apt-get clean -y && \ rm -rf /var/lib/apt/lists/* # Inference # Copy logging utilities, nginx and rsyslog configuration files, IOT server binary, etc. COPY --from=inferencing-assets /artifacts /var/ RUN /var/requirements/install_system_requirements.sh && \ cp /var/configuration/rsyslog.conf /etc/rsyslog.conf && \ cp /var/configuration/nginx.conf /etc/nginx/sites-available/app && \ ln -s /etc/nginx/sites-available/app /etc/nginx/sites-enabled/app && \ rm -f /etc/nginx/sites-enabled/default ENV SVDIR=/var/runit ENV WORKER_TIMEOUT=300 EXPOSE 5001 8883 8888 # Conda Environment ENV MINICONDA_VERSION 4.5.11 ENV PATH /opt/miniconda/bin:$PATH RUN wget -qO /tmp/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh && \ bash /tmp/miniconda.sh -bf -p /opt/miniconda && \ conda clean -ay && \ rm -rf /opt/miniconda/pkgs && \ rm /tmp/miniconda.sh && \ find / -type d -name __pycache__ | xargs rm -rf # Open-MPI installation ENV OPENMPI_VERSION 3.1.2 RUN mkdir /tmp/openmpi && \ cd /tmp/openmpi && \ wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-${OPENMPI_VERSION}.tar.gz && \ tar zxf openmpi-${OPENMPI_VERSION}.tar.gz && \ cd openmpi-${OPENMPI_VERSION} && \ ./configure --enable-orterun-prefix-by-default && \ make -j $(nproc) all && \ make install && \ ldconfig && \ rm -rf /tmp/openmpi