From 35e0f970c202c2005e908ba7ec5d131d48ead3f8 Mon Sep 17 00:00:00 2001 From: Yancey1989 Date: Tue, 28 Mar 2017 14:16:39 +0800 Subject: [PATCH] update --- Dockerfile | 6 +++--- paddle/scripts/docker/README.md | 10 ++++++---- paddle/scripts/docker/build.sh | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index ccd43be668e..ee6cc19a7fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,13 +7,13 @@ ARG UBUNTU_MIRROR RUN /bin/bash -c 'if [[ -n ${UBUNTU_MIRROR} ]]; then sed -i 's#http://archive.ubuntu.com/ubuntu#${UBUNTU_MIRROR}#g' /etc/apt/sources.list; fi' # ENV variables -ARG BUILD_WOBOQ +ARG WOBOQ ARG WITH_GPU ARG WITH_AVX ARG WITH_DOC ARG WITH_STYLE_CHECK -ENV BUILD_WOBOQ=${BUILD_WOBOQ:-OFF} +ENV WOBOQ=${WOBOQ:-OFF} ENV WITH_GPU=${WITH_AVX:-OFF} ENV WITH_AVX=${WITH_AVX:-ON} ENV WITH_DOC=${WITH_DOC:-OFF} @@ -48,7 +48,7 @@ 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 -VOLUME ["/usr/share/nginx/html/data", "/usr/share/nginx/html/paddle"] +VOLUME ["/woboq_out"] # Configure OpenSSH server. c.f. https://docs.docker.com/engine/examples/running_ssh_service RUN mkdir /var/run/sshd diff --git a/paddle/scripts/docker/README.md b/paddle/scripts/docker/README.md index 907904ddb14..20ace2417e8 100644 --- a/paddle/scripts/docker/README.md +++ b/paddle/scripts/docker/README.md @@ -168,15 +168,17 @@ kubectl ... ``` ### Reading source code with woboq codebrowser -If you are interesting of PaddlePaddle source code, [Woboq codebrowser](https://github.com/woboq/woboq_codebrowser) is a suitable tool. -- Build PaddlePaddle source code to be static files +For developers who are interested in the C++ source code, please use -e "WOBOQ=ON" to enable building C++ source code into HTML pages using [Woboq codebrowser](https://github.com/woboq/woboq_codebrowser). + +- The following command will generate woboq HTML pages in a docker volume directory, `$HOME/nginx` directory will be created on your local disk when the build finishes. ```bash -docker run -v $PWD:/paddle -v $HOME/nginx_data:/usr/share/nginx/html/data -v $HOME/nginx_data/paddle:/usr/share/nginx/html/paddle -e "WITH_GPU=OFF" -e "WITH_AVX=ON" -e "WITH_TEST=OFF" -e "RUN_TEST=OFF" -e "BUILD_WOBOQ=ON" paddle:dev +docker run -v $PWD:/paddle -v $HOME/nginx:/woboq_out -e "WITH_GPU=OFF" -e "WITH_AVX=ON" +-e "WITH_TEST=ON" -e "WOBOQ=ON" paddle:dev ``` - Open the generated static files in a browser, or upload these files to your web server. You can run nginx server as the following command, and then hit "http://:8080/paddle" in browser. ``` -docker run -v $HOME/nginx_data:/usr/share/nginx/html -d -p 8080:80 nginx +docker run -v $HOME/nginx:/usr/share/nginx/html -d -p 8080:80 nginx ``` diff --git a/paddle/scripts/docker/build.sh b/paddle/scripts/docker/build.sh index a0da561dfe9..a4de7a072b3 100644 --- a/paddle/scripts/docker/build.sh +++ b/paddle/scripts/docker/build.sh @@ -47,7 +47,7 @@ make install # install them in docker cpack -D CPACK_GENERATOR='DEB' -D CPACK_DEBIAN_PACKAGE_DEPENDS="" .. -if [[ ${BUILD_WOBOQ:-OFF} == 'ON' ]]; then +if [[ ${WOBOQ:-OFF} == 'ON' ]]; then apt-get install -y clang-3.8 llvm-3.8 libclang-3.8-dev # Install woboq_codebrowser. git clone https://github.com/woboq/woboq_codebrowser /woboq @@ -58,6 +58,7 @@ if [[ ${BUILD_WOBOQ:-OFF} == 'ON' ]]; then make export WOBOQ_OUT=/usr/share/nginx/html/paddle + export WOBOQ_OUT=/woboq_out/paddle export BUILD_DIR=/paddle/build mkdir -p $WOBOQ_OUT cp -rv /woboq/data $WOBOQ_OUT/../data -- GitLab