durabletask 0.0.0.dev53__tar.gz → 0.0.0.dev55__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.
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/PKG-INFO +1 -1
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/client.py +45 -70
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask.egg-info/PKG-INFO +1 -1
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/pyproject.toml +1 -1
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/LICENSE +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/README.md +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/__init__.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/entities/__init__.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/entities/durable_entity.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/entities/entity_context.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/entities/entity_instance_id.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/entities/entity_lock.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/entities/entity_metadata.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/entities/entity_operation_failed_exception.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/entity_state_shim.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/exceptions.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/grpc_interceptor.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/helpers.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/json_encode_output_exception.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/orchestration_entity_context.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/orchestrator_service_pb2.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/orchestrator_service_pb2.pyi +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/orchestrator_service_pb2_grpc.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/proto_task_hub_sidecar_service_stub.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/shared.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/py.typed +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/task.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/worker.py +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask.egg-info/SOURCES.txt +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask.egg-info/dependency_links.txt +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask.egg-info/requires.txt +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask.egg-info/top_level.txt +0 -0
- {durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/setup.cfg +0 -0
|
@@ -57,6 +57,27 @@ class OrchestrationState:
|
|
|
57
57
|
self.failure_details)
|
|
58
58
|
|
|
59
59
|
|
|
60
|
+
@dataclass
|
|
61
|
+
class OrchestrationQuery:
|
|
62
|
+
created_time_from: Optional[datetime] = None
|
|
63
|
+
created_time_to: Optional[datetime] = None
|
|
64
|
+
runtime_status: Optional[List[OrchestrationStatus]] = None
|
|
65
|
+
# Some backends don't respond well with max_instance_count = None, so we use the integer limit for non-paginated
|
|
66
|
+
# results instead.
|
|
67
|
+
max_instance_count: Optional[int] = (1 << 31) - 1
|
|
68
|
+
fetch_inputs_and_outputs: bool = False
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@dataclass
|
|
72
|
+
class EntityQuery:
|
|
73
|
+
instance_id_starts_with: Optional[str] = None
|
|
74
|
+
last_modified_from: Optional[datetime] = None
|
|
75
|
+
last_modified_to: Optional[datetime] = None
|
|
76
|
+
include_state: bool = True
|
|
77
|
+
include_transient: bool = False
|
|
78
|
+
page_size: Optional[int] = None
|
|
79
|
+
|
|
80
|
+
|
|
60
81
|
@dataclass
|
|
61
82
|
class PurgeInstancesResult:
|
|
62
83
|
deleted_instance_count: int
|
|
@@ -170,46 +191,24 @@ class TaskHubGrpcClient:
|
|
|
170
191
|
return new_orchestration_state(req.instanceId, res)
|
|
171
192
|
|
|
172
193
|
def get_all_orchestration_states(self,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
runtime_status=None,
|
|
179
|
-
max_instance_count=max_instance_count,
|
|
180
|
-
fetch_inputs_and_outputs=fetch_inputs_and_outputs
|
|
181
|
-
)
|
|
194
|
+
orchestration_query: Optional[OrchestrationQuery] = None
|
|
195
|
+
) -> List[OrchestrationState]:
|
|
196
|
+
if orchestration_query is None:
|
|
197
|
+
orchestration_query = OrchestrationQuery()
|
|
198
|
+
_continuation_token = None
|
|
182
199
|
|
|
183
|
-
|
|
184
|
-
created_time_from: Optional[datetime] = None,
|
|
185
|
-
created_time_to: Optional[datetime] = None,
|
|
186
|
-
runtime_status: Optional[List[OrchestrationStatus]] = None,
|
|
187
|
-
max_instance_count: Optional[int] = None,
|
|
188
|
-
fetch_inputs_and_outputs: bool = False,
|
|
189
|
-
_continuation_token: Optional[pb2.StringValue] = None
|
|
190
|
-
) -> List[OrchestrationState]:
|
|
191
|
-
if max_instance_count is None:
|
|
192
|
-
# Some backends do not behave well with max_instance_count = None, so we set to max 32-bit signed value
|
|
193
|
-
max_instance_count = (1 << 31) - 1
|
|
194
|
-
|
|
195
|
-
self._logger.info(f"Querying orchestration instances with filters - "
|
|
196
|
-
f"created_time_from={created_time_from}, "
|
|
197
|
-
f"created_time_to={created_time_to}, "
|
|
198
|
-
f"runtime_status={[str(status) for status in runtime_status] if runtime_status else None}, "
|
|
199
|
-
f"max_instance_count={max_instance_count}, "
|
|
200
|
-
f"fetch_inputs_and_outputs={fetch_inputs_and_outputs}, "
|
|
201
|
-
f"continuation_token={_continuation_token.value if _continuation_token else None}")
|
|
200
|
+
self._logger.info(f"Querying orchestration instances with query: {orchestration_query}")
|
|
202
201
|
|
|
203
202
|
states = []
|
|
204
203
|
|
|
205
204
|
while True:
|
|
206
205
|
req = pb.QueryInstancesRequest(
|
|
207
206
|
query=pb.InstanceQuery(
|
|
208
|
-
runtimeStatus=[status.value for status in runtime_status] if runtime_status else None,
|
|
209
|
-
createdTimeFrom=helpers.new_timestamp(created_time_from) if created_time_from else None,
|
|
210
|
-
createdTimeTo=helpers.new_timestamp(created_time_to) if created_time_to else None,
|
|
211
|
-
maxInstanceCount=max_instance_count,
|
|
212
|
-
fetchInputsAndOutputs=fetch_inputs_and_outputs,
|
|
207
|
+
runtimeStatus=[status.value for status in orchestration_query.runtime_status] if orchestration_query.runtime_status else None,
|
|
208
|
+
createdTimeFrom=helpers.new_timestamp(orchestration_query.created_time_from) if orchestration_query.created_time_from else None,
|
|
209
|
+
createdTimeTo=helpers.new_timestamp(orchestration_query.created_time_to) if orchestration_query.created_time_to else None,
|
|
210
|
+
maxInstanceCount=orchestration_query.max_instance_count,
|
|
211
|
+
fetchInputsAndOutputs=orchestration_query.fetch_inputs_and_outputs,
|
|
213
212
|
continuationToken=_continuation_token
|
|
214
213
|
)
|
|
215
214
|
)
|
|
@@ -225,7 +224,6 @@ class TaskHubGrpcClient:
|
|
|
225
224
|
else:
|
|
226
225
|
break
|
|
227
226
|
|
|
228
|
-
states = [state for state in states if state is not None] # Filter out any None values
|
|
229
227
|
return states
|
|
230
228
|
|
|
231
229
|
def wait_for_orchestration_start(self, instance_id: str, *,
|
|
@@ -319,7 +317,6 @@ class TaskHubGrpcClient:
|
|
|
319
317
|
f"runtime_status={[str(status) for status in runtime_status] if runtime_status else None}, "
|
|
320
318
|
f"recursive={recursive}")
|
|
321
319
|
resp: pb.PurgeInstancesResponse = self._stub.PurgeInstances(pb.PurgeInstancesRequest(
|
|
322
|
-
instanceId=None,
|
|
323
320
|
purgeInstanceFilter=pb.PurgeInstanceFilter(
|
|
324
321
|
createdTimeFrom=helpers.new_timestamp(created_time_from) if created_time_from else None,
|
|
325
322
|
createdTimeTo=helpers.new_timestamp(created_time_to) if created_time_to else None,
|
|
@@ -358,46 +355,24 @@ class TaskHubGrpcClient:
|
|
|
358
355
|
return EntityMetadata.from_entity_metadata(res.entity, include_state)
|
|
359
356
|
|
|
360
357
|
def get_all_entities(self,
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
instance_id_starts_with=None,
|
|
366
|
-
last_modified_from=None,
|
|
367
|
-
last_modified_to=None,
|
|
368
|
-
include_state=include_state,
|
|
369
|
-
include_transient=include_transient,
|
|
370
|
-
page_size=page_size
|
|
371
|
-
)
|
|
358
|
+
entity_query: Optional[EntityQuery] = None) -> List[EntityMetadata]:
|
|
359
|
+
if entity_query is None:
|
|
360
|
+
entity_query = EntityQuery()
|
|
361
|
+
_continuation_token = None
|
|
372
362
|
|
|
373
|
-
|
|
374
|
-
instance_id_starts_with: Optional[str] = None,
|
|
375
|
-
last_modified_from: Optional[datetime] = None,
|
|
376
|
-
last_modified_to: Optional[datetime] = None,
|
|
377
|
-
include_state: bool = True,
|
|
378
|
-
include_transient: bool = False,
|
|
379
|
-
page_size: Optional[int] = None,
|
|
380
|
-
_continuation_token: Optional[pb2.StringValue] = None
|
|
381
|
-
) -> List[EntityMetadata]:
|
|
382
|
-
self._logger.info(f"Retrieving entities by filter: "
|
|
383
|
-
f"instance_id_starts_with={instance_id_starts_with}, "
|
|
384
|
-
f"last_modified_from={last_modified_from}, "
|
|
385
|
-
f"last_modified_to={last_modified_to}, "
|
|
386
|
-
f"include_state={include_state}, "
|
|
387
|
-
f"include_transient={include_transient}, "
|
|
388
|
-
f"page_size={page_size}")
|
|
363
|
+
self._logger.info(f"Retrieving entities by filter: {entity_query}")
|
|
389
364
|
|
|
390
365
|
entities = []
|
|
391
366
|
|
|
392
367
|
while True:
|
|
393
368
|
query_request = pb.QueryEntitiesRequest(
|
|
394
369
|
query=pb.EntityQuery(
|
|
395
|
-
instanceIdStartsWith=helpers.get_string_value(instance_id_starts_with),
|
|
396
|
-
lastModifiedFrom=helpers.new_timestamp(last_modified_from) if last_modified_from else None,
|
|
397
|
-
lastModifiedTo=helpers.new_timestamp(last_modified_to) if last_modified_to else None,
|
|
398
|
-
includeState=include_state,
|
|
399
|
-
includeTransient=include_transient,
|
|
400
|
-
pageSize=helpers.get_int_value(page_size),
|
|
370
|
+
instanceIdStartsWith=helpers.get_string_value(entity_query.instance_id_starts_with),
|
|
371
|
+
lastModifiedFrom=helpers.new_timestamp(entity_query.last_modified_from) if entity_query.last_modified_from else None,
|
|
372
|
+
lastModifiedTo=helpers.new_timestamp(entity_query.last_modified_to) if entity_query.last_modified_to else None,
|
|
373
|
+
includeState=entity_query.include_state,
|
|
374
|
+
includeTransient=entity_query.include_transient,
|
|
375
|
+
pageSize=helpers.get_int_value(entity_query.page_size),
|
|
401
376
|
continuationToken=_continuation_token
|
|
402
377
|
)
|
|
403
378
|
)
|
|
@@ -415,13 +390,13 @@ class TaskHubGrpcClient:
|
|
|
415
390
|
|
|
416
391
|
def clean_entity_storage(self,
|
|
417
392
|
remove_empty_entities: bool = True,
|
|
418
|
-
release_orphaned_locks: bool = True
|
|
419
|
-
_continuation_token: Optional[pb2.StringValue] = None
|
|
393
|
+
release_orphaned_locks: bool = True
|
|
420
394
|
) -> CleanEntityStorageResult:
|
|
421
395
|
self._logger.info("Cleaning entity storage")
|
|
422
396
|
|
|
423
397
|
empty_entities_removed = 0
|
|
424
398
|
orphaned_locks_released = 0
|
|
399
|
+
_continuation_token = None
|
|
425
400
|
|
|
426
401
|
while True:
|
|
427
402
|
req = pb.CleanEntityStorageRequest(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/entities/entity_instance_id.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/entity_state_shim.py
RENAMED
|
File without changes
|
|
File without changes
|
{durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/grpc_interceptor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask/internal/orchestrator_service_pb2.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durabletask-0.0.0.dev53 → durabletask-0.0.0.dev55}/durabletask.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|