You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by yu...@apache.org on 2022/05/27 17:59:50 UTC

[yunikorn-site] branch master updated: [YUNIKORN-1177] Add Chinese translation for user guide workloads documents (#154)

This is an automated email from the ASF dual-hosted git repository.

yuchaoran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-site.git


The following commit(s) were added to refs/heads/master by this push:
     new 0c04ad844 [YUNIKORN-1177] Add Chinese translation for user guide workloads documents (#154)
0c04ad844 is described below

commit 0c04ad84413a39652867a7a5ff5c9b04e9091db8
Author: Thinking Chen <cd...@hotmail.com>
AuthorDate: Sat May 28 01:59:46 2022 +0800

    [YUNIKORN-1177] Add Chinese translation for user guide workloads documents (#154)
---
 .../current/user_guide/workloads/run_flink.md      | 66 ++++++++++++++++++
 .../current/user_guide/workloads/run_spark.md      | 80 ++++++++++------------
 .../current/user_guide/workloads/run_tensorflow.md | 34 ++++-----
 3 files changed, 121 insertions(+), 59 deletions(-)

diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/user_guide/workloads/run_flink.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/user_guide/workloads/run_flink.md
new file mode 100644
index 000000000..40eb05b19
--- /dev/null
+++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/user_guide/workloads/run_flink.md
@@ -0,0 +1,66 @@
+---
+id: run_flink
+title: 运行Flink作业
+description: 如何与YuniKorn一起运行Flink作业
+image: https://svn.apache.org/repos/asf/flink/site/img/logo/png/100/flink_squirrel_100_color.png
+keywords:
+ - spark
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+使用 YuniKorn 在 Kubernetes 上运行 [Apache Flink](https://flink.apache.org/) 非常容易。
+根据在 Kubernetes 上运行 Flink 的模式不同,配置会略有不同。
+
+## Standalone(独立)模式
+
+请关注 [Kubernetes 设置](https://ci.apache.org/projects/flink/flink-docs-stable/ops/deployment/kubernetes.html) 以获取 standalone 部署模式的细节和示例。
+在这种模式下,我们可以直接在 Deployment/Job spec 中添加需要的标签(applicationId 和 queue)来使用 YuniKorn 调度器运行 flink 应用程序,以及 [使用 YuniKorn 调度器运行 workloads](#run-workloads-with-yunikorn-scheduler) .
+
+## Native(原生)模式
+
+请关注 [原生 Kubernetes 设置](https://ci.apache.org/projects/flink/flink-docs-stable/ops/deployment/native_kubernetes.html) 以获取原生部署模式的细节和示例。
+只有 Flink 1.11 或更高版本才支持在 native 模式下使用 YuniKorn 调度程序运行 Flink 应用程序,我们可以利用两个 Flink 配置 `kubernetes.jobmanager.labels` 和 `kubernetes.taskmanager.labels` 来设置所需的标签。
+例子:
+
+* 启动一个 Flink session
+```
+./bin/kubernetes-session.sh \
+  -Dkubernetes.cluster-id=<ClusterId> \
+  -Dtaskmanager.memory.process.size=4096m \
+  -Dkubernetes.taskmanager.cpu=2 \
+  -Dtaskmanager.numberOfTaskSlots=4 \
+  -Dresourcemanager.taskmanager-timeout=3600000 \
+  -Dkubernetes.jobmanager.labels=applicationId:MyOwnApplicationId,queue:root.sandbox \
+  -Dkubernetes.taskmanager.labels=applicationId:MyOwnApplicationId,queue:root.sandbox
+```
+
+* 启动一个 Flink application
+```
+./bin/flink run-application -p 8 -t kubernetes-application \
+  -Dkubernetes.cluster-id=<ClusterId> \
+  -Dtaskmanager.memory.process.size=4096m \
+  -Dkubernetes.taskmanager.cpu=2 \
+  -Dtaskmanager.numberOfTaskSlots=4 \
+  -Dkubernetes.container.image=<CustomImageName> \
+  -Dkubernetes.jobmanager.labels=applicationId:MyOwnApplicationId,queue:root.sandbox \
+  -Dkubernetes.taskmanager.labels=applicationId:MyOwnApplicationId,queue:root.sandbox \
+  local:///opt/flink/usrlib/my-flink-job.jar
+```
\ No newline at end of file
diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/user_guide/workloads/run_spark.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/user_guide/workloads/run_spark.md
index 9f748eb8a..b7f4f3ded 100644
--- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/user_guide/workloads/run_spark.md
+++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/user_guide/workloads/run_spark.md
@@ -1,7 +1,7 @@
 ---
 id: run_spark
-title: Run Spark Jobs
-description: How to run Spark jobs with YuniKorn
+title: 运行Spark作业
+description: 如何使用YuniKorn运行Spark作业
 keywords:
  - spark
 ---
@@ -25,24 +25,24 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-:::note
-This document assumes you have YuniKorn and its admission-controller both installed. Please refer to
-[get started](../../get_started/get_started.md) to see how that is done.
+:::note 注意
+本文档假设您已安装YuniKorn及其准入控制器。请参阅 [开始](../../get_started/get_started.md) 查看如何操作。
 :::
 
-## Prepare the docker image for Spark
+## 为Spark准备docker镜像
 
-To run Spark on Kubernetes, you'll need the Spark docker images. You can 1) use the docker images provided by the YuniKorn
-team, or 2) build one from scratch. If you want to build your own Spark docker image, you can
-* Download a Spark version that has Kubernetes support, URL: https://github.com/apache/spark
-* Build spark with Kubernetes support:
+要在Kubernetes上运行Spark,您需要Spark的docker镜像。您可以
+1)使用YuniKorn团队提供的docker镜像
+2)从头开始构建一个镜像。如果你想建立自己的Spark的docker镜像,您可以
+* 下载一个支持Kubernetes的Spark版本,URL: https://github.com/apache/spark
+* 构建支持Kubernetes的Spark版本:
 ```shell script
 mvn -Pyarn -Phadoop-2.7 -Dhadoop.version=2.7.4 -Phive -Pkubernetes -Phive-thriftserver -DskipTests package
 ```
 
-## Create a namespace for Spark jobs
+## 为Spark作业创建一个命名空间
 
-Create a namespace:
+创建一个命名空间:
 
 ```shell script
 cat <<EOF | kubectl apply -f -
@@ -53,7 +53,7 @@ metadata:
 EOF
 ```
 
-Create service account and cluster role bindings under `spark-test` namespace:
+在 `spark-test` 命名空间下创建 service account 和 cluster role bindings :
 
 ```shell script
 cat <<EOF | kubectl apply -n spark-test -f -
@@ -92,19 +92,19 @@ roleRef:
 EOF
 ```
 
-:::note
-Do NOT use `ClusterRole` and `ClusterRoleBinding` to run Spark jobs in production, please configure a more fine-grained
-security context for running Spark jobs. See more about how to configure proper RBAC rules [here](https://kubernetes.io/docs/reference/access-authn-authz/rbac/).
+:::注意
+不可以在生产环境使用 `ClusterRole` 和 `ClusterRoleBinding` 去运行一个Spark作业!
+请为运行Spark作业配置更细粒度的安全上下文。有关如何配置正确的RBAC规则的详细信息,请参见[链接](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)。
 :::
 
-## Submit a Spark job
+## 提交一个Spark作业
 
-If this is running from local machine, you will need to start the proxy in order to talk to the api-server.
+如果这是从本地计算机运行的,您需要启动代理才能与api服务器通信。
 ```shell script
 kubectl proxy
 ```
 
-Run a simple SparkPi job (this assumes that the Spark binaries are installed to `/usr/local` directory).
+运行一个简单的 SparkPi 作业(这假设Spark二进制文件已安装到 `/usr/local` 目录)。
 ```shell script
 export SPARK_HOME=/usr/local/spark-2.4.4-bin-hadoop2.7/
 ${SPARK_HOME}/bin/spark-submit --master k8s://http://localhost:8001 --deploy-mode cluster --name spark-pi \
@@ -118,32 +118,28 @@ ${SPARK_HOME}/bin/spark-submit --master k8s://http://localhost:8001 --deploy-mod
    local:///opt/spark/examples/jars/spark-examples_2.11-2.4.4.jar
 ```
 
-You'll see Spark driver and executors been created on Kubernetes:
+您可以看见Spark的driver和executors在Kubernetes上创建:
 
 ![spark-pods](./../../assets/spark-pods.png)
 
-You can also view the job info from YuniKorn UI. If you do not know how to access the YuniKorn UI, please read the document
-[here](../../get_started/get_started.md#访问-web-ui).
+您还可以从 YuniKorn UI 查看作业信息。如果您不知道如何访问 YuniKorn UI,请阅读文档
+[链接](../../get_started/get_started.md#访问-web-ui).
 
 ![spark-jobs-on-ui](./../../assets/spark-jobs-on-ui.png)
 
-## What happens behind the scenes?
-
-When the Spark job is submitted to the cluster, the job is submitted to `spark-test` namespace. The Spark driver pod will
-be firstly created under this namespace. Since this cluster has YuniKorn admission-controller enabled, when the driver pod
-get created, the admission-controller mutates the pod's spec and injects `schedulerName=yunikorn`, by doing this, the
-default K8s scheduler will skip this pod and it will be scheduled by YuniKorn instead. See how this is done by [configuring
-another scheduler in Kubernetes](https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/).
-
-The default configuration has placement rule enabled, which automatically maps the `spark-test` namespace to a YuniKorn
-queue `root.spark-test`. All Spark jobs submitted to this namespace will be automatically submitted to the queue first.
-To see more about how placement rule works, please see doc [placement-rules](user_guide/placement_rules.md). By far,
-the namespace defines the security context of the pods, and the queue determines how the job and pods will be scheduled
-with considering of job ordering, queue resource fairness, etc. Note, this is the simplest setup, which doesn't enforce
-the queue capacities. The queue is considered as having unlimited capacity.
-
-YuniKorn reuses the Spark application ID set in label `spark-app-selector`, and this job is submitted
-to YuniKorn and being considered as a job. The job is scheduled and running as there is sufficient resources in the cluster.
-YuniKorn allocates the driver pod to a node, binds the pod and starts all the containers. Once the driver pod gets started,
-it requests for a bunch of executor pods to run its tasks. Those pods will be created in the same namespace as well and
-scheduled by YuniKorn as well.
+## 幕后发生了什么?
+
+当Spark作业提交到集群时,该作业将提交到 `spark-test` 命名空间。Spark的driver的pod将首先在此名称空间下创建。
+由于该集群已启用YuniKorn准入控制器,当driver的pod创建后,准入控制器会修改pod的规范并注入 `schedulerName=yunikorn`,
+通过这样做默认K8s调度程序将跳过此pod,而由YuniKorn调度。请查看这里[在Kubernetes配置其他调度器](https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/)来了解是如何完成的.
+
+默认配置已启用放置规则,该规则会自动将 `spark-test` 命名空间映射到YuniKorn的队列 `root.spark test`。
+提交到此命名空间的所有Spark作业将首先自动提交到该队列。
+要了解有关放置规则如何工作的更多信息,请参阅文档[应用放置规则](user_guide/placement_rules.md)。
+到目前为止,名称空间定义pod的安全上下文,队列考虑到作业顺序、队列资源公平性等因素会确定如何调度作业和pod。
+注意,这是最简单的设置,不强制执行队列容量。该队列被视为具有无限容量。
+
+YuniKor在标签 `spark-app-selector` 中重复设置Spark的应用程序ID,并提交此作业去YuniKorn,同时被视为一份作业。
+当集群中有足够的资源时,作业被调度并运行。
+YuniKorn将driver的pod分配给一个节点,绑定pod并启动所有容器。
+一旦driver的pod启动,它会请求一堆executor的pod来运行它的任务。这些pod也将在相同的名称空间中创建,并且被YuniKorn所调度。
diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/user_guide/workloads/run_tensorflow.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/user_guide/workloads/run_tensorflow.md
index 9997e0c34..c5d708c5e 100644
--- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/user_guide/workloads/run_tensorflow.md
+++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/user_guide/workloads/run_tensorflow.md
@@ -1,7 +1,7 @@
 ---
 id: run_tf
-title: Run TensorFlow Jobs
-description: How to run TensorFlow jobs with YuniKorn
+title: 运行TensorFlow作业
+description: 如何使用 YuniKorn 运行 TensorFlow 作业
 keywords:
  - tensorflow
 ---
@@ -25,28 +25,27 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-This guide gives an overview of how to set up [training-operator](https://github.com/kubeflow/training-operator)
-and how to run a Tensorflow job with YuniKorn scheduler. The training-operator is a unified training operator maintained by
-Kubeflow. It not only supports TensorFlow but also PyTorch, XGboots, etc.
+本章节概述了如何设置 [training-operator](https://github.com/kubeflow/training-operator) 以及如何使用 YuniKorn 调度器运行 Tensorflow 作业。
+training-operator 是由 Kubeflow 维护的一体化集成的训练 operator。它不仅支持 TensorFlow,还支持 PyTorch、XGboots 等。
 
-## Install training-operator
-You can use the following command to install training operator in kubeflow namespace by default. If you have problems with installation,
-please refer to [this doc](https://github.com/kubeflow/training-operator#installation) for details.
+## 安装 training-operator
+您可以使用以下命令在 kubeflow 命名空间中默认安装 training operator。如果安装有问题,
+请参阅 [此文档](https://github.com/kubeflow/training-operator#installation) 来查找相关的详细信息。
 ```
 kubectl apply -k "github.com/kubeflow/training-operator/manifests/overlays/standalone?ref=v1.3.0"
 ```
 
-## Prepare the docker image
-Before you start running a TensorFlow job on Kubernetes, you'll need to build the docker image.
-1. Download files from [deployment/examples/tfjob](https://github.com/apache/yunikorn-k8shim/tree/master/deployments/examples/tfjob)
-2. To build this docker image with the following command
+## 准备 docker 镜像
+在开始于 Kubernetes 上运行 TensorFlow 作业之前,您需要构建 docker 镜像。
+1. 从 [deployment/examples/tfjob](https://github.com/apache/yunikorn-k8shim/tree/master/deployments/examples/tfjob) 上下载文件
+2. 使用以下命令构建这个 docker 镜像
 
 ```
 docker build -f Dockerfile -t kubeflow/tf-dist-mnist-test:1.0 .
 ```
 
-## Run a TensorFlow job
-Here is a TFJob yaml for MNIST [example](https://github.com/apache/yunikorn-k8shim/blob/master/deployments/examples/tfjob/tf-job-mnist.yaml).
+## 运行一个 TensorFlow 作业
+以下是一个使用 MNIST [样例](https://github.com/apache/yunikorn-k8shim/blob/master/deployments/examples/tfjob/tf-job-mnist.yaml) 的 TFJob yaml. 
 
 ```yaml
 apiVersion: kubeflow.org/v1
@@ -83,11 +82,12 @@ spec:
             - name: tensorflow
               image: kubeflow/tf-dist-mnist-test:1.0
 ```
-Create the TFJob
+创建 TFJob
 ```
 kubectl create -f deployments/examples/tfjob/tf-job-mnist.yaml
 ```
-You can view the job info from YuniKorn UI. If you do not know how to access the YuniKorn UI,
-please read the document [here](../../get_started/get_started.md#访问-web-ui).
+
+您可以从 YuniKorn UI 中查看作业信息。 如果您不知道如何访问 YuniKorn UI,
+请阅读此 [文档](../../get_started/get_started.md#访问-web-ui)。
 
 ![tf-job-on-ui](../../assets/tf-job-on-ui.png)