Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
756ee92d
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
756ee92d
编写于
4月 24, 2017
作者:
Y
Yu Yang
提交者:
GitHub
4月 24, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1869 from reyoung/curl_is_also_need_by_paddle
Refactor the ways to build docker image
上级
dba06727
9b45b265
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
29 deletion
+30
-29
cmake/package.cmake
cmake/package.cmake
+2
-2
paddle/scripts/deb/postinst
paddle/scripts/deb/postinst
+6
-0
paddle/scripts/docker/build.sh
paddle/scripts/docker/build.sh
+17
-27
python/setup.py.in
python/setup.py.in
+5
-0
未找到文件。
cmake/package.cmake
浏览文件 @
756ee92d
set
(
CPACK_PACKAGE_NAME paddle
)
set
(
CPACK_PACKAGE_NAME paddle
)
set
(
CPACK_PACKAGE_DESCRIPTION_SUMMARY
""
)
set
(
CPACK_PACKAGE_VERSION_MAJOR
${
PADDLE_MAJOR_VERSION
}
)
set
(
CPACK_PACKAGE_VERSION_MAJOR
${
PADDLE_MAJOR_VERSION
}
)
set
(
CPACK_PACKAGE_VERSION_MINOR
${
PADDLE_MINOR_VERSION
}
)
set
(
CPACK_PACKAGE_VERSION_MINOR
${
PADDLE_MINOR_VERSION
}
)
set
(
CPACK_PACKAGE_VERSION_PATCH
${
PADDLE_PATCH_VERSION
}
)
set
(
CPACK_PACKAGE_VERSION_PATCH
${
PADDLE_PATCH_VERSION
}
)
...
@@ -10,8 +9,9 @@ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE amd64)
...
@@ -10,8 +9,9 @@ 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
"lib
atlas3-base, libgflags2, libgoogle-glog0, libprotobuf8, libpython2.7, libstdc++6, python-numpy, python-pip, python-pip-whl, python-protobuf
"
)
set
(
CPACK_DEBIAN_PACKAGE_DEPENDS
"lib
python2.7-dev, 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_VERSION
${
PADDLE_VERSION
}
)
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")
# Start cpack
# Start cpack
...
...
paddle/scripts/deb/postinst
0 → 100644
浏览文件 @
756ee92d
#!/bin/bash
set
-e
echo
"Post install paddle debian package."
echo
"Install some python package used for paddle. You can run "
echo
" pip install /usr/opt/paddle/share/wheels/*.whl to install them."
find /usr/
-name
'*paddle*.whl'
| xargs pip
install
paddle/scripts/docker/build.sh
浏览文件 @
756ee92d
...
@@ -5,13 +5,8 @@ set -e
...
@@ -5,13 +5,8 @@ set -e
# Set BASE_IMAGE according to env variables
# Set BASE_IMAGE according to env variables
if
[
${
WITH_GPU
}
==
"ON"
]
;
then
if
[
${
WITH_GPU
}
==
"ON"
]
;
then
BASE_IMAGE
=
"nvidia/cuda:8.0-cudnn5-runtime-ubuntu14.04"
BASE_IMAGE
=
"nvidia/cuda:8.0-cudnn5-runtime-ubuntu14.04"
# additional packages to install when building gpu images
GPU_DOCKER_PKG
=
"python-pip python-dev"
else
else
BASE_IMAGE
=
"python:2.7.13-slim"
BASE_IMAGE
=
"ubuntu:14.04"
# FIXME: python base image uses different python version than WITH_GPU
# need to change PYTHONHOME to /usr/local when using python base image
CPU_DOCKER_PYTHON_HOME_ENV
=
"ENV PYTHONHOME /usr/local"
fi
fi
DOCKERFILE_GPU_ENV
=
""
DOCKERFILE_GPU_ENV
=
""
...
@@ -60,10 +55,7 @@ if [ ${WITH_DOC} == "ON" ]; then
...
@@ -60,10 +55,7 @@ if [ ${WITH_DOC} == "ON" ]; then
popd
popd
fi
fi
# 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
...
@@ -91,32 +83,30 @@ fi
...
@@ -91,32 +83,30 @@ fi
paddle version
paddle version
if
[[
-n
${
APT_MIRROR
}
]]
;
then
MIRROR_UPDATE
=
"sed -i '
${
APT_MIRROR
}
' /etc/apt/sources.list &&
\\
"
else
MIRROR_UPDATE
=
"
\\
"
fi
cat
>
/paddle/build/Dockerfile
<<
EOF
cat
>
/paddle/build/Dockerfile
<<
EOF
FROM
${
BASE_IMAGE
}
FROM
${
BASE_IMAGE
}
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
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
RUN
${
MIRROR_UPDATE
}
EOF
apt-get update &&
\
apt-get install -y libgfortran3 libpython2.7
${
GPU_DOCKER_PKG
}
&&
\
if
[[
-n
${
APT_MIRROR
}
]]
;
then
apt-get clean -y &&
\
cat
>>
/paddle/build/Dockerfile
<<
EOF
pip install --upgrade pip &&
\
RUN sed -i '
${
APT_MIRROR
}
' /etc/apt/sources.list
pip install -U 'protobuf==3.1.0' requests numpy
EOF
fi
cat
>>
/paddle/build/Dockerfile
<<
EOF
# 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 &&
\
rm -f /usr/local/opt/paddle/deb/*.deb &&
\
apt-get install -y python-pip && pip install -U pip &&
\
find /usr/ -name '*paddle-*.whl' | xargs pip install &&
\
dpkg -i /*.deb ; apt-get install -f -y &&
\
apt-get clean -y &&
\
rm -f /*.deb &&
\
paddle version
paddle version
${
CPU_DOCKER_PYTHON_HOME_ENV
}
${
DOCKERFILE_CUDNN_DSO
}
${
DOCKERFILE_CUDNN_DSO
}
${
DOCKERFILE_GPU_ENV
}
${
DOCKERFILE_GPU_ENV
}
# default command shows the paddle version and exit
# default command shows the paddle version and exit
...
...
python/setup.py.in
浏览文件 @
756ee92d
...
@@ -14,6 +14,11 @@ setup(name='paddle',
...
@@ -14,6 +14,11 @@ 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",
"matplotlib",
],
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录