Skip to content

Commit 9c7bed8

Browse files
authored
Merge pull request #1640 from wangkuiyi/improve_docker_design_doc
Use Grammarly with the Docker design doc
2 parents cb01b11 + ac5ff87 commit 9c7bed8

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

paddle/scripts/docker/README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22

33
## Goals
44

5-
We want the building procedure generates Docker images, so we can run PaddlePaddle applications on Kubernetes clusters.
5+
We want the building procedure generates Docker images so that we can run PaddlePaddle applications on Kubernetes clusters.
66

7-
We want it generates .deb packages, so that enterprises without Docker support can run PaddlePaddle applications as well.
7+
We want to build .deb packages so that enterprise users can run PaddlePaddle applications without Docker.
88

9-
We want to minimize the size of generated Docker images and .deb packages so to ease the deployment cost.
9+
We want to minimize the size of generated Docker images and .deb packages so to reduce the download time.
1010

1111
We want to encapsulate building tools and dependencies in a *development* Docker image so to ease the tools installation for developers.
1212

13-
We want developers can use whatever editing tools (emacs, vim, Eclipse, Jupyter Notebook), so the development Docker image contains only building tools, not editing tools, and developers are supposed to git clone source code into their development computers, instead of the container running the development Docker image.
13+
Developers use various editors (emacs, vim, Eclipse, Jupyter Notebook), so the development Docker image contains only building tools, not editing tools, and developers are supposed to git clone source code into their development computers and map the code into the development container.
1414

15-
We want the procedure and tools work also with testing, continuous integration, and releasing.
15+
We want the procedure and tools also work with testing, continuous integration, and releasing.
1616

1717

1818
## Docker Images
1919

20-
We want two Docker images for each version of PaddlePaddle:
20+
So we need two Docker images for each version of PaddlePaddle:
2121

2222
1. `paddle:<version>-dev`
2323

24-
This a development image contains only the development tools. This standardizes the building tools and procedure. Users include:
24+
This a development image contains only the development tools and standardizes the building procedure. Users include:
2525

2626
- developers -- no longer need to install development tools on the host, and can build their current work on the host (development computer).
2727
- release engineers -- use this to build the official release from certain branch/tag on Github.com.
2828
- document writers / Website developers -- Our documents are in the source repo in the form of .md/.rst files and comments in source code. We need tools to extract the information, typeset, and generate Web pages.
2929

30-
Of course developers can install building tools on their development computers. But different version of PaddlePaddle might require different set/version of building tools. Also, it makes collaborative debugging eaiser if all developers use a unified development environment.
30+
Of course, developers can install building tools on their development computers. But different versions of PaddlePaddle might require different set or version of building tools. Also, it makes collaborative debugging easier if all developers use a unified development environment.
3131

3232
The development image should include the following tools:
3333

@@ -38,7 +38,7 @@ We want two Docker images for each version of PaddlePaddle:
3838
- woboq
3939
- sshd
4040

41-
where `sshd` makes it easy for developers to have multiple terminals connecting into the container. `docker exec` works too, but if the container is running on a remote machine, it would be easier to ssh directly into the container than ssh to the box and run `docker exec`.
41+
Many developers work on a remote computer with GPU; they could ssh into the computer and `docker exec` into the development container. However, running `sshd` in the container allows developers to ssh into the container directly.
4242

4343
1. `paddle:<version>`
4444

@@ -49,9 +49,9 @@ We want two Docker images for each version of PaddlePaddle:
4949
- no-GPU/AVX `paddle:<version>`
5050
- no-GPU/no-AVX `paddle:<version>-noavx`
5151

52-
We'd like to give users the choice between GPU and no-GPU, because the GPU version image is much larger than then the no-GPU version.
52+
We allow users to choose between GPU and no-GPU because the GPU version image is much larger than then the no-GPU version.
5353

54-
We'd like to give users the choice between AVX and no-AVX, because some cloud providers don't provide AVX-enabled VMs.
54+
We allow users the choice between AVX and no-AVX, because some cloud providers don't provide AVX-enabled VMs.
5555

5656

5757
## Development Environment
@@ -60,28 +60,28 @@ Here we describe how to use above two images. We start from considering our dai
6060

6161
Developers work on a computer, which is usually a laptop or desktop:
6262

