dex-python-sdk 1.11.0__tar.gz → 1.12.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/PKG-INFO +9 -1
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/README.md +8 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_pull_worker.py +40 -2
- dex_python_sdk-1.12.0/dex/dexpb/dex_pb2.py +545 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/dexpb/dex_pb2.pyi +28 -8
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/pyproject.toml +1 -1
- dex_python_sdk-1.11.0/dex/dexpb/dex_pb2.py +0 -545
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/LEGACY_NOTICES.md +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/LICENSE +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/__init__.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_async_value_hydrator.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_async_worker_dispatcher.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_async_worker_service.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_credential_transport.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_grpc_errors.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_invocation_context.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_native.pyi +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_server_protocol.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_utils.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_value_hydrator.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_value_mapper.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_worker_dispatcher.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/_worker_service.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/async_client.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/async_worker.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/attribute.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/attribute_match.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/blob_cache.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/channel.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/client.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/client_options.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/codec.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/condition.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/context.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/credential.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/dexpb/__init__.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/dexpb/dex_pb2_grpc.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/flow.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/flow_config.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/flow_info.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/flow_options.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/flow_result.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/py.typed +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/rpc_invoke_options.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/runtime_errors.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/step.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/step_execution.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/stream.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/subflow.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/timer.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/wait.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/wait_options.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/worker.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/dex/worker_options.py +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/Cargo.lock +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/Cargo.toml +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache/Cargo.toml +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache/LICENSE +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache/src/config.rs +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache/src/entry.rs +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache/src/error.rs +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache/src/format.rs +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache/src/lib.rs +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache/src/policy.rs +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache/src/store.rs +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache/tests/blob_cache_integration.rs +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache-python/Cargo.toml +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache-python/LICENSE +0 -0
- {dex_python_sdk-1.11.0 → dex_python_sdk-1.12.0}/sdk-rust/crates/dex-blob-cache-python/src/lib.rs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dex-python-sdk
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.12.0
|
|
4
4
|
Requires-Dist: grpcio>=1.83.0
|
|
5
5
|
Requires-Dist: grpcio-status>=1.83.0
|
|
6
6
|
Requires-Dist: protobuf>=7.35.1
|
|
@@ -100,6 +100,14 @@ max_concurrent_tasks)` streams because busy streams are replaced with idle
|
|
|
100
100
|
streams and retained after tasks finish. Size these options for the server's
|
|
101
101
|
per-Worker stream cap (256 by default).
|
|
102
102
|
|
|
103
|
+
The Worker rejects an unregistered Step or RPC by name. Dex retries that task
|
|
104
|
+
on another pull Worker without consuming a Step attempt, including when the
|
|
105
|
+
Flow was sticky to the rejecting Worker. If no capable Worker accepts it within
|
|
106
|
+
the server's dispatch wait (10 seconds by default, or the local Step attempt),
|
|
107
|
+
the Step follows its failure and retry policy; an RPC caller receives the named
|
|
108
|
+
error. This reassignment requires a Dex Server that supports it. Against older
|
|
109
|
+
Servers, the Worker returns the not-registered error as before.
|
|
110
|
+
|
|
103
111
|
The generated `app_worker_id` uses the first nonempty `DEX_WORKER_INSTANCE`,
|
|
104
112
|
`POD_NAME`, `HOSTNAME`, or system hostname, plus eight random base32 characters.
|
|
105
113
|
An override must uniquely identify one Worker process and change after restart.
|
|
@@ -84,6 +84,14 @@ max_concurrent_tasks)` streams because busy streams are replaced with idle
|
|
|
84
84
|
streams and retained after tasks finish. Size these options for the server's
|
|
85
85
|
per-Worker stream cap (256 by default).
|
|
86
86
|
|
|
87
|
+
The Worker rejects an unregistered Step or RPC by name. Dex retries that task
|
|
88
|
+
on another pull Worker without consuming a Step attempt, including when the
|
|
89
|
+
Flow was sticky to the rejecting Worker. If no capable Worker accepts it within
|
|
90
|
+
the server's dispatch wait (10 seconds by default, or the local Step attempt),
|
|
91
|
+
the Step follows its failure and retry policy; an RPC caller receives the named
|
|
92
|
+
error. This reassignment requires a Dex Server that supports it. Against older
|
|
93
|
+
Servers, the Worker returns the not-registered error as before.
|
|
94
|
+
|
|
87
95
|
The generated `app_worker_id` uses the first nonempty `DEX_WORKER_INSTANCE`,
|
|
88
96
|
`POD_NAME`, `HOSTNAME`, or system hostname, plus eight random base32 characters.
|
|
89
97
|
An override must uniquely identify one Worker process and change after restart.
|
|
@@ -82,6 +82,7 @@ class PullWorkerRuntime:
|
|
|
82
82
|
app_worker_id: str | None = None,
|
|
83
83
|
credential_runner: AsyncCredentialRunner | None = None,
|
|
84
84
|
) -> None:
|
|
85
|
+
self._registry = registry
|
|
85
86
|
self.app_worker_id = app_worker_id or resolve_app_worker_id(registry, options)
|
|
86
87
|
self.flow_types = sorted(registry._registered_flows)
|
|
87
88
|
self.queues = (self.app_worker_id, *self.flow_types)
|
|
@@ -103,6 +104,26 @@ class PullWorkerRuntime:
|
|
|
103
104
|
self._busy_tasks = 0
|
|
104
105
|
self._unsupported_logged = False
|
|
105
106
|
|
|
107
|
+
def unknown_task_reason(
|
|
108
|
+
self, task: pb.PollWorkerTask
|
|
109
|
+
) -> pb.PollWorkerTaskRejectReason | None:
|
|
110
|
+
kind = task.WhichOneof("request")
|
|
111
|
+
if kind == "rpc":
|
|
112
|
+
flow = self._registry._registered_flows.get(task.rpc.flow_type)
|
|
113
|
+
if flow is None or task.rpc.rpc_name not in flow.rpcs:
|
|
114
|
+
return pb.POLL_WORKER_TASK_REJECT_REASON_UNKNOWN_RPC
|
|
115
|
+
elif kind in ("wait_for", "execute"):
|
|
116
|
+
request = task.wait_for if kind == "wait_for" else task.execute
|
|
117
|
+
flow = self._registry._registered_flows.get(request.flow_type)
|
|
118
|
+
if flow is None:
|
|
119
|
+
return pb.POLL_WORKER_TASK_REJECT_REASON_UNKNOWN_STEP
|
|
120
|
+
if kind == "execute" and request.step_type == "sys:timeout_handler":
|
|
121
|
+
if not flow.has_timeout_handler:
|
|
122
|
+
return pb.POLL_WORKER_TASK_REJECT_REASON_UNKNOWN_STEP
|
|
123
|
+
elif request.step_type not in flow.steps:
|
|
124
|
+
return pb.POLL_WORKER_TASK_REJECT_REASON_UNKNOWN_STEP
|
|
125
|
+
return None
|
|
126
|
+
|
|
106
127
|
async def run(self) -> None:
|
|
107
128
|
self._loop = asyncio.get_running_loop()
|
|
108
129
|
self._loop_thread_id = threading.get_ident()
|
|
@@ -249,6 +270,7 @@ class PullStream:
|
|
|
249
270
|
self._send_lock = asyncio.Lock()
|
|
250
271
|
self._is_reconnecting = False
|
|
251
272
|
self._deadline_handle: asyncio.TimerHandle | None = None
|
|
273
|
+
self._supports_unknown_name_rejection = False
|
|
252
274
|
|
|
253
275
|
def on_done(self, completed: asyncio.Task[None]) -> None:
|
|
254
276
|
self.runtime._stream_done(self, completed)
|
|
@@ -301,6 +323,7 @@ class PullStream:
|
|
|
301
323
|
async def _poll(self) -> bool:
|
|
302
324
|
if self.runtime.is_stopping:
|
|
303
325
|
return False
|
|
326
|
+
self._supports_unknown_name_rejection = False
|
|
304
327
|
if self.runtime._credential_runner is None:
|
|
305
328
|
self._call = self.stub.PollWorkerTask()
|
|
306
329
|
else:
|
|
@@ -364,6 +387,9 @@ class PullStream:
|
|
|
364
387
|
return False
|
|
365
388
|
if kind != "registered":
|
|
366
389
|
raise RuntimeError("Worker task stream did not register")
|
|
390
|
+
self._supports_unknown_name_rejection = (
|
|
391
|
+
frame.registered.supports_unknown_name_rejection
|
|
392
|
+
)
|
|
367
393
|
was_registered = True
|
|
368
394
|
continue
|
|
369
395
|
if kind == "task":
|
|
@@ -443,6 +469,14 @@ class PullStream:
|
|
|
443
469
|
pass
|
|
444
470
|
|
|
445
471
|
async def _start_task(self, task: pb.PollWorkerTask) -> None:
|
|
472
|
+
unknown_reason = (
|
|
473
|
+
self.runtime.unknown_task_reason(task)
|
|
474
|
+
if self._supports_unknown_name_rejection
|
|
475
|
+
else None
|
|
476
|
+
)
|
|
477
|
+
if unknown_reason is not None:
|
|
478
|
+
await self._reject_task(task, unknown_reason)
|
|
479
|
+
return
|
|
446
480
|
if self.is_busy or self.is_draining or not self.runtime.accept_task():
|
|
447
481
|
await self._reject_task(task)
|
|
448
482
|
return
|
|
@@ -458,12 +492,16 @@ class PullStream:
|
|
|
458
492
|
)
|
|
459
493
|
self.runtime.signal()
|
|
460
494
|
|
|
461
|
-
async def _reject_task(
|
|
495
|
+
async def _reject_task(
|
|
496
|
+
self,
|
|
497
|
+
task: pb.PollWorkerTask,
|
|
498
|
+
reason: pb.PollWorkerTaskRejectReason = pb.POLL_WORKER_TASK_REJECT_REASON_NO_CAPACITY,
|
|
499
|
+
) -> None:
|
|
462
500
|
await self._send(
|
|
463
501
|
pb.PollWorkerTaskRequest(
|
|
464
502
|
reject=pb.PollWorkerTaskReject(
|
|
465
503
|
task_id=task.task_id,
|
|
466
|
-
reason=
|
|
504
|
+
reason=reason,
|
|
467
505
|
)
|
|
468
506
|
)
|
|
469
507
|
)
|