批处理模拟作业 - AWS RoboMaker

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

批处理模拟作业

此部分提供了有关如何启动和管理模拟作业批处理的信息。使用模拟作业批处理功能时,您可以使用单个 API 调用启动和运行许多模拟,以执行回归测试、参数优化、机器学习模型训练和合成数据生成。

注意

只能使用 AWS RoboMaker 开发工具包或 AWS CLI 启动模拟作业批处理。您可以使用 AWS RoboMaker 控制台查看、克隆和取消模拟批处理。

启动模拟作业批处理

从 AWS 开发工具包或 AWS CLI 启动模拟作业批处理。一个模拟作业批处理包含一个或多个模拟作业请求。每个模拟作业请求将标识每个模拟中要使用的应用程序、作业的最长持续时间以及其他信息。可以将标签应用于模拟作业批处理和每个模拟作业请求。

要启动模拟作业批处理,您必须执行以下操作:
  1. 安装 AWS Command Line Interface。有关安装 AWS CLI 的更多信息,请参阅安装 AWS CLI

  2. 将以下 JSON 复制到名为 startsimjobbatch.json 的文件中。修改文件以匹配所需的配置,然后保存文件。

    { "batchPolicy": { "timeoutInSeconds": 400, "maxConcurrency": 2 }, "createSimulationJobRequests": [ { "maxJobDurationInSeconds": 300, "iamRole": "arn:aws:iam::111111111111:role/MyRole", "failureBehavior": "Fail", "robotApplications": [ { "application": "arn:aws:robomaker:us-east-1:111111111111:robot-application/MyRobotApplicationArn", "launchConfig": { "packageName": "hello_world_robot", "launchFile": "rotate.launch" } } ], "simulationApplications": [ { "application": "arn:aws:robomaker:us-east-1:111111111111:simulation-applicationMySimulationApplicationArn", "launchConfig": { "command": [ "roslaunch", "hello_world_robot", "rotate.launch" ] } } ], "tags": { "myRequestTagKey" : "myRequestTagValue" } }, { "maxJobDurationInSeconds": 300, "iamRole": "arn:aws:iam::111111111111:role/MyRole", "failureBehavior": "Fail", "simulationApplications": [ { "application": "arn:aws:robomaker:us-east-1:111111111111:simulation-applicationMySimulationApplicationArn", "launchConfig": { "command": [ "roslaunch", "hello_world_simulation", "empty_world.launch" ] } } ] } ], "tags": { "myBatchTagKey" : "myBatchTagValue" } }
  3. 打开命令提示符,然后运行以下 AWS CLI 命令:

    $ aws robomaker start-simulation-job-batch --cli-input-json file://startsimjobbatch.json

    要查看模拟作业批处理,请参阅 查看模拟作业批处理

查看模拟作业批处理

您可以查看有关模拟作业批处理的信息,包括有关该批处理中的模拟作业请求的详细信息。

查看模拟作业批处理的详细信息

请按照以下选项卡之一中的步骤进行操作:

Using the console
  1. 通过以下网址登录到 AWS RoboMaker 控制台:https://console.aws.amazon.com/robomaker/

  2. 在左侧导航窗格中,选择 Simulations (模拟),然后选择 Simulation job batches (模拟作业批处理)

  3. 选择模拟作业批处理的 Id 以查看其详细信息。

Using the AWS CLI

下面是一个示例 AWS CLI 命令,它执行的操作与在另一个选项卡中基于控制台的查看模拟作业等效。

aws robomaker list-simulation-job-batches aws robomaker describe-simulation-job-batch --job my-simulation-job-batch-arn

取消模拟作业批处理

您可以取消正在运行且不再需要的模拟作业。

取消模拟作业

请按照以下选项卡之一中的步骤进行操作:

Using the console
  1. 通过以下网址登录到 AWS RoboMaker 控制台:https://console.aws.amazon.com/robomaker/

  2. 在左侧导航窗格中,选择 Simulations (模拟),然后选择 Simulation job batches (模拟作业批处理)

  3. 选择要取消的模拟作业批处理的 Id

  4. Simulation job batch detail (模拟作业批处理详细信息) 页面中的 Batch actions (批处理操作) 下,选择 Cancel batch (取消批处理)

  5. Cancel simulation job batch (取消模拟作业批处理) 页面中,选择 Cancel (取消)

Using the AWS CLI

下面是一个示例 AWS CLI 命令,它执行的操作与在另一个选项卡中基于控制台的取消模拟作业等效。

$ aws robomaker list-simulation-job-batches $ aws robomaker cancel-simulation-job-batch --job my-simulation-job-batch-arn

克隆模拟作业批处理

可以通过克隆现有批处理来启动新的模拟作业批处理。在进行克隆时,可以包含所有模拟作业请求或选择一部分请求。

注意

ROS 和 Gazebo 软件套件的模拟作业批处理不适用于克隆。有关更多信息,请参阅支持策略

要克隆模拟作业批处理,请执行以下操作:
  1. 通过以下网址登录到 AWS RoboMaker 控制台:https://console.aws.amazon.com/robomaker/

  2. 在左侧导航窗格中,选择 Simulations (模拟),然后选择 Simulation job batches (模拟作业批处理)

  3. 选择要克隆的模拟作业批处理的 Id

  4. 要克隆整个批处理,请在 Simulation job batch detail (模拟作业批处理详细信息) 页面中的 Batch actions (批处理操作) 下,选择 Clone batch (克隆批处理)

    要克隆批处理中的特定模拟作业请求,请在 Simulation job requests (模拟作业请求) 下,选择要克隆的模拟作业请求,再选择 Request actions (请求操作),然后选择 Clone request (克隆请求)

  5. Clone simulation job batch (克隆模拟作业批处理) 页面中,选择 Submit (提交)