63-
![](doc/paddle-development-environment.png)
63+
<img src="doc/paddle-development-environment.png" width=500 />
6464

6565
or, they might rely on a more sophisticated box (like with GPUs):
6666

67-
![](doc/paddle-development-environment-gpu.png)
67+
<img src="doc/paddle-development-environment-gpu.png" width=500 />
6868

69-
A basic principle is that source code lies on the development computer (host), so that editing tools like Eclipse can parse the source code and support auto-completion.
69+
A principle here is that source code lies on the development computer (host) so that editors like Eclipse can parse the source code to support auto-completion.
7070

7171

7272
## Usages
7373

7474
### Build the Development Docker Image
7575

76-
The following commands check out the source code on the development computer (host) and build the development image `paddle:dev`:
76+
The following commands check out the source code to the host and build the development image `paddle:dev`:
7777

7878
```bash
7979
git clone https://github.com/PaddlePaddle/Paddle paddle
8080
cd paddle
8181
docker build -t paddle:dev .
8282
```
8383

84-
The `docker build` command assumes that `Dockerfile` is in the root source tree. This is reasonable because this Dockerfile is this only on in our repo in this design.
84+
The `docker build` command assumes that `Dockerfile` is in the root source tree. Note that in this design, this `Dockerfile` is this only one in our repo.
8585

8686

8787
### Build PaddlePaddle from Source Code
@@ -92,7 +92,7 @@ Given the development image `paddle:dev`, the following command builds PaddlePad
9292
docker run -v $PWD:/paddle -e "GPU=OFF" -e "AVX=ON" -e "TEST=ON" paddle:dev
9393
```
9494

95-
This command mounts the source directory on the host into `/paddle` in the container, so the default entrypoint of `paddle:dev`, `build.sh`, would build the source code with possible local changes. When it writes to `/paddle/build` in the container, it actually writes to `$PWD/build` on the host.
95+
This command mounts the source directory on the host into `/paddle` in the container, so the default entry point of `paddle:dev`, `build.sh`, could build the source code with possible local changes. When it writes to `/paddle/build` in the container, it writes to `$PWD/build` on the host indeed.
9696

9797
`build.sh` builds the following:
9898

@@ -109,19 +109,19 @@ The following command builds the production image:
109109
docker build -t paddle -f build/Dockerfile .
110110
```
111111

112-
This production image is minimal -- it includes binary `paddle`, the share library `libpaddle.so`, and Python runtime.
112+
This production image is minimal -- it includes binary `paddle`, the shared library `libpaddle.so`, and Python runtime.
113113

114114
### Run PaddlePaddle Applications
115115

116-
Again the development happens on the host. Suppoose that we have a simple application program in `a.py`, we can test and run it using the production image:
116+
Again the development happens on the host. Suppose that we have a simple application program in `a.py`, we can test and run it using the production image:
117117

118118
```bash
119119
docker run -it -v $PWD:/work paddle /work/a.py
120120
```
121121

122122
But this works only if all dependencies of `a.py` are in the production image. If this is not the case, we need to build a new Docker image from the production image and with more dependencies installs.
123123

124-
### Build and Run PaddlePaddle Appications
124+
### Build and Run PaddlePaddle Applications
125125

126126
We need a Dockerfile in https://github.com/paddlepaddle/book that builds Docker image `paddlepaddle/book:<version>`, basing on the PaddlePaddle production image:
127127

@@ -143,7 +143,7 @@ docker build -t book .
143143

144144
### Build and Run Distributed Applications
145145

146-
In our [API design doc](https://github.com/PaddlePaddle/Paddle/blob/develop/doc/design/api.md#distributed-training), we proposed an API that starts a distributed training job on a cluster. This API need to build a PaddlePaddle application into a Docekr image as above, and calls kubectl to run it on the cluster. This API might need to generate a Dockerfile look like above and call `docker build`.
146+
In our [API design doc](https://github.com/PaddlePaddle/Paddle/blob/develop/doc/design/api.md#distributed-training), we proposed an API that starts a distributed training job on a cluster. This API need to build a PaddlePaddle application into a Docker image as above and calls kubectl to run it on the cluster. This API might need to generate a Dockerfile look like above and call `docker build`.
147147

148148
Of course, we can manually build an application image and launch the job using the kubectl tool:
149149

0 commit comments

Comments
 (0)