# SOME DESCRIPTIVE TITLE.
# Copyright (C) 1999-2020, The Alibaba Group Holding Ltd.
# This file is distributed under the same license as the mars package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2020.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: mars 0.5.0a2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-16 16:05+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"

#: ../../source/installation/kubernetes.rst:4
msgid "Run on Kubernetes"
msgstr "在 Kubernetes 中部署"

#: ../../source/installation/kubernetes.rst:6
msgid ""
"Mars can run in clusters managed by `Kubernetes "
"<https://kubernetes.io>`_. You can use ``mars.deploy.kubernetes`` to set "
"up a Mars cluster."
msgstr ""
"Mars 支持在 `Kubernetes <https://kubernetes.io>`_ 管理的集群中执行。你"
"可以使用 ``mars.deploy.kubernetes`` 模块配置一个 Mars 集群。"

#: ../../source/installation/kubernetes.rst:10
msgid "Basic steps"
msgstr "基本步骤"

#: ../../source/installation/kubernetes.rst:11
msgid ""
"Mars uses image repository ``marsproject/mars`` by default. Each released"
" version of Mars has its image since v0.3.0. For instance, the image for "
"version 0.3.0 is ``marsproject/mars:v0.3.0``.  If you need to build an "
"image from source, you may run the command below:"
msgstr ""
"Mars 默认会使用 ``marsproject/mars`` 中的镜像。自 v0.3.0 起，每个 Mars 的"
"发布版本均会包含一个镜像，例如 v0.3.0 对应的镜像是 ``marsproject/mars:"
"v0.3.0``。如果你希望从源码制作一个镜像，可以使用下面的命令："

#: ../../source/installation/kubernetes.rst:20
msgid "A docker image with Mars tagged with the current version will be built."
msgstr "一个使用当前版本号作为标签的 Docker 镜像将被制作出来。"

#: ../../source/installation/kubernetes.rst:22
msgid ""
"Then you need to make sure if you have correct client configurations for "
"Kubernetes by running"
msgstr "接下来，你需要运行下面的命令来保证 Kubernetes 的客户端配置是正确的："

#: ../../source/installation/kubernetes.rst:29
msgid ""
"If it reports an error, please consult documentations for kubernetes or "
"your cluster maintainer for more information."
msgstr "如果上述命令报错，请参考 Kubernetes 相关文档或者咨询集群维护人员。"

#: ../../source/installation/kubernetes.rst:32
msgid ""
"As Mars uses Python to operate on Kubernetes, you also need to install "
"Kubernetes client for Python locally. It can be installed with ``pip`` or"
" ``conda``:"
msgstr ""
"由于 Mars 使用 Python 操作 Kubernetes，你需要在本地使用 ``pip`` 或者 ``"
"conda`` 安装 Python 上的 Kubernetes 客户端："

#: ../../source/installation/kubernetes.rst:43
msgid ""
"After all these steps we can create a Mars cluster with one supervisor "
"and one worker with kubernetes and run some jobs on it:"
msgstr ""
"在完成上述所有步骤后，我们可以创建一个拥有单一 Supervisor 和单一 Worker "
"的 Kubernetes 集群实例，并在上面执行一些作业："

#: ../../source/installation/kubernetes.rst:62
msgid ""
"When you want to use this cluster elsewhere, you can obtain ``namespace``"
" and ``endpoint`` from the custer object and create another "
"``KubernetesClusterClient``:"
msgstr ""
"如果你需要在其他地方使用刚创建的集群，你可以从 cluster 对象获取 ``"
"namespace`` 和 ``endpoint`` 参数，此后创建另一个 ``"
"KubernetesClusterClient``："

#: ../../source/installation/kubernetes.rst:79
msgid "Customizing cluster"
msgstr "定制集群"

#: ../../source/installation/kubernetes.rst:80
msgid ""
"``new_cluster`` function provides several keyword arguments for users to "
"define the cluster. You may use the argument ``image`` to specify the "
"image for all Mars pods, or use the argument ``timeout`` to specify "
"timeout of cluster creation.  Arguments for scaling up and out of the "
"cluster are also available."
msgstr ""
"``new_cluster`` 函数提供若干可用于定制集群的参数。你可以使用 ``image`` "
"参数定义所有 Pod 使用的镜像，``timeout`` 参数定义创建集群的超时时间。同时"
"，该函数还提供调整集群规模的功能。"

#: ../../source/installation/kubernetes.rst:85
msgid "Arguments for supervisors:"
msgstr "Supervisor 相关参数："

