机器人
2022.10
False
横幅背景图像
机器人用户指南
上次更新日期 2024年2月8日

Linux 机器人

Robot Linux 映像允许您在 docker 容器中运行跨平台自动化。

Robot Linux 映像基于 mcr.microsoft.com/dotnet/runtime 的 Ubuntu Linux 版本。应用程序所需的所有文件都位于 /application/ 目录中。

先决条件

部署

若要在 Linux 环境中使用机器人,请在 Orchestrator 中创建一个 Unattended Robot,保存客户端 ID 和客户端密码以便以后使用,然后在机器人计算机上执行以下步骤:

  1. 打开命令行终端,使用以下命令获取 Docker 映像:
    docker pull registry.uipath.com/robot/uiautomation-runtime:<tag>docker pull registry.uipath.com/robot/uiautomation-runtime:<tag>
    注意:如果未使用特定标签,系统则会检索最新企业版补丁。要检索或启动 Robot 的特定版本,请将 <tag> 参数替换成下表中“Docker 映像标签”列中的实际版本:
    机器人版本 Docker 映像标签
    2022.1022.10.68.11424-robot22.10.3
  2. 根据连接类型,您可以使用以下命令之一启动下载的映像并将机器人连接到 Orchestrator:
    重要提示:为了成功启动机器人,您必须通过在命令中添加 -e LICENSE_AGREEMENT=accept 参数来接受许可协议。
    1. 客户端 ID 和客户端密码:
      docker run -e LICENSE_AGREEMENT=accept -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_"-e CLIENT_ID="$Client_ID" -e CLIENT_SECRET="$Client_secret" -tid registry.uipath.com/robot/uiautomation-runtime:<tag>docker run -e LICENSE_AGREEMENT=accept -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_"-e CLIENT_ID="$Client_ID" -e CLIENT_SECRET="$Client_secret" -tid registry.uipath.com/robot/uiautomation-runtime:<tag>
    2. 计算机密钥
      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/uiautomation-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/uiautomation-runtime:<tag>
重要事项:如果您在将机器人连接到 Orchestrator 时遇到问题,则可能是由于主机配置原因(例如,防火墙规则)。要解决此问题,请在命令中添加特定的 DNS 服务器。

DNS 配置示例:

docker run --dns="1.1.1.1" -e LICENSE_AGREEMENT=accept -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -e CLIENT_ID="$Client_ID" -e CLIENT_SECRET="$Client_secret" -tid registry.uipath.com/robot/uiautomation-runtime:<tag>docker run --dns="1.1.1.1" -e LICENSE_AGREEMENT=accept -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -e CLIENT_ID="$Client_ID" -e CLIENT_SECRET="$Client_secret" -tid registry.uipath.com/robot/uiautomation-runtime:<tag>
其中 1.1.1.1 是指 Cloudflare 的公共 DNS 解析程序。这可以是能够解析 SignalR Hub 的任何 DNS 解析程序。
重要提示:每次在步骤 2 中运行命令时,系统都会在 Orchestrator 中创建一个新的 Unattended 会话。为避免这种情况,请使用 docker start {container_id} 命令启动已创建的容器。
  1. 要查看计算机上机器人的状态,请使用以下命令:
    docker ps -adocker ps -a
  2. 如要断开机器人连接,请使用以下命令:
    docker stop {container_id}docker stop {container_id}
    重要事项:使用 docker kill container_id 将在计算机上停止机器人,但不会将其与 Orchestrator 断开连接。
  3. 要重新连接特定机器人,请使用以下命令:
    docker start {container_id}docker start {container_id}

为 Linux 机器人创建自动化

Linux 机器人可以运行后台和前台(使用 Google Chrome)自动化。

如果要创建与 Linux 机器人兼容的网页自动化,请按照以下步骤操作:

  1. 新建流程时,请在 Studio 中选择跨平台项目类型。
  2. 在 Studio 中,从“ 包管理器” 中,将“用户界面自动化”活动包更新为最新版本。 此功能仅从 v21.11.0-preview 包开始提供。 由于您使用的是跨平台项目,因此仅显示支持跨平台项目的活动包。
  3. 要创建网页自动化,您还需要最新的 Chrome 扩展程序。您可以通过以下方式轻松安装:
    注意:在开始设计自动化之前,您必须安装 Chrome 扩展程序 v21.10.4 或更高版本。

为 Linux 机器人设计用户界面自动化项目时,可以对活动使用以下输入方法:

  • ChromiumAPI(默认)
  • “模拟单击”/“模拟类型”

此外,还支持以下向导:

  • 网页记录器
  • 表格数据提取

运行 Linux 机器人上的自动化

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

如果要查看流程的实时执行情况,则可以使用预先配置的 VNC 服务器(可通过 5900 默认端口访问)进行查看。要在流程执行期间连接到该端口,您需要在启动映像时通过向 Docker Run 命令添加 -p {localVncPort}:5900 --env VNC_ENABLED=true 参数来发布 VNC 端口。
docker run -e LICENSE_AGREEMENT=accept -e
ORCHESTRATOR_URL="{orchestrator url}" -e MACHINE_KEY="{machine_key}" -p 50000:5900 --env VNC_ENABLED=true registry.uipath.com/robot/uiautomation-runtime:<tag>docker run -e LICENSE_AGREEMENT=accept -e
ORCHESTRATOR_URL="{orchestrator url}" -e MACHINE_KEY="{machine_key}" -p 50000:5900 --env VNC_ENABLED=true registry.uipath.com/robot/uiautomation-runtime:<tag>
此命令支持您通过本地计算机 (50000 port) 使用 VNC 服务器。之后,您可以使用任何 VNC 客户端实时关注机器人的执行情况。

远程调试

您可以通过 Unattended Robot 连接功能调试已启动的机器人容器。

日志记录

与进程执行相关的日志位于 docker 映像的 /home/robotuser/.local/share/UiPath/Logs 文件夹中。

要从容器中提取日志,请使用以下命令:

docker cp <ContainerId>:/home/robotuser/.local/share/UiPath/Logs <TargetPath>

配置包订阅源

用于在 Linux 机器人上运行自动化的库位于 Docker 容器的 /application/Packages/ 目录中。可以通过使用以下命令安装包含 NuGet 库的目录来配置:
docker run -e LICENSE_AGREEMENT=accept -e MACHINE_KEY="{machine_key}" -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -v <path to packages on the host machine>:/application/Packages/ -ti registry.uipath.com/robot/uiautomation-runtimedocker run -e LICENSE_AGREEMENT=accept -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -e CLIENT_ID="$Client_ID" -e CLIENT_SECRET="$Client_secret" -v <path to packages on the host machine>:/application/Packages/ -ti registry.uipath.com/robot/uiautomation-runtime:<tag>docker run -e LICENSE_AGREEMENT=accept -e MACHINE_KEY="{machine_key}" -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -v <path to packages on the host machine>:/application/Packages/ -ti registry.uipath.com/robot/uiautomation-runtimedocker run -e LICENSE_AGREEMENT=accept -e ORCHESTRATOR_URL="https://cloud.uipath.com/organization/tentant/orchestrator_" -e CLIENT_ID="$Client_ID" -e CLIENT_SECRET="$Client_secret" -v <path to packages on the host machine>:/application/Packages/ -ti registry.uipath.com/robot/uiautomation-runtime:<tag>
其中的 <path to packages> 指主机上的位置。

确保机器人用户(UID 1000 用户)拥有包源已安装路径的读取权限。

此页面是否有帮助?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath 白色徽标
信任与安全
© 2005-2024 UiPath. All rights reserved.