提交 5f41d281 编写于 作者: R reyoung

Make docker build use deb package.

上级 22e848ec
...@@ -10,7 +10,7 @@ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE amd64) ...@@ -10,7 +10,7 @@ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE amd64)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER PaddlePaddle Dev <paddle-dev@baidu.com>) set(CPACK_DEBIAN_PACKAGE_MAINTAINER PaddlePaddle Dev <paddle-dev@baidu.com>)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Paddle") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Paddle")
set(CPACK_PACKAGE_DESCRIPTION "") set(CPACK_PACKAGE_DESCRIPTION "")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython2.7, libstdc++6, python-pip, curl") set(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython2.7, libstdc++6, python-pip, curl, libgfortran3, python-pip-whl")
set(CPACK_DEBIAN_PACKAGE_SECTION Devel) set(CPACK_DEBIAN_PACKAGE_SECTION Devel)
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJ_ROOT}/paddle/scripts/deb/postinst") set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJ_ROOT}/paddle/scripts/deb/postinst")
#set(CPACK_GENERATOR "DEB") #set(CPACK_GENERATOR "DEB")
......
...@@ -44,10 +44,7 @@ fi ...@@ -44,10 +44,7 @@ fi
make install make install
# generate deb package for current build # generate deb package for current build
# FIXME(typhoonzero): should we remove paddle/scripts/deb ? cpack -D CPACK_GENERATOR='DEB' ..
# FIXME: CPACK_DEBIAN_PACKAGE_DEPENDS removes all dev dependencies, must
# install them in docker
cpack -D CPACK_GENERATOR='DEB' -D CPACK_DEBIAN_PACKAGE_DEPENDS="" ..
if [[ ${WOBOQ:-OFF} == 'ON' ]]; then if [[ ${WOBOQ:-OFF} == 'ON' ]]; then
apt-get install -y clang-3.8 llvm-3.8 libclang-3.8-dev apt-get install -y clang-3.8 llvm-3.8 libclang-3.8-dev
...@@ -76,9 +73,9 @@ fi ...@@ -76,9 +73,9 @@ fi
paddle version paddle version
if [[ -n ${APT_MIRROR} ]]; then if [[ -n ${APT_MIRROR} ]]; then
MIRROR_UPDATE="sed -i '${APT_MIRROR}' /etc/apt/sources.list && \\" MIRROR_UPDATE="sed -i '${APT_MIRROR}' /etc/apt/sources.list"
else else
MIRROR_UPDATE="\\" MIRROR_UPDATE=""
fi fi
cat > /paddle/build/Dockerfile <<EOF cat > /paddle/build/Dockerfile <<EOF
...@@ -87,18 +84,32 @@ MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com> ...@@ -87,18 +84,32 @@ MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
ENV HOME /root ENV HOME /root
ENV LANG en_US.UTF-8 ENV LANG en_US.UTF-8
# Use Fix locales to en_US.UTF-8 # Use Fix locales to en_US.UTF-8
EOF
if [[ -n ${MIRROR_UPDATE} ]]; then
cat >> /paddle/build/Dockerfile <<EOF
RUN ${MIRROR_UPDATE} RUN ${MIRROR_UPDATE}
apt-get update && \ EOF
apt-get install -y libgfortran3 libpython2.7 ${GPU_DOCKER_PKG} && \ fi
apt-get clean -y && \
pip install --upgrade pip && \ if [[ -n ${GPU_DOCKER_PKG} ]]; then
pip install -U 'protobuf==3.1.0' requests numpy cat >> /paddle/build/Dockerfile <<EOF
RUN apt-get update && \
apt-get install -y ${GPU_DOCKER_PKG} && \
apt-get clean -y
EOF
fi
cat >> /paddle/build/Dockerfile <<EOF
RUN pip install --upgrade pip
# Use different deb file when building different type of images # Use different deb file when building different type of images
ADD build/*.deb /usr/local/opt/paddle/deb/ ADD build/*.deb /
# run paddle version to install python packages first # run paddle version to install python packages first
RUN dpkg -i /usr/local/opt/paddle/deb/*.deb && \ RUN apt-get update &&\
apt-get -f && \ dpkg -i /*.deb ; apt-get install -f -y && \
rm -f /usr/local/opt/paddle/deb/*.deb && \ apt-get clean -y && \
rm -f /*.deb && \
pip install /usr/opt/paddle/share/wheels/*.whl && \ pip install /usr/opt/paddle/share/wheels/*.whl && \
paddle version paddle version
${CPU_DOCKER_PYTHON_HOME_ENV} ${CPU_DOCKER_PYTHON_HOME_ENV}
......
...@@ -14,6 +14,10 @@ setup(name='paddle', ...@@ -14,6 +14,10 @@ setup(name='paddle',
version='${PADDLE_VERSION}', version='${PADDLE_VERSION}',
description='Parallel Distributed Deep Learning', description='Parallel Distributed Deep Learning',
packages=packages, packages=packages,
install_requires=[
"numpy",
"protobuf==3.1.0"
],
package_dir={ package_dir={
'': '${CMAKE_CURRENT_SOURCE_DIR}' '': '${CMAKE_CURRENT_SOURCE_DIR}'
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册