#: ../../source/installation/kubernetes.rst:88
#: ../../source/installation/kubernetes.rst:103
msgid "Argument"
msgstr "参数"

#: ../../source/installation/kubernetes.rst:88
#: ../../source/installation/kubernetes.rst:103
msgid "Description"
msgstr "描述"

#: ../../source/installation/kubernetes.rst:90
msgid "supervisor_num"
msgstr ""

#: ../../source/installation/kubernetes.rst:90
msgid "Number of supervisors in the cluster, 1 by default"
msgstr "集群中 Supervisor 的数目，默认为 1"

#: ../../source/installation/kubernetes.rst:92
msgid "supervisor_cpu"
msgstr ""

#: ../../source/installation/kubernetes.rst:92
msgid "Number of CPUs for every supervisor"
msgstr "每个 Supervisor 的 CPU 数目"

#: ../../source/installation/kubernetes.rst:94
msgid "supervisor_mem"
msgstr ""

#: ../../source/installation/kubernetes.rst:94
msgid ""
"Memory size for supervisors in the cluster, in bytes or size units like "
"``1g``"
msgstr "每个 Supervisor 的内存大小，可使用字节数或带单位的大小，例如 ``1g``"

#: ../../source/installation/kubernetes.rst:97
msgid "supervisor_extra_env"
msgstr ""

#: ../../source/installation/kubernetes.rst:97
msgid "A mapping of environment variables to set in supervisors"
msgstr "在 Supervisor 中额外增加的环境变量，以 dict 表示"

#: ../../source/installation/kubernetes.rst:100
msgid "Arguments for workers:"
msgstr "Worker 相关参数："

#: ../../source/installation/kubernetes.rst:105
msgid "worker_num"
msgstr ""

#: ../../source/installation/kubernetes.rst:105
msgid "Number of workers in the cluster, 1 by default"
msgstr "集群中 Worker 的数目，默认为 1"

#: ../../source/installation/kubernetes.rst:107
msgid "worker_cpu"
msgstr ""

#: ../../source/installation/kubernetes.rst:107
msgid "Number of CPUs for every worker, required."
msgstr "每个 Worker 的 CPU 数目，此参数为必需"

#: ../../source/installation/kubernetes.rst:109
msgid "worker_mem"
msgstr ""

#: ../../source/installation/kubernetes.rst:109
msgid ""
"Memory size for workers in the cluster, in bytes or size units like "
"``1g``, required."
msgstr ""
"每个 Worker 的内存大小，可使用字节数或带单位的大小，例如 ``1g``，此参数为"
"必需"

#: ../../source/installation/kubernetes.rst:112
msgid "worker_spill_paths"
msgstr ""

#: ../../source/installation/kubernetes.rst:112
msgid "List of spill paths for worker pods on hosts"
msgstr "在宿主机上用于 Worker spill 的路径列表"

#: ../../source/installation/kubernetes.rst:114
msgid "worker_cache_mem"
msgstr ""

#: ../../source/installation/kubernetes.rst:114
msgid ""
"Size or ratio of shared memory for every worker. Details about memory "
"management of Mars workers can be found in :ref:`memory tuning "
"<worker_memory_tuning>` section."
msgstr ""
"Worker 中共享内存的大小或者占比。关于 Mars Worker 中的内存管理细节可以"
"参考 :ref:`内存调优 <worker_memory_tuning>` 章节。"

#: ../../source/installation/kubernetes.rst:118
msgid "min_worker_num"
msgstr ""

#: ../../source/installation/kubernetes.rst:118
msgid ""
"Minimal number of ready workers for ``new_cluster`` to return, "
"``worker_num`` by default"
msgstr ""
"``new_cluster`` 结束执行时所需的最小可用 Worker 个数，默认为 ``worker_num"
"``。"

#: ../../source/installation/kubernetes.rst:121
msgid "worker_extra_env"
msgstr ""

#: ../../source/installation/kubernetes.rst:121
msgid "A dict of environment variables to set in workers."
msgstr "在 Worker 中额外增加的环境变量，以 dict 表示"

#: ../../source/installation/kubernetes.rst:124
msgid ""
"For instance, if you want to create a Mars cluster with 1 supervisor and "
"100 workers, each worker has 4 cores and 16GB memory, and stop waiting "
"when 95 workers are ready, you can use the code below:"
msgstr ""
"例如，如果你需要创建一个包含单个 Supervisor 和 100 个 Worker 的 Mars 集群"
"，每个 Worker 拥有 4 核 16GB 内存，当 95 个 Worker 可用时认为整个集群可用"
"，你可以使用下面的代码："

