Skip to content

Commit 079e9e8

Browse files
committed
fix: allow server socket path specification
1 parent 060fb63 commit 079e9e8

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.8.13"
3+
version = "2.8.14"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

src/uipath/_cli/cli_server.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,11 @@ def create_app() -> web.Application:
248248
return app
249249

250250

251-
async def start_unix_server(ack_socket_path: str) -> None:
251+
async def start_unix_server(
252+
ack_socket_path: str, server_socket_path: str | None = None
253+
) -> None:
252254
"""Start Unix domain socket HTTP server."""
253-
server_socket_path = generate_socket_path()
255+
server_socket_path = server_socket_path or generate_socket_path()
254256

255257
if os.path.exists(server_socket_path):
256258
os.unlink(server_socket_path)
@@ -295,11 +297,17 @@ async def start_tcp_server(host: str, port: int) -> None:
295297

296298
@click.command()
297299
@click.option(
298-
"--socket",
300+
"--client-socket",
299301
type=str,
300302
default=None,
301303
help=f"Unix socket path to send ready ack to (default: ${SOCKET_ENV_VAR} or {DEFAULT_SOCKET_PATH})",
302304
)
305+
@click.option(
306+
"--server-socket",
307+
type=str,
308+
default=None,
309+
help="Unix socket path the server listens on (default: auto-generated in tmp dir)",
310+
)
303311
@click.option(
304312
"--port",
305313
type=int,
@@ -311,10 +319,15 @@ async def start_tcp_server(host: str, port: int) -> None:
311319
is_flag=True,
312320
help="Force TCP mode even on Unix systems",
313321
)
314-
def server(socket: str | None, port: int | None, tcp: bool) -> None:
322+
def server(
323+
client_socket: str | None,
324+
server_socket: str | None,
325+
port: int | None,
326+
tcp: bool,
327+
) -> None:
315328
"""Start an HTTP server that forwards commands to run/debug/eval.
316329
317-
Creates its own socket to listen on and sends an ack to --socket with:
330+
Creates its own socket to listen on and sends an ack to --client-socket with:
318331
{"status": "ready", "socket": "/path/to/server.sock"}
319332
320333
Endpoint: POST /jobs/{job_key}/start
@@ -331,8 +344,10 @@ def server(socket: str | None, port: int | None, tcp: bool) -> None:
331344
asyncio.run(start_tcp_server("127.0.0.1", port or DEFAULT_PORT))
332345
else:
333346
ack_socket_path = (
334-
socket or os.environ.get(SOCKET_ENV_VAR) or DEFAULT_SOCKET_PATH
347+
client_socket
348+
or os.environ.get(SOCKET_ENV_VAR)
349+
or DEFAULT_SOCKET_PATH
335350
)
336-
asyncio.run(start_unix_server(ack_socket_path))
351+
asyncio.run(start_unix_server(ack_socket_path, server_socket))
337352
except KeyboardInterrupt:
338353
console.info("Shutting down")

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)