k8s

Kubernetes + UIPath - 2

Kubernetes 에서 UIPath 프로세스 실행하기

by HOON


1

Last updated on March 26, 2025, 5:41 p.m.


random_image

안녕하세요, 이번에는 저번 포스트에 이어서 UIPath Linux Robot으로 백그라운드 프로세스를 가동해볼게요.

일단 테스트를 하면서 문제가 한가지 생겼었는데, 저번 포스트에서 Image를 registry.uipath.com/robot/runtime:latest 이걸로 사용했습니다.
해당 이미지로 생성되는 로봇의 버전은 아래와같이 22.4 버전을 갖고있습니다.

저는 현재 맥북으로 테스트를 진행중이라서 window만 지원되는 studio 설치는 불가능한 상황이고,
cloud uipath에 있는 cloud환경의 studio를 사용해 개발하고 배포했습니다.
그리고 생성한 머신(k8s 클러스터에 배포된 로봇)과 제가 작업할 Directory(test)를 연결해주었고, 머신이 연결된것까지 확인했습니다.

그렇게 배포된 프로세스를 실행하기위해 로봇을 설정하고 연결해주면??
실패하면서 아래와 같은 에러가 발생합니다. 역시 한번에 될리가 없어요 ㅜㅜ

UiPath.CoreIpc.NamedPipe.NamedPipeListener Error: 0 : /tmp/UiPathRobotServices_root 23484650 IExecutorContract Available 0. # System.Exception: Failed to install package 'backgroundtest2.1.0.2'
 ---> System.Exception: NU1202: Package backgroundtest2 1.0.2 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package backgroundtest2 1.0.2 supports: net8.0 (.NETCoreApp,Version=v8.0)
NU1202: Package backgroundtest2 1.0.2 is not compatible with net6.0 (.NETCoreApp,Version=v6.0) / alpine.3.14-x64. Package backgroundtest2 1.0.2 supports: net8.0 (.NETCoreApp,Version=v8.0)
   --- End of inner exception stack trace ---
   at UiPath.Service.Core.ProjectInstaller.InstallCore(InstallProjectCommand installCommand) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/ProjectInstaller.cs:line 65
   at UiPath.Service.Core.Telemetry.RobotTelemetryExtensions.WithTelemetry[TResult](IRobotTelemetryClient container, Func`1 internalFunc, RobotTelemetryOperationBase telemetryOperation, Action`1 telemetryArgsFunc) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Telemetry/RobotTelemetryClient.cs:line 66
   at UiPath.Service.Core.ProjectInstaller.InstallWithTelemetry(InstallProjectCommand installCommand) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/ProjectInstaller.cs:line 46
   at UiPath.Service.Core.ProjectInstaller.<>c__DisplayClass5_0.<<Install>b__0>d.MoveNext() in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/ProjectInstaller.cs:line 35
--- End of stack trace from previous location ---
   at UiPath.Service.Core.ProjectInstaller.Install(InstallProjectCommand installCommand) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/ProjectInstaller.cs:line 35
   at UiPath.Service.Core.PackageService.InstallProcess(PublishedProcess process, ImpersonableIdentity identity, IRobot robot, CancellationToken ct) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/PackageService.cs:line 53
   at UiPath.Service.Job.InstallPackage(ImpersonableIdentity identity, CancellationToken ct) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/Job.cs:line 186
   at UiPath.Service.Job.PrepareForExecution(ImpersonableIdentity identity, CancellationToken ct) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/Job.cs:line 174
   at UiPath.Service.Job.UiPath.Service.Core.IExecutorEvents.ExecutorAvailable(ImpersonableIdentity identity, CancellationToken ct) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/Job.cs:line 384
   at UiPath.Service.Core.ExecutorService.Available(AvailableMessage availableMessage) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Executor/ExecutorService.cs:line 40
   at UiPath.CoreIpc.Server.<>c__DisplayClass7_3.<<-ctor>g__InvokeMethod|6>d.MoveNext()
--- End of stack trace from previous location ---
   at UiPath.CoreIpc.Server.<>c__DisplayClass7_1.<<-ctor>g__HandleRequest|3>d.MoveNext()
--- End of stack trace from previous location ---
   at UiPath.CoreIpc.Server.<>c__DisplayClass7_2.<<-ctor>b__5>d.MoveNext()
