feat(cli): migrate the uipath server runtime channel from HTTP to uipath-ipc [ROBO-5779]#1786
Draft
eduard-dumitru wants to merge 1 commit into
Draft
feat(cli): migrate the uipath server runtime channel from HTTP to uipath-ipc [ROBO-5779]#1786eduard-dumitru wants to merge 1 commit into
eduard-dumitru wants to merge 1 commit into
Conversation
…ath-ipc Replaces the HTTP/socket channel (Unix-socket + TCP + ready-ACK) for the pre-warmed Python runtime with a uipath-ipc named-pipe server. `uipath server --pipe-name <name>` now hosts IPythonRuntimeServer (Ping / StartJob / CancelJob) over a named pipe — a $TMPDIR/CoreFxPipe_<name> Unix socket on Linux, a Win32 pipe on Windows — which the .NET job executor connects to as the client. This unifies today's UDS-on-Linux / TCP-on-Windows split into one primitive. - cli_server.py: adds the IPythonRuntimeServer contract + PythonRuntimeService (served by IpcServer over NamedPipeServerTransport), with per-job os.environ/cwd isolation. DTOs cross as plain PascalCase dicts (matching the .NET DTOs). StartJob is @ipc_cancellable; CancelJob and a host-cancelled StartJob set a per-job threading.Event exposed via get_current_cancellation() for the runtime to poll (cooperative, best-effort). The server command now takes a required --pipe-name and runs on a Windows Proactor loop (named pipes require it). Removes the whole HTTP path (start_unix_server, start_tcp_server, create_app, handle_start, handle_health, host-validation, send_ack, the SOCKET_ENV_VAR / DEFAULT_SOCKET_PATH / DEFAULT_PORT / generate_socket_path symbols, and the --client-socket / --server-socket / --port / --tcp options). - pyproject.toml: add the uipath-ipc dependency, pinned via [tool.uv.sources] + a [[tool.uv.index]] to the anonymously accessible UiPath-Internal Azure Artifacts feed so uv/CI can resolve it. This is uv resolution config only, not baked into the wheel; a public pip install uipath still needs uipath-ipc resolvable (public-PyPI release or an optional extra), a follow-up decision. - tests: replace the HTTP test_server.py with test_server_ipc.py, driving the IPC server over a pipe (Ping / StartJob / CancelJob, env isolation, cancel). Phase 1 (RPC) of the HTTP -> IPC migration. Logs stay file-tailed; making run/debug/eval + the agent poll the cancel signal is a runtime-side follow-up. Coordinated with the .NET executor (which must pass --pipe-name). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
348498e to
bbf3dc8
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What
Replaces the HTTP/socket channel (Unix-socket + TCP + ready-ACK) for the pre-warmed Python runtime with a
uipath-ipcnamed-pipe server.uipath server --pipe-name <name>now hostsIPythonRuntimeServer(Ping/StartJob/CancelJob) over a named pipe — a$TMPDIR/CoreFxPipe_<name>UDS on Linux, a Win32 pipe on Windows — which the .NET job executor connects to as the client. This unifies today's UDS-on-Linux / TCP-on-Windows split into one primitive.Changes
cli_server.py—IPythonRuntimeServercontract +PythonRuntimeService, served byIpcServeroverNamedPipeServerTransport, keeping the existing per-jobos.environ/cwd isolation. DTOs cross as plain PascalCase dicts (matching the .NET DTOs).StartJobis@ipc_cancellable;CancelJoband a host-cancelledStartJobset a per-jobthreading.Eventexposed viaget_current_cancellation()(cooperative, best-effort). Theservercommand takes a required--pipe-nameand runs on a Windows Proactor loop (named pipes require it). Removes the entire HTTP path —start_unix_server/start_tcp_server,create_app, the request handlers, host-validation,send_ack, theSOCKET_ENV_VAR/DEFAULT_SOCKET_PATH/DEFAULT_PORT/generate_socket_pathsymbols, and the--client-socket/--server-socket/--port/--tcpoptions.pyproject.toml— adds theuipath-ipcdependency, pinned via[tool.uv.sources]+[[tool.uv.index]]to the (anonymously accessible) UiPath-Internal Azure Artifacts feed souv/CI can resolve it.test_server.pywithtest_server_ipc.py, driving the IPC server over a pipe (Ping/StartJob/CancelJob, env isolation, cooperative cancel).Verified locally
uv syncinstalls everything (incl.uipath-ipcfrom the anonymous feed), anduipath server --pipe-name demoruns while a client round-tripsPing({Status: ready, RuntimeVersion: 2.11.18}) andCancelJobover a real named pipe.Open items / follow-ups (why this is a draft)
uipath-ipc>=2.5.1, which currently lives only on the UiPath-Internal feed (not PyPI). A publicpip install uipathneeds it resolvable, so this needs a decision: publishuipath-ipcto PyPI, or make it an optional extra. The[tool.uv.*]config only unblocksuv/CI resolution — it is not baked into the wheel.uipath server --pipe-name,IpcClientproxy,Pingreadiness) is required for full end-to-end.run/debug/eval+ the agent actually pollget_current_cancellation()to stop early is a runtime-side follow-up (a non-cooperating job runs to completion, as before).execution.log); moving them onto IPC is Phase 2.🤖 Generated with Claude Code