From f66fd44fecc8b6fe1880aea96d266998a35f37a0 Mon Sep 17 00:00:00 2001 From: "yi.wu" Date: Mon, 13 Mar 2017 19:00:45 +0800 Subject: [PATCH] do not use docker cp --- .gitignore | 4 ++- paddle/scripts/docker/buildall.sh | 27 +++++++++++-------- paddle/scripts/docker/paddle-core/Dockerfile | 12 ++++++--- .../Dockerfile} | 7 ----- 4 files changed, 27 insertions(+), 23 deletions(-) rename paddle/scripts/docker/{buildimage/Dockerfile.build => paddle-dev/Dockerfile} (90%) diff --git a/.gitignore b/.gitignore index 6aae076a490..3b407e63101 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 2d7de809652..c10720ab62d 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 708e4fe8013..628f5817761 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 03e6ac792f2..1aee44e21be 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"] -- GitLab