--- End of stack trace from previous location ---
   at UiPath.CoreIpc.Helpers.Timeout[TResult](TimeSpan timeout, List`1 cancellationTokens, Func`2 func, String message, Func`2 exceptionHandler)
UiPath.Service.NetCoreHost Error: 0 : backgroundtest2/6c6f463b-1015-4ffc-afae-8086eb918a56 finished with Failed (was Preparing)
RemoteException wrapping System.Exception: Failed to install package 'backgroundtest2.1.0.2'  ---> RemoteException wrapping System.Exception: NU1202: Package backgroundtest2 1.0.2 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package backgroundtest2 1.0.2 supports: net8.0 (.NETCoreApp,Version=v8.0)
NU1202: Package backgroundtest2 1.0.2 is not compatible with net6.0 (.NETCoreApp,Version=v6.0) / alpine.3.14-x64. Package backgroundtest2 1.0.2 supports: net8.0 (.NETCoreApp,Version=v8.0)

    --- End of inner exception stack trace ---
   at UiPath.Service.Core.ProjectInstaller.InstallCore(InstallProjectCommand installCommand) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/ProjectInstaller.cs:line 65
   at UiPath.Service.Core.Telemetry.RobotTelemetryExtensions.WithTelemetry[TResult](IRobotTelemetryClient container, Func`1 internalFunc, RobotTelemetryOperationBase telemetryOperation, Action`1 telemetryArgsFunc) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Telemetry/RobotTelemetryClient.cs:line 66
   at UiPath.Service.Core.ProjectInstaller.InstallWithTelemetry(InstallProjectCommand installCommand) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/ProjectInstaller.cs:line 46
   at UiPath.Service.Core.ProjectInstaller.<>c__DisplayClass5_0.<<Install>b__0>d.MoveNext() in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/ProjectInstaller.cs:line 35
--- End of stack trace from previous location ---
   at UiPath.Service.Core.ProjectInstaller.Install(InstallProjectCommand installCommand) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/ProjectInstaller.cs:line 35
   at UiPath.Service.Core.PackageService.InstallProcess(PublishedProcess process, ImpersonableIdentity identity, IRobot robot, CancellationToken ct) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/PackageService.cs:line 53
   at UiPath.Service.Job.InstallPackage(ImpersonableIdentity identity, CancellationToken ct) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/Job.cs:line 186
   at UiPath.Service.Job.PrepareForExecution(ImpersonableIdentity identity, CancellationToken ct) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/Job.cs:line 174
   at UiPath.Service.Job.UiPath.Service.Core.IExecutorEvents.ExecutorAvailable(ImpersonableIdentity identity, CancellationToken ct) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Impl/Job.cs:line 384
   at UiPath.Service.Core.ExecutorService.Available(AvailableMessage availableMessage) in /home/vsts/work/1/s/Robot/UiPath.Service.Core/Executor/ExecutorService.cs:line 40
   at UiPath.CoreIpc.Server.<>c__DisplayClass7_3.<<-ctor>g__InvokeMethod|6>d.MoveNext()
--- End of stack trace from previous location ---
   at UiPath.CoreIpc.Server.<>c__DisplayClass7_1.<<-ctor>g__HandleRequest|3>d.MoveNext()
--- End of stack trace from previous location ---
   at UiPath.CoreIpc.Server.<>c__DisplayClass7_2.<<-ctor>b__5>d.MoveNext()
--- End of stack trace from previous location ---
   at UiPath.CoreIpc.Helpers.Timeout[TResult](TimeSpan timeout, List`1 cancellationTokens, Func`2 func, String message, Func`2 exceptionHandler)
UiPath.Service.NetCoreHost Information: 0 : Request uri: https://cloud.uipath.com/nonpevotdl/nonDefault/orchestrator_/api/robotsservice/SubmitJobState
UiPath.Service.NetCoreHost Information: 0 : Executor 6c6f463b-1015-4ffc-afae-8086eb918a56 closed with exit code Success
UiPath.Service.NetCoreHost Information: 0 : Response status: OK

위 이미지는 오케스트레이터에서 볼 수 있는 에러로그이고, 아래 로그는 쿠버네티스 pod의 log입니다.

에러원인을 요약하자면 uipath 실행파일은 .Net 8 버전으로 생성이 되었으나, 현재 로봇 버전(22.4) 버전은 .NET 6 기반으로 생성된 프로젝트파일만 실행이 가능하다 라는 에러입니다.

