Skip to content

Commit b29229b

Browse files
jeffraUbuntu
authored andcommitted
update docker image and bump DSE
1 parent 6bb5c69 commit b29229b

3 files changed

Lines changed: 94 additions & 46 deletions

File tree

DeepSpeedExamples

azure-pipelines-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ stages:
2929
displayName: Build and Push
3030
inputs:
3131
command: buildAndPush
32-
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
32+
dockerfile: '$(Build.SourcesDirectory)/docker/Dockerfile'
3333
repository: deepspeed/deepspeed
3434
tags: |
3535
$(tag)

Dockerfile renamed to docker/Dockerfile

Lines changed: 92 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ RUN mkdir -p ${STAGE_DIR}
1111
##############################################################################
1212
RUN apt-get update && \
1313
apt-get install -y --no-install-recommends \
14-
software-properties-common \
15-
openssh-client openssh-server \
16-
pdsh curl sudo net-tools \
17-
vim iputils-ping wget
18-
#llvm-9-dev cmake
14+
software-properties-common build-essential autotools-dev \
15+
nfs-common pdsh \
16+
cmake g++ gcc \
17+
curl wget vim tmux emacs less unzip \
18+
htop iftop iotop ca-certificates openssh-client openssh-server \
19+
rsync iputils-ping net-tools sudo \
20+
llvm-9-dev
1921

2022
##############################################################################
2123
# Installation Latest Git
@@ -25,6 +27,43 @@ RUN add-apt-repository ppa:git-core/ppa -y && \
2527
apt-get install -y git && \
2628
git --version
2729

30+
##############################################################################
31+
# Client Liveness & Uncomment Port 22 for SSH Daemon
32+
##############################################################################
33+
# Keep SSH client alive from server side
34+
RUN echo "ClientAliveInterval 30" >> /etc/ssh/sshd_config
35+
RUN cp /etc/ssh/sshd_config ${STAGE_DIR}/sshd_config && \
36+
sed "0,/^#Port 22/s//Port 22/" ${STAGE_DIR}/sshd_config > /etc/ssh/sshd_config
37+
38+
##############################################################################
39+
# Mellanox OFED
40+
##############################################################################
41+
ENV MLNX_OFED_VERSION=4.6-1.0.1.1
42+
RUN apt-get install -y libnuma-dev
43+
RUN cd ${STAGE_DIR} && \
44+
wget -q -O - http://www.mellanox.com/downloads/ofed/MLNX_OFED-${MLNX_OFED_VERSION}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu18.04-x86_64.tgz | tar xzf - && \
45+
cd MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu18.04-x86_64 && \
46+
./mlnxofedinstall --user-space-only --without-fw-update --all -q && \
47+
cd ${STAGE_DIR} && \
48+
rm -rf ${STAGE_DIR}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu18.04-x86_64*
49+
50+
##############################################################################
51+
# nv_peer_mem
52+
##############################################################################
53+
ENV NV_PEER_MEM_VERSION=1.1
54+
ENV NV_PEER_MEM_TAG=1.1-0
55+
RUN mkdir -p ${STAGE_DIR} && \
56+
git clone https://github.com/Mellanox/nv_peer_memory.git --branch ${NV_PEER_MEM_TAG} ${STAGE_DIR}/nv_peer_memory && \
57+
cd ${STAGE_DIR}/nv_peer_memory && \
58+
./build_module.sh && \
59+
cd ${STAGE_DIR} && \
60+
tar xzf ${STAGE_DIR}/nvidia-peer-memory_${NV_PEER_MEM_VERSION}.orig.tar.gz && \
61+
cd ${STAGE_DIR}/nvidia-peer-memory-${NV_PEER_MEM_VERSION} && \
62+
apt-get update && \
63+
apt-get install -y dkms && \
64+
dpkg-buildpackage -us -uc && \
65+
dpkg -i ${STAGE_DIR}/nvidia-peer-memory_${NV_PEER_MEM_TAG}_all.deb
66+
2867
##############################################################################
2968
# OPENMPI
3069
##############################################################################
@@ -63,13 +102,57 @@ RUN apt-get install -y python3 python3-dev && \
63102
# Print python an pip version
64103
python -V && pip -V
65104
RUN pip install pyyaml
105+
RUN pip install ipython
66106

67107
##############################################################################
68108
# TensorFlow
69109
##############################################################################
70110
ENV TENSORFLOW_VERSION=1.15.2
71111
RUN pip install tensorflow-gpu==${TENSORFLOW_VERSION}
72112

113+
##############################################################################
114+
# Some Packages
115+
##############################################################################
116+
RUN apt-get update && \
117+
apt-get install -y --no-install-recommends \
118+
libsndfile-dev \
119+
libcupti-dev \
120+
libjpeg-dev \
121+
libpng-dev \
122+
screen
123+
RUN pip install psutil \
124+
yappi \
125+
cffi \
126+
ipdb \
127+
pandas \
128+
matplotlib \
129+
py3nvml \
130+
pyarrow \
131+
graphviz \
132+
astor \
133+
boto3 \
134+
tqdm \
135+
sentencepiece \
136+
msgpack \
137+
requests \
138+
pandas \
139+
sphinx \
140+
sphinx_rtd_theme \
141+
scipy \
142+
numpy \
143+
sklearn \
144+
scikit-learn \
145+
nvidia-ml-py3 \
146+
mpi4py \
147+
cupy-cuda100
148+
149+
##############################################################################
150+
## SSH daemon port inside container cannot conflict with host OS port
151+
###############################################################################
152+
ENV SSH_PORT=2222
153+
RUN cat /etc/ssh/sshd_config > ${STAGE_DIR}/sshd_config && \
154+
sed "0,/^#Port 22/s//Port ${SSH_PORT}/" ${STAGE_DIR}/sshd_config > /etc/ssh/sshd_config
155+
73156
##############################################################################
74157
# PyTorch
75158
##############################################################################
@@ -81,46 +164,11 @@ RUN pip install torchvision==${TORCHVISION_VERSION}
81164
RUN pip install tensorboardX==${TENSORBOARDX_VERSION}
82165

83166
##############################################################################
84-
# Temporary Installation Directory
85-
##############################################################################
86-
ENV STAGE_DIR=/tmp
87-
RUN mkdir -p ${STAGE_DIR}
88-
89-
##############################################################################
90-
# Mellanox OFED
91-
##############################################################################
92-
ENV MLNX_OFED_VERSION=4.6-1.0.1.1
93-
RUN apt-get install -y libnuma-dev
94-
RUN cd ${STAGE_DIR} && \
95-
wget -q -O - http://www.mellanox.com/downloads/ofed/MLNX_OFED-${MLNX_OFED_VERSION}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu18.04-x86_64.tgz | tar xzf - && \
96-
cd MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu18.04-x86_64 && \
97-
./mlnxofedinstall --user-space-only --without-fw-update --all -q && \
98-
cd ${STAGE_DIR} && \
99-
rm -rf ${STAGE_DIR}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu18.04-x86_64*
100-
101-
##############################################################################
102-
# nv_peer_mem
167+
# PyYAML build issue
168+
# https://stackoverflow.com/a/53926898
103169
##############################################################################
104-
ENV NV_PEER_MEM_VERSION=1.1
105-
ENV NV_PEER_MEM_TAG=1.1-0
106-
RUN mkdir -p ${STAGE_DIR} && \
107-
git clone https://github.com/Mellanox/nv_peer_memory.git --branch ${NV_PEER_MEM_TAG} ${STAGE_DIR}/nv_peer_memory && \
108-
cd ${STAGE_DIR}/nv_peer_memory && \
109-
./build_module.sh && \
110-
cd ${STAGE_DIR} && \
111-
tar xzf ${STAGE_DIR}/nvidia-peer-memory_${NV_PEER_MEM_VERSION}.orig.tar.gz && \
112-
cd ${STAGE_DIR}/nvidia-peer-memory-${NV_PEER_MEM_VERSION} && \
113-
apt-get update && \
114-
apt-get install -y dkms && \
115-
dpkg-buildpackage -us -uc && \
116-
dpkg -i ${STAGE_DIR}/nvidia-peer-memory_${NV_PEER_MEM_TAG}_all.deb
117-
118-
##############################################################################
119-
## SSH daemon port inside container cannot conflict with host OS port
120-
###############################################################################
121-
ENV SSH_PORT=2222
122-
RUN cat /etc/ssh/sshd_config > ${STAGE_DIR}/sshd_config && \
123-
sed "0,/^#Port 22/s//Port ${SSH_PORT}/" ${STAGE_DIR}/sshd_config > /etc/ssh/sshd_config
170+
RUN rm -rf /usr/lib/python3/dist-packages/yaml && \
171+
rm -rf /usr/lib/python3/dist-packages/PyYAML-*
124172

125173
##############################################################################
126174
## Add deepspeed user

0 commit comments

Comments
 (0)