[zh]Resync tasks files[10]

This commit is contained in:
caodonghui 2021-05-13 11:25:53 +08:00
parent 2b38c750b1
commit df00b046cd
3 changed files with 20 additions and 19 deletions

View File

@ -2,7 +2,7 @@
title: 使用工作队列进行粗粒度并行处理
min-kubernetes-server-version: v1.8
content_type: task
weight: 30
weight: 20
---
<!--
@ -10,7 +10,7 @@ weight: 30
title: Coarse Parallel Processing Using a Work Queue
min-kubernetes-server-version: v1.8
content_type: task
weight: 30
weight: 20
---
-->
@ -28,7 +28,7 @@ Here is an overview of the steps in this example:
1. **Start a message queue service.** In this example, we use RabbitMQ, but you could use another
one. In practice you would set up a message queue service once and reuse it for many jobs.
1. **Create a queue, and fill it with messages.** Each message represents one task to be done. In
this example, a message is just an integer that we will do a lengthy computation on.
this example, a message is an integer that we will do a lengthy computation on.
1. **Start a Job that works on tasks from the queue**. The Job starts several pods. Each pod takes
one task from the message queue, processes it, and repeats until the end of the queue is reached.
-->
@ -63,7 +63,7 @@ non-parallel, use of [Job](/docs/concepts/jobs/run-to-completion-finite-workload
<!--
## Starting a message queue service
This example uses RabbitMQ, but it should be easy to adapt to another AMQP-type message service.
This example uses RabbitMQ, however, you can adapt the example to use another AMQP-type message service.
In practice you could set up a message queue service once in a
cluster and reuse it for many jobs, as well as for long-running services.
@ -72,7 +72,7 @@ Start RabbitMQ as follows:
-->
## 启动消息队列服务
本例使用了 RabbitMQ使用其他 AMQP 类型的消息服务应该比较容易
本例使用了 RabbitMQ但你可以更改该示例,使用其他 AMQP 类型的消息服务。
在实际工作中,在集群中一次性部署某个消息队列服务,之后在很多 Job 中复用,包括需要长期运行的服务。
@ -225,17 +225,17 @@ root@temp-loe07:/#
<!--
In the last command, the `amqp-consume` tool takes one message (`-c 1`)
from the queue, and passes that message to the standard input of an arbitrary command. In this case, the program `cat` is just printing
out what it gets on the standard input, and the echo is just to add a carriage
from the queue, and passes that message to the standard input of an arbitrary command. In this case, the program `cat` prints out the characters read from standard input, and the echo adds a carriage
return so the example is readable.
-->
最后一个命令中, `amqp-consume` 工具从队列中取走了一个消息,并把该消息传递给了随机命令的标准输出。在这种情况下,`cat` 只会打印它从标准输入或得的内容echo 只会添加回车符以便示例可读。
最后一个命令中, `amqp-consume` 工具从队列中取走了一个消息,并把该消息传递给了随机命令的标准输出。
在这种情况下,`cat` 会打印它从标准输入中读取的字符echo 会添加回车符以便示例可读。
<!--
## Filling the Queue with tasks
Now lets fill the queue with some "tasks". In our example, our tasks are just strings to be
Now let's fill the queue with some "tasks". In our example, our tasks are strings to be
printed.
In a practice, the content of the messages might be:

View File

@ -2,12 +2,12 @@
title: 使用工作队列进行精细的并行处理
content_type: task
min-kubernetes-server-version: v1.8
weight: 40
weight: 30
---
<!--
title: Fine Parallel Processing Using a Work Queue
content_type: task
weight: 40
weight: 30
min-kubernetes-server-version: v1.8
-->
@ -45,10 +45,10 @@ Here is an overview of the steps in this example:
<!--
1. **Create a queue, and fill it with messages.** Each message represents one task to be done. In
this example, a message is just an integer that we will do a lengthy computation on.
this example, a message is an integer that we will do a lengthy computation on.
-->
2. **创建一个队列,然后向其中填充消息。** 每个消息表示一个将要被处理的工作任务。
在这个例子中,消息是一个我们将用于进行长度计算的整数。
在这个例子中,消息是一个我们将用于进行长度计算的整数。
<!--
1. **Start a Job that works on tasks from the queue**. The Job starts several pods. Each pod takes
@ -97,14 +97,14 @@ You could also download the following files directly:
<!--
## Filling the Queue with tasks
Now let's fill the queue with some "tasks". In our example, our tasks are just strings to be
Now let's fill the queue with some "tasks". In our example, our tasks are strings to be
printed.
Start a temporary interactive pod for running the Redis CLI.
-->
## 使用任务填充队列
现在,让我们往队列里添加一些“任务”。在这个例子中,我们的任务是一些将被打印出来的字符串。
现在,让我们往队列里添加一些“任务”。在这个例子中,我们的任务是一些将被打印出来的字符串。
启动一个临时的可交互的 pod 用于运行 Redis 命令行界面。

View File

@ -2,13 +2,13 @@
title: 使用展开的方式进行并行处理
content_type: task
min-kubernetes-server-version: v1.8
weight: 20
weight: 50
---
<!--
title: Parallel Processing using Expansions
content_type: task
min-kubernetes-server-version: v1.8
weight: 20
weight: 50
-->
<!-- overview -->
@ -19,7 +19,7 @@ based on a common template. You can use this approach to process batches of work
parallel.
For this example there are only three items: _apple_, _banana_, and _cherry_.
The sample Jobs process each item simply by printing a string then pausing.
The sample Jobs process each item by printing a string then pausing.
See [using Jobs in real workloads](#using-jobs-in-real-workloads) to learn about how
this pattern fits more realistic use cases.
@ -29,7 +29,8 @@ this pattern fits more realistic use cases.
你可以用这种方法来并行执行批处理任务。
在本任务示例中只有三个工作条目_apple_、_banana_ 和 _cherry_
示例任务处理每个条目时仅仅是打印一个字符串之后结束。
示例任务处理每个条目时打印一个字符串之后结束。
参考[在真实负载中使用 Job](#using-jobs-in-real-workloads)了解更适用于真实使用场景的模式。
## {{% heading "prerequisites" %}}