그럼 해결방법이 2가지 있겠네요. 하지만 각각의 방법엔 문제가 존재했습니다.

  1. studio를 2022 버전으로 설치한다. → 맥 환경이라 studio 설치불가, 2022 버전의 다운로드 링크 제공 안함
  2. pod 생성시 설치했던 이미지를 최신 이미지로 변경한다 → 구글링해서 찾아봤으나 존재하지않음

이에 저는 1번으로 해결해보겠습니다.

우선, 맥 환경이라 studio 설치가 안된다는 문제는 사실 쉽게 해결이 가능합니다.
virtualBox를 사용해서 가상window를 띄우면 되거든요.
이미지도 window에서 제공하고, virtualbox도 무료이니 가능합니다.

다음 uipath 2022버전의 다운로드 링크를 제공하지않는다. 해당 문제는 forum을 검색해보니 다행히도 2022년 버전의 다운로드링크를 제공하는게 있어서 다운로드가 가능했습니다.
그럼 이제 VirtualBox에서 uipath를 띄우고 간단한 프로세스를 만들어 배포까지 하겠습니다.

우선 여기서 중요한점은 프로세스 생성시 플랫폼은 항상 교차 플랫폼 으로 두어야합니다.
그래야 저희가 생성한 linux robot이 해당 프로세스를 인식 할 수 있어요.

테스트이기때문에 현재 시간을 출력하는 간단한 백그라운드 프로세스를 생성해볼게요.

이렇게 작성된 프로세스를 Orchestrator에 publish하면 아래와 같이 프로세스를 등록 할 수 있습니다.

저는 프로세스 이름을 backtest1 으로 했더니 이름 그대로 생성됐네요!

자 그럼 이제 저희가 생성한 k8s cluster 내에 있는 로봇으로 백그라운드 프로세스를 실행해보겠습니다.

UiPath.Service.NetCoreHost Information: 0 : Checking compatibility for System.IO.Pipelines 4.7.1 with net6.0 (alpine.3.14-x64).
UiPath.Service.NetCoreHost Information: 0 : Checking compatibility for Microsoft.Extensions.Configuration 3.1.6 with net6.0 (alpine.3.14-x64).
UiPath.Service.NetCoreHost Information: 0 : Checking compatibility for Microsoft.Extensions.Configuration.Abstractions 3.1.6 with net6.0 (alpine.3.14-x64).
UiPath.Service.NetCoreHost Information: 0 : All packages and projects are compatible with net6.0 (alpine.3.14-x64).
UiPath.Service.NetCoreHost Information: 0 : Generating MSBuild file /root/.nuget/packages/backtest1/1.0.2/backtest1.1.0.2.nuget.props.
UiPath.Service.NetCoreHost Information: 0 : Writing assets file to disk. Path: /root/.nuget/packages/backtest1/1.0.2/AllDependencies.json
UiPath.Service.NetCoreHost Information: 0 : Writing cache file to disk. Path: /root/.nuget/packages/backtest1/1.0.2/nuget.cache
UiPath.Service.NetCoreHost Information: 0 : backtest1/cccd80f3-f049-4e29-bb2a-8ef7589a68d6 changing from Preparing to Processing Job started processing
UiPath.Service.NetCoreHost Information: 0 : Request uri: https://cloud.uipath.com/nonpevotdl/nonDefault/orchestrator_/api/robotsservice/SubmitJobState
UiPath.Service.NetCoreHost Information: 0 : Response status: OK
UiPath.Service.NetCoreHost Information: 0 : Log message received from cccd80f3-f049-4e29-bb2a-8ef7589a68d6, message: {"message":"backtest1 execution started","level":"Information","logType":"Default","timeStamp":"2025-03-26T06:52:26.424122+00:00","fingerprint":"8e25e94d-213d-4de5-8074-d17a2f6c086c","windowsIdentity":"uipath-robots-57ff489dff-49vjv\\root","machineName":"uipath-robots-57ff489dff-49vjv","fileName":"Main","initiatedBy":"Orchestrator","processName":"backtest1","processVersion":"1.0.2","jobId":"cccd80f3-f049-4e29-bb2a-8ef7589a68d6","robotName":"k8s-2-unattended","machineId":4863347,"organizationUnitId":6534338}
UiPath.Service.NetCoreHost Information: 0 : Request uri: https://cloud.uipath.com/nonpevotdl/nonDefault/orchestrator_/api/Logs/SubmitLogs
UiPath.Service.NetCoreHost Information: 0 : Response status: OK
UiPath.Service.NetCoreHost Information: 0 : Log message received from cccd80f3-f049-4e29-bb2a-8ef7589a68d6, message: {"message":"Hi 2025-03-26 06:52:27","level":"Information","logType":"User","timeStamp":"2025-03-26T06:52:27.1841557+00:00","fingerprint":"dd27c293-ffb4-4ce7-9e03-2f09d14c3ce7","windowsIdentity":"uipath-robots-57ff489dff-49vjv\\root","machineName":"uipath-robots-57ff489dff-49vjv","fileName":"Main","processName":"backtest1","processVersion":"1.0.2","jobId":"cccd80f3-f049-4e29-bb2a-8ef7589a68d6","robotName":"k8s-2-unattended","machineId":4863347,"organizationUnitId":6534338}
UiPath.Service.NetCoreHost Information: 0 : Log message received from cccd80f3-f049-4e29-bb2a-8ef7589a68d6, message: {"message":"backtest1 execution ended","level":"Information","logType":"Default","timeStamp":"2025-03-26T06:52:27.2275691+00:00","fingerprint":"a901a78b-d3d7-4c99-a016-b73ece043bab","windowsIdentity":"uipath-robots-57ff489dff-49vjv\\root","machineName":"uipath-robots-57ff489dff-49vjv","fileName":"Main","totalExecutionTimeInSeconds":0,"totalExecutionTime":"00:00:00","processName":"backtest1","processVersion":"1.0.2","jobId":"cccd80f3-f049-4e29-bb2a-8ef7589a68d6","robotName":"k8s-2-unattended","machineId":4863347,"organizationUnitId":6534338}
UiPath.Service.NetCoreHost Information: 0 : backtest1/cccd80f3-f049-4e29-bb2a-8ef7589a68d6 finished with Succeeded (was Processing)

