Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions paddle/scripts/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,17 @@ docker tag myapp me/myapp
docker push
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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

- Build PaddlePaddle source code to be static files

```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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉应该让用户知道需要创建文件夹$HOME/nginx_data,以及这个指令会运行woboq将网页版代码生成到$HOME/nginx_data里面。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用户应该不需要手动创建$HOME/nginx_data,docker run会自动在本地创建这个目录,但确实应该指出来会创建这个目录。
Done.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个例子里,需要提及 WITH_TEST 是不是因为这个决定过了unit test的源码是否被转换成HTML?我看了一下,woboq codebrowser是根据cmake的输出来知道如何build源码和转换源码的。

但是 RUN_TEST 是不是不必在这个例子里提及?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

赞细致,Done.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUILD_WOBOQ => WOBOQ ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么需要制定 /usr/share/nginx/html/data 和 同一个目录下的 paddle 两个子目录呢?是不是弄成 /woboq 就行了?

这里为什么要放在 /usr/share/nginx/html 里呢?这个是nginx的目录。但是development image里应该不需要有nginx?nginx如果需要应该放在doc image里?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/usr/share/nginx/html/data保存了一些js代码,paddle目录保存的是html代码,但确实在这个Image里确实只创建一个根目录的volume就好了,另外/woboq用来存在woboq源码了,所以目录改为/woboq_out, :)
Done.

```

- 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can open the generated HTML files in your Web browser. Or, if you want to run a Nginx container to serve them for a wider audience, you can run:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


```
docker run -v $HOME/nginx_data:/usr/share/nginx/html -d -p 8080:80 nginx
```