diff --git a/.gitignore b/.gitignore index 6aae076a49012b032b8fc0f1dc02c2714fb7b4a3..3b407e631019f850c299e39c7c80f14fc329ac1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ *.DS_Store -build/ +build/paddle/math +build/paddle/utils +build/paddle/gserver *.user .vscode diff --git a/paddle/scripts/docker/buildall.sh b/paddle/scripts/docker/buildall.sh index 2d7de809652142027ce918a7b72cada9f1229e63..c10720ab62dfd79d0097a2d3a34e94a81cd9aa12 100644 --- a/paddle/scripts/docker/buildall.sh +++ b/paddle/scripts/docker/buildall.sh @@ -1,27 +1,32 @@ #!/bin/bash BINARIES_DIR=paddle/scripts/docker/buildimage/binaries +BUILD_DIR=$PWD/build function build_in_docker() { - docker build . -t paddle-build-env -f paddle/scripts/docker/buildimage/Dockerfile.build - BUILDER=$(docker run -d paddle-build-env) + if [ ! -d $BUILD_DIR ]; then + mkdir -p $BUILD_DIR + fi + docker build . -t paddle-build-env -f paddle/scripts/docker/paddle-dev/Dockerfile + # FIXME: need to wait a signal not sleeping + BUILDER=$(docker run -d -v ${PWD}:/paddle paddle-build-env sleep 3600) + # TODO(typhoonzero): docker exec $BUILDER /bin/bash -c "export BUILD_AND_INSTALL=ON && /paddle/paddle/scripts/docker/build.sh" mkdir -p $BINARIES_DIR - docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_pserver_main $BINARIES_DIR - docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_trainer $BINARIES_DIR - docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_merge_model $BINARIES_DIR - docker cp $BUILDER:/usr/local/bin/paddle $BINARIES_DIR - docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_usage $BINARIES_DIR - - docker cp $BUILDER:/usr/local/opt/paddle/share/wheels $BINARIES_DIR + # docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_pserver_main $BINARIES_DIR + # docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_trainer $BINARIES_DIR + # docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_merge_model $BINARIES_DIR + # docker cp $BUILDER:/usr/local/bin/paddle $BINARIES_DIR + # docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_usage $BINARIES_DIR + # + # docker cp $BUILDER:/usr/local/opt/paddle/share/wheels $BINARIES_DIR docker stop $BUILDER && docker rm $BUILDER } function build_paddle_core() { docker build . -t paddle-core -f paddle/scripts/docker/paddle-core/Dockerfile - } build_in_docker -build_paddle_core +#build_paddle_core diff --git a/paddle/scripts/docker/paddle-core/Dockerfile b/paddle/scripts/docker/paddle-core/Dockerfile index 708e4fe8013fd56ddad062ce4c12c9247e481223..628f581776182176c312dc737e4588a54706024c 100644 --- a/paddle/scripts/docker/paddle-core/Dockerfile +++ b/paddle/scripts/docker/paddle-core/Dockerfile @@ -24,10 +24,14 @@ RUN sed 's@http:\/\/archive.ubuntu.com\/ubuntu\/@mirror:\/\/mirrors.ubuntu.com\/ pip install -U 'protobuf==3.1.0' RUN pip install numpy -ADD paddle/scripts/docker/buildimage/binaries/paddle paddle/scripts/docker/buildimage/binaries/paddle_trainer \ -paddle/scripts/docker/buildimage/binaries/paddle_pserver_main paddle/scripts/docker/buildimage/binaries/paddle_merge_model \ -paddle/scripts/docker/buildimage/binaries/paddle_usage /usr/local/opt/paddle/bin/ -ADD paddle/scripts/docker/buildimage/binaries/wheels/py_paddle*linux*.whl paddle/scripts/docker/buildimage/binaries/wheels/paddle*.whl \ +ADD build/paddle/trainer/paddle_trainer \ + build/paddle/pserver/paddle_pserver_main \ + build/paddle/trainer/paddle_merge_model \ + /usr/local/opt/paddle/bin/ +ADD build/paddle/scripts/usage.sh /usr/local/opt/paddle/bin/paddle_usage +ADD paddle/scripts/submit_local.sh.in /usr/bin/paddle + +ADD paddle/dist/py_paddle*linux*.whl build/python/dist/paddle*.whl \ /usr/local/opt/paddle/share/wheels/ RUN pip install /usr/local/opt/paddle/share/wheels/py_paddle*linux*.whl && \ pip install /usr/local/opt/paddle/share/wheels/paddle*.whl && \ diff --git a/paddle/scripts/docker/buildimage/Dockerfile.build b/paddle/scripts/docker/paddle-dev/Dockerfile similarity index 90% rename from paddle/scripts/docker/buildimage/Dockerfile.build rename to paddle/scripts/docker/paddle-dev/Dockerfile index 03e6ac792f225f607158150632378c9e4475ae1c..1aee44e21be9f7785c25bcb31edea3b818d83d43 100644 --- a/paddle/scripts/docker/buildimage/Dockerfile.build +++ b/paddle/scripts/docker/paddle-dev/Dockerfile @@ -48,12 +48,5 @@ RUN curl -sSL https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xz && \ cd cmake-3.4.1 && ./bootstrap && make -j `nproc` && make install && \ cd .. && rm -rf cmake-3.4.1 -COPY . /paddle/ -RUN cd /paddle/ && git submodule update --init --recursive -RUN /paddle/paddle/scripts/docker/build.sh - -VOLUME ["/usr/share/nginx/html/data", "/usr/share/nginx/html/paddle"] - - # FIXME: wait a long time is OK CMD ["sleep", "3600"]