diff --git a/stacks/dlrs/mkl/Dockerfile b/stacks/dlrs/mkl/Dockerfile index 185afd8..000af05 100644 --- a/stacks/dlrs/mkl/Dockerfile +++ b/stacks/dlrs/mkl/Dockerfile @@ -1,13 +1,36 @@ FROM clearlinux -LABEL maintainer="otc-swstacks@intel.com" +MAINTAINER otc-swstacks@intel.com ARG swupd_args -COPY setup_mkl.sh / - RUN swupd update $swupd_args && \ - swupd bundle-add curl git && \ - /setup_mkl.sh && \ - rm setup_mkl.sh + swupd bundle-add devpkg-openmpi git sysadmin-basic -CMD 'bash' +# install miniconda +ADD https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh /miniconda.sh +RUN sh /miniconda.sh -b -p /opt/conda && \ + /opt/conda/bin/conda update -n base conda && \ + rm /miniconda.sh +ENV PATH=${PATH}:/opt/conda/bin + +# create tf_env and install tensorflow with mkl-dnn +SHELL ["/bin/bash", "-c"] +RUN conda create -n tf_env +RUN conda install -n tf_env -y -c anaconda \ + pip tensorflow nltk ipython + +# add conda env script to bashrc +RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ + echo "conda activate tf_env" >> ~/.bashrc + +# install horovod +RUN source ~/.bashrc +RUN mv /opt/conda/envs/tf_env/compiler_compat/ld /opt/conda/envs/tf_env/compiler_compat/ld.orig +RUN HOROVOD_WITH_TENSORFLOW=1 /opt/conda/envs/tf_env/bin/pip install --no-cache-dir horovod +RUN mv /opt/conda/envs/tf_env/compiler_compat/ld.orig /opt/conda/envs/tf_env/compiler_compat/ld + +# install additional python packages for ipython and jupyter +RUN /opt/conda/envs/tf_env/bin/pip install --no-cache-dir ipython ipykernel matplotlib jupyter && \ + /opt/conda/envs/tf_env/bin/python -m ipykernel.kernelspec + +CMD ["/bin/bash"] diff --git a/stacks/dlrs/oss/Dockerfile b/stacks/dlrs/oss/Dockerfile index 00451ee..feaabbe 100644 --- a/stacks/dlrs/oss/Dockerfile +++ b/stacks/dlrs/oss/Dockerfile @@ -1,9 +1,14 @@ FROM clearlinux -LABEL maintainer="otc-swstacks@intel.com" +MAINTAINER otc-swstacks@intel.com ARG swupd_args RUN swupd update $swupd_args && \ - swupd bundle-add curl git machine-learning-tensorflow + swupd bundle-add curl sysadmin-basic \ + git machine-learning-tensorflow + +# install additional python packages for ipython and jupyter notebook +RUN pip --no-cache-dir install ipython ipykernel matplotlib jupyter && \ + python -m ipykernel.kernelspec CMD 'bash' diff --git a/stacks/dlrs/pytorch/mkl/Dockerfile b/stacks/dlrs/pytorch/mkl/Dockerfile index f159fb6..6abdcec 100644 --- a/stacks/dlrs/pytorch/mkl/Dockerfile +++ b/stacks/dlrs/pytorch/mkl/Dockerfile @@ -4,6 +4,8 @@ LABEL maintainer=otc-swstacks@intel.com ARG PYTHON_VERSION=3.7.1 ARG MINICONDA_VERSION=4.5.12 +ARG HOROVOD_VERSION=0.16.0 +ARG MKL_VERSION=2019.1 ARG swupd_args ENV PATH /opt/conda/bin:$PATH @@ -16,7 +18,7 @@ ADD https://repo.continuum.io/miniconda/Miniconda3-$MINICONDA_VERSION-Linux-x86_ RUN chmod +x /tmp/miniconda.sh && \ /tmp/miniconda.sh -b -p /opt/conda && \ conda install -y python=$PYTHON_VERSION \ - numpy pyyaml scipy ipython mkl mkl-include cython typing && \ + numpy pyyaml scipy ipython mkl=${MKL_VERSION} mkl-include=${MKL_VERSION} cython typing && \ conda install -y gcc libgcc -c conda-forge RUN pip --no-cache-dir install ninja @@ -36,7 +38,7 @@ RUN CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" \ RUN pip --no-cache-dir install torchvision RUN pip --no-cache-dir install ipython ipykernel jupyter && \ python -m ipykernel.kernelspec -RUN HOROVOD_WITH_TORCH=1 pip install --no-cache-dir horovod +RUN HOROVOD_WITH_TORCH=1 pip install --no-cache-dir horovod==${HOROVOD_VERSION} RUN mv /opt/conda/compiler_compat/ld.orig /opt/conda/compiler_compat/ld