#: ../../source/installation/kubernetes.rst:138
msgid "Implementation details"
msgstr "实现细节"

#: ../../source/installation/kubernetes.rst:139
msgid ""
"When ``new_cluster`` is called, it will create an independent `namespace "
"<https://kubernetes.io/docs/concepts/overview/working-with-"
"objects/namespaces/>`_ for all objects including roles, role bindings, "
"pods and services. When the user destroys the service, the whole "
"namespace will be destroyed."
msgstr ""
"当调用 ``new_cluster`` 时，该方法会为此后使用的每个 Kubernetes 对象，包括"
" Pod、Role等创建一个单独的 `名称空间 <https://kubernetes.io/docs/concepts"
"/overview/working-with-objects/namespaces/>`_ 。当用户停止服务时，整个 "
"Namespace 都会被删除。"

#: ../../source/installation/kubernetes.rst:144
msgid ""
"Supervisors and workers are created with `deployments "
"<https://kubernetes.io/docs/concepts/workloads/controllers/deployment/>`_."
" Services discover supervisors by directly accessing Kubernetes API via "
"the default `service account <https://kubernetes.io/docs/tasks/configure-"
"pod-container/configure-service-account/>`_. Pod addresses and their "
"readiness are read by workers to decide whether to start. Meanwhile the "
"client read statuses of all pods and check if all supervisors and at "
"least ``min_worker_num`` workers are ready."
msgstr ""
"Supervisor 和 Worker 使用 `Deployment <https://kubernetes.io/docs/"
"concepts/workloads/controllers/deployment/>`_ 创建。各种服务通过默认的 `"
"服务账户 <https://kubernetes.io/docs/tasks/configure-pod-container/"
"configure-service-account/>`_ 使用 Kubernetes API 发现 Supervisor。Worker"
" 读取 Pod 的地址和可用度来决定是否启动。与此同时，客户端通过读取所有 Pod "
"的可用度并确认所有 Supervisor 以及至少 ``min_worker_num`` 个 Worker 可用"
"。"

#: ../../source/installation/kubernetes.rst:153
msgid ""
"The readiness of Mars services are decided by `readiness probes "
"<https://kubernetes.io/docs/tasks/configure-pod-container/configure-"
"liveness-readiness-probes/>`_ whose result can be obtained via Pod "
"statuses. For supervisors and workers, when the service starts, an extra "
"port will be opened in the service and the pod can detect it."
msgstr ""
"Mars 服务的可用度由 `可用度检测器 <https://kubernetes.io/docs/tasks/"
"configure-pod-container/configure-liveness-readiness-probes/>`_ 确定，"
"检测结果可从 Pod 状态中获取。对于 Supervisor 和 Worker 而言，当服务启动时"
"，一个 ``ReadinessActor`` 将会在服务中被创建，检测器将检测该 Actor 是否"
"存在。对于 Web 服务，检测器将直接检测 Web 端口是否被创建。"

#: ../../source/installation/kubernetes.rst:159
msgid ""
"As the default service account does not have privilege to read pods in "
"Kubernetes API, we create `roles <https://kubernetes.io/docs/reference"
"/access-authn-authz/rbac/>`_ with capability to read and watch pods using"
" RBAC API, and then bind them to default service accounts within the "
"namespace before creating replication controllers. This enables Mars "
"containers to detect the status of other containers."
msgstr ""
"由于默认的服务账号不具备在 Kubernetes API 中读取 Pod 的权限，我们在创建"
"集群 Replication Controller 前，在名称空间内使用 RBAC API 创建了一个具备"
"读取和监视 Pod 状态的 `角色 <https://kubernetes.io/docs/reference/access-"
"authn-authz/rbac/>`_ ，此后将其绑定到默认账户中。这使得 Mars 容器可以检测"
"其他容器的状态。"

#: ../../source/installation/kubernetes.rst:166
msgid ""
"Mars uses `Kubernetes services <https://kubernetes.io/docs/concepts"
"/services-networking/service/>`_ to expose its service. Currently only "
"``NodePort`` mode is supported, and Mars looks for the web endpoint of "
"the supervisor as its endpoint. ``LoadBalancer`` mode is not supported "
"yet."
msgstr ""
"Mars 使用 `Kubernetes 服务 <https://kubernetes.io/docs/concepts/services-"
"networking/service/>`_ 对外暴露服务，目前仅支持 ``NodePort`` 模式。在此"
"模式下，Mars 将查找持有 Supervisor 的主机，并将其地址作为 Endpoint。``"
"LoadBalancer`` 模式尚未被支持。"

