Skip to content

Commit 9236e53

Browse files
authored
Merge pull request #36616 from yanrongshi/zh-cn]Sync-docs/tasks/job/indexed-parallel-processing-static.md
[zh-cn]Sync /docs/tasks/job/indexed-parallel-processing-static.md
2 parents 37076e7 + 4d1ee8f commit 9236e53

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

content/zh-cn/docs/tasks/job/fine-parallel-processing-work-queue.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Here is an overview of the steps in this example:
5959

6060
## {{% heading "prerequisites" %}}
6161

62-
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
62+
{{< include "task-tutorial-prereqs.md" >}}
6363

6464
<!--
6565
Be familiar with the basic,
@@ -195,12 +195,14 @@ Job 中每个 Pod 内的 “工作程序” 使用工作队列客户端库获取
195195
{{< codenew language="python" file="application/job/redis/worker.py" >}}
196196

197197
<!--
198-
You could download [`worker.py`](/examples/application/job/redis/worker.py), [`rediswq.py`](/examples/application/job/redis/rediswq.py), and [`Dockerfile`](/examples/application/job/redis/Dockerfile)
199-
using above links. Then build the image:
198+
You could also download [`worker.py`](/examples/application/job/redis/worker.py),
199+
[`rediswq.py`](/examples/application/job/redis/rediswq.py), and
200+
[`Dockerfile`](/examples/application/job/redis/Dockerfile) files, then build
201+
the image:
200202
-->
201203
你也可以下载 [`worker.py`](/examples/application/job/redis/worker.py)
202204
[`rediswq.py`](/examples/application/job/redis/rediswq.py)
203-
[`Dockerfile`](/examples/application/job/redis/Dockerfile)。然后构建镜像:
205+
[`Dockerfile`](/examples/application/job/redis/Dockerfile) 文件。然后构建镜像:
204206

205207
```shell
206208
docker build -t job-wq-2 .
@@ -334,6 +336,7 @@ kubectl logs pods/job-wq-2-7r7b2
334336
```
335337

336338
日志类似于:
339+
337340
```
338341
Worker with sessionID: bbd72d0a-9e5c-4dd6-abf6-416cc267991f
339342
Initial queue state: empty=False
@@ -356,7 +359,8 @@ As you can see, one of our pods worked on several work units.
356359

357360
<!--
358361
If running a queue service or modifying your containers to use a work queue is inconvenient, you may
359-
want to consider one of the other [job patterns](/docs/concepts/jobs/run-to-completion-finite-workloads/#job-patterns).
362+
want to consider one of the other
363+
[job patterns](/docs/concepts/workloads/controllers/job/#job-patterns).
360364
-->
361365
如果你不方便运行一个队列服务或者修改你的容器用于运行一个工作队列,你可以考虑其它的
362366
[Job 模式](/zh-cn/docs/concepts/workloads/controllers/job/#job-patterns)

content/zh-cn/docs/tasks/job/indexed-parallel-processing-static.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ Pod 具有控制平面自动设置的**索引编号(index number)**,
3131
The pod index is available in the {{< glossary_tooltip text="annotation" term_id="annotation" >}}
3232
`batch.kubernetes.io/job-completion-index` as a string representing its
3333
decimal value. In order for the containerized task process to obtain this index,
34-
you can publish the value of the annotation using the [downward API](/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/#the-downward-api)
34+
you can publish the value of the annotation using the [downward API](/docs/concepts/workloads/pods/downward-api/)
3535
mechanism.
3636
For convenience, the control plane automatically sets the downward API to
3737
expose the index in the `JOB_COMPLETION_INDEX` environment variable.
3838
-->
3939
Pod 索引在{{<glossary_tooltip text="注解" term_id="annotation" >}}
4040
`batch.kubernetes.io/job-completion-index` 中呈现,具体表示为一个十进制值字符串。
4141
为了让容器化的任务进程获得此索引,你可以使用
42-
[downward API](/zh-cn/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/#the-downward-api)
42+
[downward API](/zh-cn/docs/concepts/workloads/pods/downward-api/)
4343
机制发布注解的值。为方便起见,
4444
控制平面自动设置 Downward API 以在 `JOB_COMPLETION_INDEX` 环境变量中公开索引。
4545

@@ -91,8 +91,8 @@ To access the work item from the worker program, you have a few options:
9191
1. 读取 `JOB_COMPLETION_INDEX` 环境变量。Job
9292
{{< glossary_tooltip text="控制器" term_id="controller" >}}
9393
自动将此变量链接到包含完成索引的注解。
94-
1. 读取包含完整索引的文件。
95-
1. 假设你无法修改程序,你可以使用脚本包装它,
94+
2. 读取包含完整索引的文件。
95+
3. 假设你无法修改程序,你可以使用脚本包装它,
9696
该脚本使用上述任意方法读取索引并将其转换为程序可以用作输入的内容。
9797

9898
<!--

0 commit comments

Comments
 (0)