Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions elasticdl/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,30 @@ ARG BASE_IMAGE

FROM ${BASE_IMAGE} as dev
ARG EXTRA_PYPI_INDEX=https://pypi.org/simple
ARG HOROVOD_COMMIT_ID="3108a24"

COPY elasticdl/docker/bashrc /etc/bash.bashrc
RUN chmod a+rx /etc/bash.bashrc

RUN apt-get -qq update && \
apt-get -qq install -y unzip curl git software-properties-common g++ wget \
shellcheck libeigen3-dev clang-format > /dev/null && \
RUN apt-get -qq update && apt-get -qq install -y \
unzip \
curl \
git \
software-properties-common \
g++ \
wget \
build-essential \
cmake \
vim \
ca-certificates \
libjpeg-dev \
libpng-dev \
librdmacm1 \
libibverbs1 \
ibverbs-providers \
shellcheck \
libeigen3-dev \
clang-format > /dev/null && \
python -m pip install --quiet --upgrade pip

COPY elasticdl_client/requirements.txt /requirements.txt
Expand Down Expand Up @@ -61,6 +78,8 @@ COPY elasticdl/python/data/recordio_gen/heart_recordio_gen.py /scripts/heart_rec

FROM dev as allreduce

RUN pip install future typing

# Note that pip is having issue downloading PyTorch on manylinux so we use curl
# to download it instead
RUN curl -sLo torch-1.4.0-cp36-cp36m-manylinux1_x86_64.whl \
Expand All @@ -72,3 +91,16 @@ RUN cd /root && git clone --depth=1 https://github.com/caicloud/ftlib.git
RUN cd /root/ftlib && python -m pip install --quiet -r requirements.txt
RUN cd /root/ftlib/ftlib/consensus/gossip && bash ./gen_shared_lib.sh
RUN cp -r /root/ftlib/ftlib /usr/local/lib/python3.6/dist-packages/ftlib

# The latest package of Horovod does not support elastic training,
# so we need to git clone and install it using source codes.
ENV HOROVOD_PATH /tmp/${HOROVOD_COMMIT_ID}
RUN cd /tmp \
&& git clone --recursive https://github.com/horovod/horovod.git \
-b master ${HOROVOD_COMMIT_ID}

RUN cd ${HOROVOD_PATH} && HOROVOD_WITHOUT_MPI=1 \
HOROVOD_WITHOUT_MXNET=1 \
HOROVOD_WITH_TENSORFLOW=1 \
HOROVOD_WITH_PYTORCH=1 \
python setup.py install