|
@@ -0,0 +1,128 @@
|
|
|
+##############################################################################
|
|
|
+#
|
|
|
+# HPCC SYSTEMS software Copyright (C) 2020 HPCC Systems®.
|
|
|
+#
|
|
|
+# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
+# you may not use this file except in compliance with the License.
|
|
|
+# You may obtain a copy of the License at
|
|
|
+#
|
|
|
+# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
+#
|
|
|
+# Unless required by applicable law or agreed to in writing, software
|
|
|
+# distributed under the License 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.
|
|
|
+##############################################################################
|
|
|
+
|
|
|
+# Create base container image to be used by all HPCC processes
|
|
|
+# MORE - some of these dependencies are probably not needed by all derived containers - perhaps we should move them
|
|
|
+# Others may not be wanted at all in container mode - tensoflow and nvidia example??
|
|
|
+
|
|
|
+ARG BUILD_LABEL
|
|
|
+FROM hpccsystems/platform-core:${BUILD_LABEL}
|
|
|
+USER root
|
|
|
+
|
|
|
+
|
|
|
+# nvidia/cuda bsae
|
|
|
+RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
+gnupg2 curl ca-certificates && \
|
|
|
+ curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | apt-key add - && \
|
|
|
+ echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \
|
|
|
+ echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list && \
|
|
|
+ apt-get purge --autoremove -y curl && \
|
|
|
+rm -rf /var/lib/apt/lists/*
|
|
|
+
|
|
|
+ENV CUDA_VERSION 10.1.243
|
|
|
+
|
|
|
+ENV CUDA_PKG_VERSION 10-1=$CUDA_VERSION-1
|
|
|
+
|
|
|
+# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
|
|
|
+RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
+ cuda-cudart-$CUDA_PKG_VERSION \
|
|
|
+cuda-compat-10-1 && \
|
|
|
+ln -s cuda-10.1 /usr/local/cuda && \
|
|
|
+ rm -rf /var/lib/apt/lists/*
|
|
|
+
|
|
|
+# Required for nvidia-docker v1
|
|
|
+RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
|
|
|
+ echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf
|
|
|
+
|
|
|
+RUN apt clean && \
|
|
|
+ apt autoclean && \
|
|
|
+ apt install -f && \
|
|
|
+ apt autoremove && \
|
|
|
+ apt-get update
|
|
|
+
|
|
|
+RUN apt-get install -y python3-pip --fix-missing
|
|
|
+RUN python3 -m pip install --upgrade pip
|
|
|
+
|
|
|
+RUN pip3 install \
|
|
|
+ scikit-learn \
|
|
|
+ statsmodels \
|
|
|
+ networkx
|
|
|
+
|
|
|
+# TensorFlow with GPU support
|
|
|
+# Reference: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/dockerfiles/dockerfiles/gpu.Dockerfile
|
|
|
+
|
|
|
+ARG CUDA=10.1
|
|
|
+ARG CUDNN=7.6.4.38-1
|
|
|
+ARG CUDNN_MAJOR_VERSION=7
|
|
|
+ARG LIB_DIR_PREFIX=x86_64
|
|
|
+ARG LIBNVINFER=6.0.1-1
|
|
|
+ARG LIBNVINFER_MAJOR_VERSION=6
|
|
|
+
|
|
|
+# Needed for string substitution
|
|
|
+SHELL ["/bin/bash", "-c"]
|
|
|
+# Pick up some TF dependencies
|
|
|
+RUN apt-get update -y && apt-get install -y --no-install-recommends \
|
|
|
+ build-essential \
|
|
|
+ cuda-command-line-tools-${CUDA/./-} \
|
|
|
+ # There appears to be a regression in libcublas10=10.2.2.89-1 which
|
|
|
+ # prevents cublas from initializing in TF. See
|
|
|
+ # https://github.com/tensorflow/tensorflow/issues/9489#issuecomment-562394257
|
|
|
+ libcublas10=10.2.1.243-1 \
|
|
|
+ cuda-nvrtc-${CUDA/./-} \
|
|
|
+ cuda-cufft-${CUDA/./-} \
|
|
|
+ cuda-curand-${CUDA/./-} \
|
|
|
+ cuda-cusolver-${CUDA/./-} \
|
|
|
+ cuda-cusparse-${CUDA/./-} \
|
|
|
+ curl \
|
|
|
+ libcudnn7=${CUDNN}+cuda${CUDA} \
|
|
|
+ libfreetype6-dev \
|
|
|
+ libhdf5-serial-dev \
|
|
|
+ libzmq3-dev \
|
|
|
+ pkg-config \
|
|
|
+ software-properties-common \
|
|
|
+ unzip
|
|
|
+
|
|
|
+# For CUDA profiling, TensorFlow requires CUPTI.
|
|
|
+ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
|
|
|
+
|
|
|
+# Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
|
|
|
+# dynamic linker run-time bindings
|
|
|
+RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \
|
|
|
+ && echo "/usr/local/cuda/lib64/stubs" > /etc/ld.so.conf.d/z-cuda-stubs.conf \
|
|
|
+ && ldconfig
|
|
|
+
|
|
|
+# See http://bugs.python.org/issue19846
|
|
|
+ENV LANG C.UTF-8
|
|
|
+
|
|
|
+RUN python3 -m pip --no-cache-dir install --upgrade \
|
|
|
+ setuptools
|
|
|
+
|
|
|
+# Some TF tools expect a "python" binary
|
|
|
+RUN ln -s $(which python3) /usr/local/bin/python
|
|
|
+
|
|
|
+# Options:
|
|
|
+# tensorflow
|
|
|
+# tensorflow-gpu
|
|
|
+# tf-nightly
|
|
|
+# tf-nightly-gpu
|
|
|
+# Set --build-arg TF_PACKAGE_VERSION=1.11.0rc0 to install a specific version.
|
|
|
+# Installs the latest version by default.
|
|
|
+ARG TF_PACKAGE=tensorflow
|
|
|
+ARG TF_PACKAGE_VERSION=
|
|
|
+RUN python3 -m pip install --no-cache-dir ${TF_PACKAGE}${TF_PACKAGE_VERSION:+==${TF_PACKAGE_VERSION}}
|
|
|
+
|
|
|
+USER hpcc
|