UiPath.Service.NetCoreHost Information: 0 : Request uri: https://cloud.uipath.com/nonpevotdl/nonDefault/orchestrator_/api/robotsservice/SubmitJobState
UiPath.Service.NetCoreHost Information: 0 : Request uri: https://cloud.uipath.com/nonpevotdl/nonDefault/orchestrator_/api/Logs/SubmitLogs
UiPath.Service.NetCoreHost Information: 0 : Executor cccd80f3-f049-4e29-bb2a-8ef7589a68d6 closed with exit code Success
UiPath.Service.NetCoreHost Information: 0 : Response status: OK
UiPath.Service.NetCoreHost Information: 0 : Request uri: https://cloud.uipath.com/nonpevotdl/nonDefault/orchestrator_/api/robotsservice/HeartbeatV2
UiPath.Service.NetCoreHost Information: 0 : Response status: OK
UiPath.Service.NetCoreHost Information: 0 : Response status: OK
UiPath.Service.NetCoreHost Information: 0 : Request uri: https://cloud.uipath.com/nonpevotdl/nonDefault/orchestrator_/api/robotsservice/HeartbeatV2
UiPath.Service.NetCoreHost Information: 0 : Response status: OK
UiPath.Service.NetCoreHost Information: 0 : Request uri: https://cloud.uipath.com/nonpevotdl/nonDefault/orchestrator_/api/robotsservice/HeartbeatV2
UiPath.Service.NetCoreHost Information: 0 : Response status: OK
UiPath.Service.NetCoreHost Information: 0 : Request uri: https://cloud.uipath.com/nonpevotdl/nonDefault/orchestrator_/api/robotsservice/HeartbeatV2
UiPath.Service.NetCoreHost Information: 0 : Response status: OK

이건 k8s의 pod 로그입니다. 조금만 기다리면 위 로그처럼
backtest1/cccd80f3-f049-4e29-bb2a-8ef7589a68d6 finished with Succeeded (was Processing) 이라고 뜰거에요.

그리고 실제 Orchestrator에서 보면??

성공적으로 수행됐습니다!
그럼 실제로 저희가 작성한 로그를 보면…

네 이렇게 HI 2025-03-26 06:52:27 이라고 시간대가 정상적으로 출력이 됩니다.
여기까지는 백그라운드 로봇으로 단순하게 실행하는걸 목표로했습니다.

다음 포스트에서는 실제 저희가 원하는 HPA를 본격적으로 테스트 해보도록 하겠습니다.
감사합니다.

×
linux k8s UIPath


Leave a Comment: