Skip to content

Commit 35e0f97

Browse files
committed
update
1 parent 587a05e commit 35e0f97

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ ARG UBUNTU_MIRROR
77
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'
88

99
# ENV variables
10-
ARG BUILD_WOBOQ
10+
ARG WOBOQ
1111
ARG WITH_GPU
1212
ARG WITH_AVX
1313
ARG WITH_DOC
1414
ARG WITH_STYLE_CHECK
1515

16-
ENV BUILD_WOBOQ=${BUILD_WOBOQ:-OFF}
16+
ENV WOBOQ=${WOBOQ:-OFF}
1717
ENV WITH_GPU=${WITH_AVX:-OFF}
1818
ENV WITH_AVX=${WITH_AVX:-ON}
1919
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 && \
4848
cd cmake-3.4.1 && ./bootstrap && make -j `nproc` && make install && \
4949
cd .. && rm -rf cmake-3.4.1
5050

51-
VOLUME ["/usr/share/nginx/html/data", "/usr/share/nginx/html/paddle"]
51+
VOLUME ["/woboq_out"]
5252

5353
# Configure OpenSSH server. c.f. https://docs.docker.com/engine/examples/running_ssh_service
5454
RUN mkdir /var/run/sshd

paddle/scripts/docker/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,17 @@ kubectl ...
168168
```
169169

170170
### Reading source code with woboq codebrowser
171-
If you are interesting of PaddlePaddle source code, [Woboq codebrowser](https://github.com/woboq/woboq_codebrowser) is a suitable tool.
172-
- Build PaddlePaddle source code to be static files
171+
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).
172+
173+
- 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.
173174

174175
```bash
175-
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
176+
docker run -v $PWD:/paddle -v $HOME/nginx:/woboq_out -e "WITH_GPU=OFF" -e "WITH_AVX=ON"
177+
-e "WITH_TEST=ON" -e "WOBOQ=ON" paddle:dev
176178
```
177179

178180
- 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://<hostip>:8080/paddle" in browser.
179181

180182
```
181-
docker run -v $HOME/nginx_data:/usr/share/nginx/html -d -p 8080:80 nginx
183+
docker run -v $HOME/nginx:/usr/share/nginx/html -d -p 8080:80 nginx
182184
```

paddle/scripts/docker/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ make install
4747
# install them in docker
4848
cpack -D CPACK_GENERATOR='DEB' -D CPACK_DEBIAN_PACKAGE_DEPENDS="" ..
4949

50-
if [[ ${BUILD_WOBOQ:-OFF} == 'ON' ]]; then
50+
if [[ ${WOBOQ:-OFF} == 'ON' ]]; then
5151
apt-get install -y clang-3.8 llvm-3.8 libclang-3.8-dev
5252
# Install woboq_codebrowser.
5353
git clone https://github.com/woboq/woboq_codebrowser /woboq
@@ -58,6 +58,7 @@ if [[ ${BUILD_WOBOQ:-OFF} == 'ON' ]]; then
5858
make
5959

6060
export WOBOQ_OUT=/usr/share/nginx/html/paddle
61+
export WOBOQ_OUT=/woboq_out/paddle
6162
export BUILD_DIR=/paddle/build
6263
mkdir -p $WOBOQ_OUT
6364
cp -rv /woboq/data $WOBOQ_OUT/../data

0 commit comments

Comments
 (0)