Skip to content

Commit 0b4d456

Browse files
author
yi.wu
committed
add python requests, add DELETE_BUILD_CACHE arg
1 parent 653c981 commit 0b4d456

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

paddle/scripts/docker/build.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ else
2525
BASE_IMAGE="python:2.7.13-slim"
2626
if [ ${WITH_AVX} == "ON" ]; then
2727
DEB_PATH="dist/cpu/"
28-
DOCKER_SUFFIX=""
28+
DOCKER_SUFFIX="cpu"
2929
else
3030
DEB_PATH="dist/cpu-noavx/"
3131
DOCKER_SUFFIX="noavx"
@@ -40,8 +40,11 @@ if [[ ${BUILD_AND_INSTALL:-OFF} == 'ON' ]]; then
4040
fi
4141

4242
mkdir -p /paddle/build # -p means no error if exists
43+
cd /paddle/build
4344
# clean local cmake and third_party cache
44-
cd /paddle/build && rm -rf * && rm -rf ../third_party
45+
if [ ${DELETE_BUILD_CACHE} == 'ON' ]; then
46+
rm -rf * && rm -rf ../third_party
47+
fi
4548
cmake .. \
4649
-DWITH_DOC=${WITH_DOC:-OFF} \
4750
-DWITH_GPU=${WITH_GPU:-OFF} \
@@ -54,7 +57,9 @@ if [[ ${BUILD_AND_INSTALL:-OFF} == 'ON' ]]; then
5457
make install
5558
# generate deb package for current build
5659
# FIXME(typhoonzero): should we remove paddle/scripts/deb ?
57-
cpack -D CPACK_GENERATOR='DEB' ..
60+
# FIXME: CPACK_DEBIAN_PACKAGE_DEPENDS removes all dev dependencies, must
61+
# install them in docker
62+
cpack -D CPACK_GENERATOR='DEB' -D CPACK_DEBIAN_PACKAGE_DEPENDS="" ..
5863
mv /paddle/build/*.deb /paddle/${DEB_PATH}
5964

6065
if [[ ${BUILD_WOBOQ:-OFF} == 'ON' ]]; then
@@ -123,7 +128,7 @@ RUN ${MIRROR_UPDATE}
123128
apt-get install -y libgfortran3 && \
124129
apt-get clean -y && \
125130
pip install --upgrade pip && \
126-
pip install -U 'protobuf==3.1.0'
131+
pip install -U 'protobuf==3.1.0' requests
127132
RUN pip install numpy
128133
# Use different deb file when building different type of images
129134
ADD \$PWD/${DEB_PATH}*.deb /usr/local/opt/paddle/deb/

0 commit comments

Comments
 (0)