xintongsong commented on a change in pull request #12865:
URL: https://github.com/apache/flink/pull/12865#discussion_r457283968



##########
File path: docs/ops/external_resources.zh.md
##########
@@ -23,98 +23,90 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-In addition to CPU and memory, many workloads also need some other resources, 
e.g. GPUs for deep learning. To support external
-resources, Flink provides an external resource framework. The framework 
supports requesting various types of resources from the
-underlying resource management systems (e.g., Kubernetes), and supplies 
information needed for using these resources to the operators.
-Different resource types can be supported. You can either leverage built-in 
plugins provided by Flink (currently only for GPU support),
-or implement your own plugins for custom resource types.
+许多计算任务需要使用除了 CPU 与内存外的资源,如用深入学习场景需要使用 GPU 来进行加速。为了支持这种扩展资源,Flink 提供了一
+个扩展资源框架。该框架支持从底层资源管理系统(如 Kubernetes)请求各种类型的资源,并向 Operator 提供使用这些资源所需的信息。该框架
+以插件形式支持不同的资源类型。目前 Flink 仅内置了支持 GPU 资源的插件,你可以为你想使用的资源类型实现第三方插件。
 
 * This will be replaced by the TOC
 {:toc}
 
-# What the external resource framework does
+<a name="what-the-external-resource-framework-does"></a>
 
-In general, the external resource framework does two things:
+# 扩展资源框架做了什么
 
-  - Set the corresponding fields of the resource requests (for requesting 
resources from the underlying system) with respect to your configuration.
+External resource 框架主要做了以下两件事:
 
-  - Provide operators with the *information* needed for using the resources.
+  - 根据你的配置,在 Flink 从底层资源管理系统中申请资源时,设置与扩展资源相关的字段
 
-When deployed on resource management systems (Kubernetes / Yarn), the external 
resource framework will ensure that the allocated pod/container
-will contain the desired external resources. Currently, many resource 
management systems support external resources. For example,
-Kubernetes supports GPU, FPGA, etc. through its [Device 
Plugin](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/)
-mechanism since v1.10, and Yarn supports GPU and FPGA resources since 2.10 and 
3.1. External resources are not supported by Flink’s Mesos
-integration at the moment. In Standalone mode, the user has to ensure that the 
external resources are available.
+  - 为 Operator 提供使用这些资源所需要的*信息*
 
-The external resource framework will provide the corresponding *information* 
to operators. The external resource information,
-which contains the basic properties needed for using the resources, is 
generated by the configured external resource *drivers*.
+当 Flink 部署在资源管理系统(Kubernetes、Yarn)上时,扩展资源框架将确保分配的 Pod、Container 
包含所需的扩展资源。目前,许多资源
+管理系统都支持扩展资源。例如,Kubernetes 从 v1.10 开始通过 [Device 
Plugin](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/)
 机制
+支持 GPU、FPGA 等资源调度,Yarn 从 2.10 和 3.1 开始支持 GPU 和 FPGA 的调度。目前,扩展资源框架并不支持 Mesos 
模式。在 Standalone 模式下,由用户负责确保扩展资源的可用性。
 
-# Enable the external resource framework for your workload
+扩展资源框架向 Operator 提供扩展资源相关*信息*,这些信息由你配置的扩展资源 *Driver* 生成,包含了使用扩展资源所需要的基本属性。
 
-To enable an external resource with the external resource framework, you need 
to:
+<a name="enable-the-external-resource-framework-for-your-workload"></a>
 
-  - Prepare the external resource *plugin*.
+# 启用扩展资源框架
 
-  - Set configurations for the external resource.
+为了启用扩展资源框架来使用扩展资源,你需要:
 
-  - Get the external resource *information* from `RuntimeContext` and use it 
in your operators.
+  - 为该扩展资源准备扩展资源框架的*插件*
 
-## Prepare plugins
+  - 为该扩展资源设置相关的配置
 
-You need to prepare the external resource plugin and put it into the 
`plugins/` folder of your Flink distribution, see
-[Flink Plugins]({% link ops/plugins.zh.md %}). Apache Flink provides a 
first-party [plugin for GPU resources](#plugin-for-gpu-resources). You can also
-[implement a plugin for your custom resource 
type](#implement-a-plugin-for-your-custom-resource-type).
+  - 在你的 Operator 中,从 `RuntimeContext` 来获取扩展资源的*信息*并使用这些资源
 
-## Configurations
+<a name="prepare-plugins"></a>
 
-First, you need to add resource names for all the external resource types to 
the **external resource list (with the configuration key ‘external-resources’)**
-with delimiter ";", e.g. "external-resources: gpu;fpga" for two external 
resources "gpu" and "fpga". Only the **\<resource_name\>**
-defined here will go into effect in the external resource framework.
+## 准备插件
 
-For each external resource, you could configure the below options. The 
**\<resource_name\>** in all the below configuration options
-corresponds to the name listed in the **external resource list**:
+你需要为使用的扩展资源准备插件,并将其放入 Flink 发行版的 `plugins/` 文件夹中, 参看 [Flink Plugins]({% link 
ops/plugins.zh.md %})。
+Flink 提供了第一方的 [GPU 
资源插件](#plugin-for-gpu-resources)。你同样可以为你所使用的扩展资源实现自定义插件[实现自定义插件](#implement-a-plugin-for-your-custom-resource-type)。
 
-  - **Amount** (`external.<resource_name>.amount`): This is the quantity of 
the external resource that should be requested from the external system.
+## 配置项
 
-  - **Config key in Yarn** 
(`external-resource.<resource_name>.yarn.config-key`): *optional*. If 
configured, the external
-  resource framework will add this key to the resource profile of container 
requests for Yarn. The value will be set to the
-  value of `external-resource.<resource_name>.amount`.
+首先,你需要使用分隔符“;”将所有使用的扩展资源类型的资源名称添加到 **扩展资源列表(配置键“external-resources”)** 
中,例如,“external-resources: gpu;fpga”定义了两个扩展资源“gpu”和“fpga”。
+只有此处定义了扩展资源名称(**\<resource_name\>**),相应的资源才会在扩展资源框架中生效。
 
-  - **Config key in Kubernetes** 
(`external-resource.<resource_name>.kubernetes.config-key`): *optional*. If 
configured,
-  external resource framework will add `resources.limits.<config-key>` and 
`resources.requests.<config-key>` to the main
-  container spec of TaskManager and set the value to the value of 
`external-resource.<resource_name>.amount`.
+对于每个扩展资源,有以下配置选项。下面的所有配置选项中的 **\<resource_name\>** 对应于 **扩展资源列表** 中列出的名称:
 
-  - **Driver Factory** 
(`external-resource.<resource_name>.driver-factory.class`): *optional*. Defines 
the factory class

Review comment:
       Ok, that makes sense. I would suggest to explain this for both languages.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to