UiPath Documentation
robot
2021.10
false
机器人用户指南
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

Linux 机器人

在 Linux 环境中使用机器人可让您在 Docker 容器中运行无人值守的自动化,并提供更快的体验和更轻松的扩展部署方式。

The Linux robot runs processes developed as cross-platform in Studio that do not require UI Interaction.

先决条件

开发跨平台自动化

Linux 机器人只能运行不需要用户界面的无人值守自动化。为此,在创建自动化时,请确保选择 Cross-platform

这样,系统将仅显示跨平台活动,而隐藏不支持的活动。

跨平台项目的默认活动包为:

  • UiPath.System.Activities
  • UiPath.WebAPI.Activities

部署

要在 Linux 环境中部署无人值守机器人,请按照以下步骤操作:

Orchestrator 配置

Create an unattended robot in orchestrator, as shown in this document, then save the machine key so it can be used later.

客户端计算机

  1. 打开命令行终端,使用以下命令获取 Docker 映像:

    docker pull registry.uipath.com/robot/runtimedocker pull registry.uipath.com/robot/runtime:<tag>
    docker pull registry.uipath.com/robot/runtimedocker pull registry.uipath.com/robot/runtime:<tag>
    
  2. 使用以下命令启动机器人映像并将机器人连接到 Orchestrator:

    docker run -e LICENSE_AGREEMENT=accept -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -e MACHINE_KEY="$KEY"-tid registry.uipath.com/robot/runtimedocker run -e LICENSE_AGREEMENT=accept -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -e MACHINE_KEY="$KEY" -tid registry.uipath.com/robot/runtime:<tag>
    docker run -e LICENSE_AGREEMENT=accept -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -e MACHINE_KEY="$KEY"-tid registry.uipath.com/robot/runtimedocker run -e LICENSE_AGREEMENT=accept -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -e MACHINE_KEY="$KEY" -tid registry.uipath.com/robot/runtime:<tag>
    
    备注:

    要检索或启动 Robot 的特定版本,请将 <tag> 参数替换成下表中“Docker 映像标签”列中的实际版本:

    机器人版本Docker 映像标签
    2021.1021.10.7

    21.10.6

    21.10.5

    21.10.3

    如果未使用任何标签,系统则会检索最新企业版补丁。

    重要提示:

    如果您在将机器人连接到 Orchestrator 时遇到问题,则可能是由于主机配置原因(例如,防火墙规则)。要解决此问题,请在命令中添加特定的 DNS 服务器。

    示例:docker run --dns="1.1.1.1" -e LICENSE_AGREEMENT=accept -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -e MACHINE_KEY="$KEY" -tid registry.uipath.com/robot/runtime

    其中 1.1.1.1 是指 Cloudflare 的公共 DNS 解析程序。这可以是能够解析 SignalR Hub 的任何 DNS 解析程序。

    重要提示:
    • 为了成功启动机器人,您必须通过在命令中添加 -e LICENSE_AGREEMENT=accept 参数来接受许可协议。
    • 每次运行第 2 步中显示的命令时,都会在 Orchestrator 中生成一个新机器人。
  3. 要查看计算机上机器人的状态,请使用以下命令:

    docker ps -a
    docker ps -a
    
  4. 如要断开机器人连接,请使用以下命令:

    docker stop {container_id}
    docker stop {container_id}
    
    重要提示:

    使用 docker kill container_id 将在计算机上停止机器人,但不会将其与 Orchestrator 断开连接。

  5. 要重新连接特定机器人,请使用以下命令:

    docker start {container_id}
    docker start {container_id}
    

Logging

如果您需要在容器实例的生命周期之外保留日志文件,请使用以下命令:

docker run -e LICENSE_AGREEMENT=accept -e MACHINE_KEY="{machine_key}" -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -v C:\Users\user.name\Desktop\logs:/root/.local/share/UiPath/Logs/ -ti registry.uipath.com/robot/runtime
docker run -e LICENSE_AGREEMENT=accept -e MACHINE_KEY="{machine_key}" -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -v C:\Users\user.name\Desktop\logs:/root/.local/share/UiPath/Logs/ -ti registry.uipath.com/robot/runtime
备注:

Robot Linux 映像基于 mcr.microsoft.com/dotnet/runtime 的 Alpine Linux 版本。应用程序所需的所有文件都放置在 /root/application directory 中。

在 Linux 机器人上运行作业

在 Linux 机器人上运行无人值守作业的过程与 Windows 相同。

远程调试

要测试您的流程,您可以使用以下命令启用调试模式:

docker run -e LICENSE_AGREEMENT=accept -e DEBUG_SESSION=true -ti -p8573:8573 registry.uipath.com/robot/runtime
docker run -e LICENSE_AGREEMENT=accept -e DEBUG_SESSION=true -ti -p8573:8573 registry.uipath.com/robot/runtime

The command starts a new Robot Container with the Debug feature enabled running on port 8573. After the container is started, you can connect to the docker image using the host machine ip and the port 8573 making use of the Studio Remote Debugging feature.

If you want to debug an already started Robot container you can use the unattended robot connection feature with a robot container connected to the orchestrator.

  • 先决条件
  • 开发跨平台自动化
  • 部署
  • Orchestrator 配置
  • 客户端计算机
  • 日志记录
  • 在 Linux 机器人上运行作业
  • 远程调试

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新