hatchet-sdk 1.13.0__py3-none-any.whl → 1.14.0__py3-none-any.whl
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.
Potentially problematic release.
This version of hatchet-sdk might be problematic. Click here for more details.
- hatchet_sdk/__init__.py +8 -0
- hatchet_sdk/clients/rest/models/semaphore_slots.py +1 -1
- hatchet_sdk/clients/rest/models/v1_task_summary.py +5 -0
- hatchet_sdk/clients/rest/models/v1_workflow_run_details.py +11 -1
- hatchet_sdk/clients/rest/models/workflow_version.py +5 -0
- hatchet_sdk/exceptions.py +4 -0
- hatchet_sdk/features/filters.py +9 -18
- hatchet_sdk/v0/__init__.py +7 -7
- hatchet_sdk/v0/clients/admin.py +7 -7
- hatchet_sdk/v0/clients/dispatcher/action_listener.py +8 -8
- hatchet_sdk/v0/clients/dispatcher/dispatcher.py +9 -9
- hatchet_sdk/v0/clients/events.py +3 -3
- hatchet_sdk/v0/clients/rest/tenacity_utils.py +1 -1
- hatchet_sdk/v0/clients/run_event_listener.py +3 -3
- hatchet_sdk/v0/clients/workflow_listener.py +5 -5
- hatchet_sdk/v0/context/context.py +6 -6
- hatchet_sdk/v0/hatchet.py +4 -4
- hatchet_sdk/v0/opentelemetry/instrumentor.py +1 -1
- hatchet_sdk/v0/rate_limit.py +1 -1
- hatchet_sdk/v0/v2/callable.py +4 -4
- hatchet_sdk/v0/v2/concurrency.py +2 -2
- hatchet_sdk/v0/v2/hatchet.py +3 -3
- hatchet_sdk/v0/worker/action_listener_process.py +6 -6
- hatchet_sdk/v0/worker/runner/run_loop_manager.py +1 -1
- hatchet_sdk/v0/worker/runner/runner.py +10 -10
- hatchet_sdk/v0/worker/runner/utils/capture_logs.py +1 -1
- hatchet_sdk/v0/worker/worker.py +2 -2
- hatchet_sdk/v0/workflow.py +3 -3
- hatchet_sdk/worker/runner/runner.py +69 -17
- hatchet_sdk/worker/worker.py +1 -1
- {hatchet_sdk-1.13.0.dist-info → hatchet_sdk-1.14.0.dist-info}/METADATA +1 -1
- {hatchet_sdk-1.13.0.dist-info → hatchet_sdk-1.14.0.dist-info}/RECORD +34 -44
- hatchet_sdk/v0/contracts/dispatcher_pb2.py +0 -102
- hatchet_sdk/v0/contracts/dispatcher_pb2.pyi +0 -387
- hatchet_sdk/v0/contracts/dispatcher_pb2_grpc.py +0 -621
- hatchet_sdk/v0/contracts/events_pb2.py +0 -46
- hatchet_sdk/v0/contracts/events_pb2.pyi +0 -87
- hatchet_sdk/v0/contracts/events_pb2_grpc.py +0 -274
- hatchet_sdk/v0/contracts/workflows_pb2.py +0 -80
- hatchet_sdk/v0/contracts/workflows_pb2.pyi +0 -312
- hatchet_sdk/v0/contracts/workflows_pb2_grpc.py +0 -277
- hatchet_sdk/v0/logger.py +0 -13
- {hatchet_sdk-1.13.0.dist-info → hatchet_sdk-1.14.0.dist-info}/WHEEL +0 -0
- {hatchet_sdk-1.13.0.dist-info → hatchet_sdk-1.14.0.dist-info}/entry_points.txt +0 -0
hatchet_sdk/__init__.py
CHANGED
|
@@ -7,6 +7,7 @@ from hatchet_sdk.clients.listeners.durable_event_listener import (
|
|
|
7
7
|
RegisterDurableEventRequest,
|
|
8
8
|
)
|
|
9
9
|
from hatchet_sdk.clients.listeners.run_event_listener import (
|
|
10
|
+
RunEventListener,
|
|
10
11
|
StepRunEventType,
|
|
11
12
|
WorkflowRunEventType,
|
|
12
13
|
)
|
|
@@ -140,6 +141,7 @@ from hatchet_sdk.contracts.workflows_pb2 import (
|
|
|
140
141
|
from hatchet_sdk.exceptions import (
|
|
141
142
|
DedupeViolationError,
|
|
142
143
|
FailedTaskRunExceptionGroup,
|
|
144
|
+
NonRetryableException,
|
|
143
145
|
TaskRunError,
|
|
144
146
|
)
|
|
145
147
|
from hatchet_sdk.features.runs import BulkCancelReplayOpts, RunFilter
|
|
@@ -154,6 +156,7 @@ from hatchet_sdk.runnables.types import (
|
|
|
154
156
|
TaskDefaults,
|
|
155
157
|
WorkflowConfig,
|
|
156
158
|
)
|
|
159
|
+
from hatchet_sdk.runnables.workflow import TaskRunRef
|
|
157
160
|
from hatchet_sdk.utils.opentelemetry import OTelAttribute
|
|
158
161
|
from hatchet_sdk.waits import (
|
|
159
162
|
Condition,
|
|
@@ -164,6 +167,7 @@ from hatchet_sdk.waits import (
|
|
|
164
167
|
or_,
|
|
165
168
|
)
|
|
166
169
|
from hatchet_sdk.worker.worker import Worker, WorkerStartOptions, WorkerStatus
|
|
170
|
+
from hatchet_sdk.workflow_run import WorkflowRunRef
|
|
167
171
|
|
|
168
172
|
__all__ = [
|
|
169
173
|
"APIError",
|
|
@@ -216,6 +220,7 @@ __all__ = [
|
|
|
216
220
|
"LogLineList",
|
|
217
221
|
"LogLineOrderByDirection",
|
|
218
222
|
"LogLineOrderByField",
|
|
223
|
+
"NonRetryableException",
|
|
219
224
|
"OTelAttribute",
|
|
220
225
|
"OpenTelemetryConfig",
|
|
221
226
|
"OrGroup",
|
|
@@ -229,6 +234,7 @@ __all__ = [
|
|
|
229
234
|
"RejectInviteRequest",
|
|
230
235
|
"ReplayEventRequest",
|
|
231
236
|
"RerunStepRunRequest",
|
|
237
|
+
"RunEventListener",
|
|
232
238
|
"RunFilter",
|
|
233
239
|
"ScheduleTriggerWorkflowOptions",
|
|
234
240
|
"SleepCondition",
|
|
@@ -240,6 +246,7 @@ __all__ = [
|
|
|
240
246
|
"Task",
|
|
241
247
|
"TaskDefaults",
|
|
242
248
|
"TaskRunError",
|
|
249
|
+
"TaskRunRef",
|
|
243
250
|
"Tenant",
|
|
244
251
|
"TenantInvite",
|
|
245
252
|
"TenantInviteList",
|
|
@@ -272,6 +279,7 @@ __all__ = [
|
|
|
272
279
|
"WorkflowRun",
|
|
273
280
|
"WorkflowRunEventType",
|
|
274
281
|
"WorkflowRunList",
|
|
282
|
+
"WorkflowRunRef",
|
|
275
283
|
"WorkflowRunStatus",
|
|
276
284
|
"WorkflowRunTriggeredBy",
|
|
277
285
|
"WorkflowTag",
|
|
@@ -42,7 +42,7 @@ class SemaphoreSlots(BaseModel):
|
|
|
42
42
|
workflow_run_id: StrictStr = Field(
|
|
43
43
|
description="The workflow run id.", alias="workflowRunId"
|
|
44
44
|
)
|
|
45
|
-
status: StepRunStatus
|
|
45
|
+
status: Optional[StepRunStatus] = None
|
|
46
46
|
__properties: ClassVar[List[str]] = [
|
|
47
47
|
"stepRunId",
|
|
48
48
|
"actionId",
|
|
@@ -111,6 +111,9 @@ class V1TaskSummary(BaseModel):
|
|
|
111
111
|
description="The version ID of the workflow",
|
|
112
112
|
alias="workflowVersionId",
|
|
113
113
|
)
|
|
114
|
+
workflow_config: Optional[Dict[str, Any]] = Field(
|
|
115
|
+
default=None, alias="workflowConfig"
|
|
116
|
+
)
|
|
114
117
|
__properties: ClassVar[List[str]] = [
|
|
115
118
|
"metadata",
|
|
116
119
|
"actionId",
|
|
@@ -138,6 +141,7 @@ class V1TaskSummary(BaseModel):
|
|
|
138
141
|
"workflowName",
|
|
139
142
|
"workflowRunExternalId",
|
|
140
143
|
"workflowVersionId",
|
|
144
|
+
"workflowConfig",
|
|
141
145
|
]
|
|
142
146
|
|
|
143
147
|
model_config = ConfigDict(
|
|
@@ -234,6 +238,7 @@ class V1TaskSummary(BaseModel):
|
|
|
234
238
|
"workflowName": obj.get("workflowName"),
|
|
235
239
|
"workflowRunExternalId": obj.get("workflowRunExternalId"),
|
|
236
240
|
"workflowVersionId": obj.get("workflowVersionId"),
|
|
241
|
+
"workflowConfig": obj.get("workflowConfig"),
|
|
237
242
|
}
|
|
238
243
|
)
|
|
239
244
|
return _obj
|
|
@@ -41,7 +41,16 @@ class V1WorkflowRunDetails(BaseModel):
|
|
|
41
41
|
)
|
|
42
42
|
shape: List[WorkflowRunShapeItemForWorkflowRunDetails]
|
|
43
43
|
tasks: List[V1TaskSummary]
|
|
44
|
-
|
|
44
|
+
workflow_config: Optional[Dict[str, Any]] = Field(
|
|
45
|
+
default=None, alias="workflowConfig"
|
|
46
|
+
)
|
|
47
|
+
__properties: ClassVar[List[str]] = [
|
|
48
|
+
"run",
|
|
49
|
+
"taskEvents",
|
|
50
|
+
"shape",
|
|
51
|
+
"tasks",
|
|
52
|
+
"workflowConfig",
|
|
53
|
+
]
|
|
45
54
|
|
|
46
55
|
model_config = ConfigDict(
|
|
47
56
|
populate_by_name=True,
|
|
@@ -140,6 +149,7 @@ class V1WorkflowRunDetails(BaseModel):
|
|
|
140
149
|
if obj.get("tasks") is not None
|
|
141
150
|
else None
|
|
142
151
|
),
|
|
152
|
+
"workflowConfig": obj.get("workflowConfig"),
|
|
143
153
|
}
|
|
144
154
|
)
|
|
145
155
|
return _obj
|
|
@@ -51,6 +51,9 @@ class WorkflowVersion(BaseModel):
|
|
|
51
51
|
triggers: Optional[WorkflowTriggers] = None
|
|
52
52
|
schedule_timeout: Optional[StrictStr] = Field(default=None, alias="scheduleTimeout")
|
|
53
53
|
jobs: Optional[List[Job]] = None
|
|
54
|
+
workflow_config: Optional[Dict[str, Any]] = Field(
|
|
55
|
+
default=None, alias="workflowConfig"
|
|
56
|
+
)
|
|
54
57
|
__properties: ClassVar[List[str]] = [
|
|
55
58
|
"metadata",
|
|
56
59
|
"version",
|
|
@@ -63,6 +66,7 @@ class WorkflowVersion(BaseModel):
|
|
|
63
66
|
"triggers",
|
|
64
67
|
"scheduleTimeout",
|
|
65
68
|
"jobs",
|
|
69
|
+
"workflowConfig",
|
|
66
70
|
]
|
|
67
71
|
|
|
68
72
|
model_config = ConfigDict(
|
|
@@ -165,6 +169,7 @@ class WorkflowVersion(BaseModel):
|
|
|
165
169
|
if obj.get("jobs") is not None
|
|
166
170
|
else None
|
|
167
171
|
),
|
|
172
|
+
"workflowConfig": obj.get("workflowConfig"),
|
|
168
173
|
}
|
|
169
174
|
)
|
|
170
175
|
return _obj
|
hatchet_sdk/exceptions.py
CHANGED
hatchet_sdk/features/filters.py
CHANGED
|
@@ -26,47 +26,38 @@ class FiltersClient(BaseRestClient):
|
|
|
26
26
|
self,
|
|
27
27
|
limit: int | None = None,
|
|
28
28
|
offset: int | None = None,
|
|
29
|
-
|
|
29
|
+
workflow_ids: list[str] | None = None,
|
|
30
|
+
scopes: list[str] | None = None,
|
|
30
31
|
) -> V1FilterList:
|
|
31
32
|
"""
|
|
32
33
|
List filters for a given tenant.
|
|
33
34
|
|
|
34
35
|
:param limit: The maximum number of filters to return.
|
|
35
36
|
:param offset: The number of filters to skip before starting to collect the result set.
|
|
36
|
-
:param
|
|
37
|
+
:param workflow_ids: A list of workflow IDs to filter by.
|
|
38
|
+
:param scopes: A list of scopes to filter by.
|
|
37
39
|
|
|
38
40
|
:return: A list of filters matching the specified criteria.
|
|
39
41
|
"""
|
|
40
|
-
return await asyncio.to_thread(
|
|
41
|
-
self.list, limit, offset, workflow_id_scope_pairs
|
|
42
|
-
)
|
|
42
|
+
return await asyncio.to_thread(self.list, limit, offset, workflow_ids, scopes)
|
|
43
43
|
|
|
44
44
|
def list(
|
|
45
45
|
self,
|
|
46
46
|
limit: int | None = None,
|
|
47
47
|
offset: int | None = None,
|
|
48
|
-
|
|
48
|
+
workflow_ids: list[str] | None = None,
|
|
49
|
+
scopes: list[str] | None = None,
|
|
49
50
|
) -> V1FilterList:
|
|
50
51
|
"""
|
|
51
52
|
List filters for a given tenant.
|
|
52
53
|
|
|
53
54
|
:param limit: The maximum number of filters to return.
|
|
54
55
|
:param offset: The number of filters to skip before starting to collect the result set.
|
|
55
|
-
:param
|
|
56
|
+
:param workflow_ids: A list of workflow IDs to filter by.
|
|
57
|
+
:param scopes: A list of scopes to filter by.
|
|
56
58
|
|
|
57
59
|
:return: A list of filters matching the specified criteria.
|
|
58
60
|
"""
|
|
59
|
-
workflow_ids = (
|
|
60
|
-
[pair[0] for pair in workflow_id_scope_pairs]
|
|
61
|
-
if workflow_id_scope_pairs
|
|
62
|
-
else None
|
|
63
|
-
)
|
|
64
|
-
scopes = (
|
|
65
|
-
[pair[1] for pair in workflow_id_scope_pairs]
|
|
66
|
-
if workflow_id_scope_pairs
|
|
67
|
-
else None
|
|
68
|
-
)
|
|
69
|
-
|
|
70
61
|
with self.client() as client:
|
|
71
62
|
return self._fa(client).v1_filter_list(
|
|
72
63
|
tenant=self.tenant_id,
|
hatchet_sdk/v0/__init__.py
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
from hatchet_sdk.contracts.workflows_pb2 import (
|
|
2
|
+
ConcurrencyLimitStrategy,
|
|
3
|
+
CreateWorkflowVersionOpts,
|
|
4
|
+
RateLimitDuration,
|
|
5
|
+
StickyStrategy,
|
|
6
|
+
WorkerLabelComparator,
|
|
7
|
+
)
|
|
1
8
|
from hatchet_sdk.v0.clients.rest.models.accept_invite_request import AcceptInviteRequest
|
|
2
9
|
|
|
3
10
|
# import models into sdk package
|
|
@@ -121,13 +128,6 @@ from hatchet_sdk.v0.clients.rest.models.workflow_version_definition import (
|
|
|
121
128
|
WorkflowVersionDefinition,
|
|
122
129
|
)
|
|
123
130
|
from hatchet_sdk.v0.clients.rest.models.workflow_version_meta import WorkflowVersionMeta
|
|
124
|
-
from hatchet_sdk.v0.contracts.workflows_pb2 import (
|
|
125
|
-
ConcurrencyLimitStrategy,
|
|
126
|
-
CreateWorkflowVersionOpts,
|
|
127
|
-
RateLimitDuration,
|
|
128
|
-
StickyStrategy,
|
|
129
|
-
WorkerLabelComparator,
|
|
130
|
-
)
|
|
131
131
|
from hatchet_sdk.v0.utils.aio_utils import sync_to_async
|
|
132
132
|
|
|
133
133
|
from .client import new_client
|
hatchet_sdk/v0/clients/admin.py
CHANGED
|
@@ -5,12 +5,7 @@ from typing import Any, Callable, Dict, List, Optional, TypedDict, TypeVar, Unio
|
|
|
5
5
|
import grpc
|
|
6
6
|
from google.protobuf import timestamp_pb2
|
|
7
7
|
|
|
8
|
-
from hatchet_sdk.
|
|
9
|
-
from hatchet_sdk.v0.clients.rest.tenacity_utils import tenacity_retry
|
|
10
|
-
from hatchet_sdk.v0.clients.run_event_listener import new_listener
|
|
11
|
-
from hatchet_sdk.v0.clients.workflow_listener import PooledWorkflowRunListener
|
|
12
|
-
from hatchet_sdk.v0.connection import new_conn
|
|
13
|
-
from hatchet_sdk.v0.contracts.workflows_pb2 import (
|
|
8
|
+
from hatchet_sdk.contracts.workflows_pb2 import (
|
|
14
9
|
BulkTriggerWorkflowRequest,
|
|
15
10
|
BulkTriggerWorkflowResponse,
|
|
16
11
|
CreateWorkflowVersionOpts,
|
|
@@ -22,7 +17,12 @@ from hatchet_sdk.v0.contracts.workflows_pb2 import (
|
|
|
22
17
|
TriggerWorkflowResponse,
|
|
23
18
|
WorkflowVersion,
|
|
24
19
|
)
|
|
25
|
-
from hatchet_sdk.
|
|
20
|
+
from hatchet_sdk.contracts.workflows_pb2_grpc import WorkflowServiceStub
|
|
21
|
+
from hatchet_sdk.v0.clients.rest.models.workflow_run import WorkflowRun
|
|
22
|
+
from hatchet_sdk.v0.clients.rest.tenacity_utils import tenacity_retry
|
|
23
|
+
from hatchet_sdk.v0.clients.run_event_listener import new_listener
|
|
24
|
+
from hatchet_sdk.v0.clients.workflow_listener import PooledWorkflowRunListener
|
|
25
|
+
from hatchet_sdk.v0.connection import new_conn
|
|
26
26
|
from hatchet_sdk.v0.workflow_run import RunRef, WorkflowRunRef
|
|
27
27
|
|
|
28
28
|
from ..loader import ClientConfig
|
|
@@ -7,12 +7,7 @@ from typing import Any, AsyncGenerator, List, Optional
|
|
|
7
7
|
import grpc
|
|
8
8
|
from grpc._cython import cygrpc
|
|
9
9
|
|
|
10
|
-
from hatchet_sdk.
|
|
11
|
-
from hatchet_sdk.v0.clients.run_event_listener import (
|
|
12
|
-
DEFAULT_ACTION_LISTENER_RETRY_INTERVAL,
|
|
13
|
-
)
|
|
14
|
-
from hatchet_sdk.v0.connection import new_conn
|
|
15
|
-
from hatchet_sdk.v0.contracts.dispatcher_pb2 import (
|
|
10
|
+
from hatchet_sdk.contracts.dispatcher_pb2 import (
|
|
16
11
|
ActionType,
|
|
17
12
|
AssignedAction,
|
|
18
13
|
HeartbeatRequest,
|
|
@@ -20,8 +15,13 @@ from hatchet_sdk.v0.contracts.dispatcher_pb2 import (
|
|
|
20
15
|
WorkerListenRequest,
|
|
21
16
|
WorkerUnsubscribeRequest,
|
|
22
17
|
)
|
|
23
|
-
from hatchet_sdk.
|
|
24
|
-
from hatchet_sdk.
|
|
18
|
+
from hatchet_sdk.contracts.dispatcher_pb2_grpc import DispatcherStub
|
|
19
|
+
from hatchet_sdk.logger import logger
|
|
20
|
+
from hatchet_sdk.v0.clients.event_ts import ThreadSafeEvent, read_with_interrupt
|
|
21
|
+
from hatchet_sdk.v0.clients.run_event_listener import (
|
|
22
|
+
DEFAULT_ACTION_LISTENER_RETRY_INTERVAL,
|
|
23
|
+
)
|
|
24
|
+
from hatchet_sdk.v0.connection import new_conn
|
|
25
25
|
from hatchet_sdk.v0.utils.backoff import exp_backoff_sleep
|
|
26
26
|
|
|
27
27
|
from ...loader import ClientConfig
|
|
@@ -2,14 +2,7 @@ from typing import Any, cast
|
|
|
2
2
|
|
|
3
3
|
from google.protobuf.timestamp_pb2 import Timestamp
|
|
4
4
|
|
|
5
|
-
from hatchet_sdk.
|
|
6
|
-
Action,
|
|
7
|
-
ActionListener,
|
|
8
|
-
GetActionListenerRequest,
|
|
9
|
-
)
|
|
10
|
-
from hatchet_sdk.v0.clients.rest.tenacity_utils import tenacity_retry
|
|
11
|
-
from hatchet_sdk.v0.connection import new_conn
|
|
12
|
-
from hatchet_sdk.v0.contracts.dispatcher_pb2 import (
|
|
5
|
+
from hatchet_sdk.contracts.dispatcher_pb2 import (
|
|
13
6
|
STEP_EVENT_TYPE_COMPLETED,
|
|
14
7
|
STEP_EVENT_TYPE_FAILED,
|
|
15
8
|
ActionEventResponse,
|
|
@@ -25,7 +18,14 @@ from hatchet_sdk.v0.contracts.dispatcher_pb2 import (
|
|
|
25
18
|
WorkerRegisterRequest,
|
|
26
19
|
WorkerRegisterResponse,
|
|
27
20
|
)
|
|
28
|
-
from hatchet_sdk.
|
|
21
|
+
from hatchet_sdk.contracts.dispatcher_pb2_grpc import DispatcherStub
|
|
22
|
+
from hatchet_sdk.v0.clients.dispatcher.action_listener import (
|
|
23
|
+
Action,
|
|
24
|
+
ActionListener,
|
|
25
|
+
GetActionListenerRequest,
|
|
26
|
+
)
|
|
27
|
+
from hatchet_sdk.v0.clients.rest.tenacity_utils import tenacity_retry
|
|
28
|
+
from hatchet_sdk.v0.connection import new_conn
|
|
29
29
|
|
|
30
30
|
from ...loader import ClientConfig
|
|
31
31
|
from ...metadata import get_metadata
|
hatchet_sdk/v0/clients/events.py
CHANGED
|
@@ -7,15 +7,15 @@ from uuid import uuid4
|
|
|
7
7
|
import grpc
|
|
8
8
|
from google.protobuf import timestamp_pb2
|
|
9
9
|
|
|
10
|
-
from hatchet_sdk.
|
|
11
|
-
from hatchet_sdk.v0.contracts.events_pb2 import (
|
|
10
|
+
from hatchet_sdk.contracts.events_pb2 import (
|
|
12
11
|
BulkPushEventRequest,
|
|
13
12
|
Event,
|
|
14
13
|
PushEventRequest,
|
|
15
14
|
PutLogRequest,
|
|
16
15
|
PutStreamEventRequest,
|
|
17
16
|
)
|
|
18
|
-
from hatchet_sdk.
|
|
17
|
+
from hatchet_sdk.contracts.events_pb2_grpc import EventsServiceStub
|
|
18
|
+
from hatchet_sdk.v0.clients.rest.tenacity_utils import tenacity_retry
|
|
19
19
|
|
|
20
20
|
from ..loader import ClientConfig
|
|
21
21
|
from ..metadata import get_metadata
|
|
@@ -4,15 +4,15 @@ from typing import AsyncGenerator
|
|
|
4
4
|
|
|
5
5
|
import grpc
|
|
6
6
|
|
|
7
|
-
from hatchet_sdk.
|
|
8
|
-
from hatchet_sdk.v0.contracts.dispatcher_pb2 import (
|
|
7
|
+
from hatchet_sdk.contracts.dispatcher_pb2 import (
|
|
9
8
|
RESOURCE_TYPE_STEP_RUN,
|
|
10
9
|
RESOURCE_TYPE_WORKFLOW_RUN,
|
|
11
10
|
ResourceEventType,
|
|
12
11
|
SubscribeToWorkflowEventsRequest,
|
|
13
12
|
WorkflowEvent,
|
|
14
13
|
)
|
|
15
|
-
from hatchet_sdk.
|
|
14
|
+
from hatchet_sdk.contracts.dispatcher_pb2_grpc import DispatcherStub
|
|
15
|
+
from hatchet_sdk.v0.connection import new_conn
|
|
16
16
|
|
|
17
17
|
from ..loader import ClientConfig
|
|
18
18
|
from ..metadata import get_metadata
|
|
@@ -6,16 +6,16 @@ from typing import AsyncGenerator
|
|
|
6
6
|
import grpc
|
|
7
7
|
from grpc._cython import cygrpc
|
|
8
8
|
|
|
9
|
-
from hatchet_sdk.
|
|
10
|
-
from hatchet_sdk.v0.connection import new_conn
|
|
11
|
-
from hatchet_sdk.v0.contracts.dispatcher_pb2 import (
|
|
9
|
+
from hatchet_sdk.contracts.dispatcher_pb2 import (
|
|
12
10
|
SubscribeToWorkflowRunsRequest,
|
|
13
11
|
WorkflowRunEvent,
|
|
14
12
|
)
|
|
15
|
-
from hatchet_sdk.
|
|
13
|
+
from hatchet_sdk.contracts.dispatcher_pb2_grpc import DispatcherStub
|
|
14
|
+
from hatchet_sdk.v0.clients.event_ts import ThreadSafeEvent, read_with_interrupt
|
|
15
|
+
from hatchet_sdk.v0.connection import new_conn
|
|
16
16
|
|
|
17
|
+
from ...logger import logger
|
|
17
18
|
from ..loader import ClientConfig
|
|
18
|
-
from ..logger import logger
|
|
19
19
|
from ..metadata import get_metadata
|
|
20
20
|
|
|
21
21
|
DEFAULT_WORKFLOW_LISTENER_RETRY_INTERVAL = 3 # seconds
|
|
@@ -7,21 +7,22 @@ from warnings import warn
|
|
|
7
7
|
|
|
8
8
|
from pydantic import BaseModel, StrictStr
|
|
9
9
|
|
|
10
|
+
from hatchet_sdk.contracts.dispatcher_pb2 import OverridesData
|
|
11
|
+
from hatchet_sdk.contracts.workflows_pb2 import (
|
|
12
|
+
BulkTriggerWorkflowRequest,
|
|
13
|
+
TriggerWorkflowRequest,
|
|
14
|
+
)
|
|
10
15
|
from hatchet_sdk.v0.clients.events import EventClient
|
|
11
16
|
from hatchet_sdk.v0.clients.rest.tenacity_utils import tenacity_retry
|
|
12
17
|
from hatchet_sdk.v0.clients.rest_client import RestApi
|
|
13
18
|
from hatchet_sdk.v0.clients.run_event_listener import RunEventListenerClient
|
|
14
19
|
from hatchet_sdk.v0.clients.workflow_listener import PooledWorkflowRunListener
|
|
15
20
|
from hatchet_sdk.v0.context.worker_context import WorkerContext
|
|
16
|
-
from hatchet_sdk.v0.contracts.dispatcher_pb2 import OverridesData
|
|
17
|
-
from hatchet_sdk.v0.contracts.workflows_pb2 import (
|
|
18
|
-
BulkTriggerWorkflowRequest,
|
|
19
|
-
TriggerWorkflowRequest,
|
|
20
|
-
)
|
|
21
21
|
from hatchet_sdk.v0.utils.types import WorkflowValidator
|
|
22
22
|
from hatchet_sdk.v0.utils.typing import is_basemodel_subclass
|
|
23
23
|
from hatchet_sdk.v0.workflow_run import WorkflowRunRef
|
|
24
24
|
|
|
25
|
+
from ...logger import logger
|
|
25
26
|
from ..clients.admin import (
|
|
26
27
|
AdminClient,
|
|
27
28
|
ChildTriggerWorkflowOptions,
|
|
@@ -33,7 +34,6 @@ from ..clients.dispatcher.dispatcher import ( # type: ignore[attr-defined]
|
|
|
33
34
|
Action,
|
|
34
35
|
DispatcherClient,
|
|
35
36
|
)
|
|
36
|
-
from ..logger import logger
|
|
37
37
|
|
|
38
38
|
DEFAULT_WORKFLOW_POLLING_INTERVAL = 5 # Seconds
|
|
39
39
|
|
hatchet_sdk/v0/hatchet.py
CHANGED
|
@@ -5,14 +5,14 @@ from typing import Any, Callable, Optional, ParamSpec, Type, TypeVar, Union
|
|
|
5
5
|
from pydantic import BaseModel
|
|
6
6
|
from typing_extensions import deprecated
|
|
7
7
|
|
|
8
|
-
from hatchet_sdk.
|
|
9
|
-
from hatchet_sdk.v0.context.context import Context
|
|
10
|
-
from hatchet_sdk.v0.contracts.workflows_pb2 import (
|
|
8
|
+
from hatchet_sdk.contracts.workflows_pb2 import (
|
|
11
9
|
ConcurrencyLimitStrategy,
|
|
12
10
|
CreateStepRateLimit,
|
|
13
11
|
DesiredWorkerLabels,
|
|
14
12
|
StickyStrategy,
|
|
15
13
|
)
|
|
14
|
+
from hatchet_sdk.v0.clients.rest_client import RestApi
|
|
15
|
+
from hatchet_sdk.v0.context.context import Context
|
|
16
16
|
from hatchet_sdk.v0.features.cron import CronClient
|
|
17
17
|
from hatchet_sdk.v0.features.scheduled import ScheduledClient
|
|
18
18
|
from hatchet_sdk.v0.labels import DesiredWorkerLabel
|
|
@@ -20,12 +20,12 @@ from hatchet_sdk.v0.loader import ClientConfig, ConfigLoader
|
|
|
20
20
|
from hatchet_sdk.v0.rate_limit import RateLimit
|
|
21
21
|
from hatchet_sdk.v0.v2.callable import HatchetCallable
|
|
22
22
|
|
|
23
|
+
from ..logger import logger
|
|
23
24
|
from .client import Client, new_client, new_client_raw
|
|
24
25
|
from .clients.admin import AdminClient
|
|
25
26
|
from .clients.dispatcher.dispatcher import DispatcherClient
|
|
26
27
|
from .clients.events import EventClient
|
|
27
28
|
from .clients.run_event_listener import RunEventListenerClient
|
|
28
|
-
from .logger import logger
|
|
29
29
|
from .worker.worker import Worker
|
|
30
30
|
from .workflow import (
|
|
31
31
|
ConcurrencyExpression,
|
|
@@ -25,6 +25,7 @@ except (RuntimeError, ImportError, ModuleNotFoundError):
|
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
import hatchet_sdk
|
|
28
|
+
from hatchet_sdk.contracts.events_pb2 import Event
|
|
28
29
|
from hatchet_sdk.v0.clients.admin import (
|
|
29
30
|
AdminClient,
|
|
30
31
|
TriggerWorkflowOptions,
|
|
@@ -36,7 +37,6 @@ from hatchet_sdk.v0.clients.events import (
|
|
|
36
37
|
EventClient,
|
|
37
38
|
PushEventOptions,
|
|
38
39
|
)
|
|
39
|
-
from hatchet_sdk.v0.contracts.events_pb2 import Event
|
|
40
40
|
from hatchet_sdk.v0.worker.runner.runner import Runner
|
|
41
41
|
from hatchet_sdk.v0.workflow_run import WorkflowRunRef
|
|
42
42
|
|
hatchet_sdk/v0/rate_limit.py
CHANGED
|
@@ -3,7 +3,7 @@ from typing import Union
|
|
|
3
3
|
|
|
4
4
|
from celpy import CELEvalError, Environment
|
|
5
5
|
|
|
6
|
-
from hatchet_sdk.
|
|
6
|
+
from hatchet_sdk.contracts.workflows_pb2 import CreateStepRateLimit
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def validate_cel_expression(expr: str) -> bool:
|
hatchet_sdk/v0/v2/callable.py
CHANGED
|
@@ -11,9 +11,7 @@ from typing import (
|
|
|
11
11
|
Union,
|
|
12
12
|
)
|
|
13
13
|
|
|
14
|
-
from hatchet_sdk.
|
|
15
|
-
from hatchet_sdk.v0.context.context import Context
|
|
16
|
-
from hatchet_sdk.v0.contracts.workflows_pb2 import ( # type: ignore[attr-defined]
|
|
14
|
+
from hatchet_sdk.contracts.workflows_pb2 import ( # type: ignore[attr-defined]
|
|
17
15
|
CreateStepRateLimit,
|
|
18
16
|
CreateWorkflowJobOpts,
|
|
19
17
|
CreateWorkflowStepOpts,
|
|
@@ -23,8 +21,10 @@ from hatchet_sdk.v0.contracts.workflows_pb2 import ( # type: ignore[attr-define
|
|
|
23
21
|
WorkflowConcurrencyOpts,
|
|
24
22
|
WorkflowKind,
|
|
25
23
|
)
|
|
24
|
+
from hatchet_sdk.logger import logger
|
|
25
|
+
from hatchet_sdk.v0.clients.admin import ChildTriggerWorkflowOptions
|
|
26
|
+
from hatchet_sdk.v0.context.context import Context
|
|
26
27
|
from hatchet_sdk.v0.labels import DesiredWorkerLabel
|
|
27
|
-
from hatchet_sdk.v0.logger import logger
|
|
28
28
|
from hatchet_sdk.v0.rate_limit import RateLimit
|
|
29
29
|
from hatchet_sdk.v0.v2.concurrency import ConcurrencyFunction
|
|
30
30
|
from hatchet_sdk.v0.workflow_run import RunRef
|
hatchet_sdk/v0/v2/concurrency.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from typing import Any, Callable
|
|
2
2
|
|
|
3
|
-
from hatchet_sdk.
|
|
4
|
-
from hatchet_sdk.v0.contracts.workflows_pb2 import ( # type: ignore[attr-defined]
|
|
3
|
+
from hatchet_sdk.contracts.workflows_pb2 import ( # type: ignore[attr-defined]
|
|
5
4
|
ConcurrencyLimitStrategy,
|
|
6
5
|
)
|
|
6
|
+
from hatchet_sdk.v0.context.context import Context
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class ConcurrencyFunction:
|
hatchet_sdk/v0/v2/hatchet.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from typing import Any, Callable, TypeVar, Union
|
|
2
2
|
|
|
3
|
-
from hatchet_sdk.
|
|
4
|
-
from hatchet_sdk.v0.context.context import Context
|
|
5
|
-
from hatchet_sdk.v0.contracts.workflows_pb2 import ( # type: ignore[attr-defined]
|
|
3
|
+
from hatchet_sdk.contracts.workflows_pb2 import ( # type: ignore[attr-defined]
|
|
6
4
|
ConcurrencyLimitStrategy,
|
|
7
5
|
StickyStrategy,
|
|
8
6
|
)
|
|
7
|
+
from hatchet_sdk.v0 import Worker
|
|
8
|
+
from hatchet_sdk.v0.context.context import Context
|
|
9
9
|
from hatchet_sdk.v0.hatchet import Hatchet as HatchetV1
|
|
10
10
|
from hatchet_sdk.v0.hatchet import workflow
|
|
11
11
|
from hatchet_sdk.v0.labels import DesiredWorkerLabel
|
|
@@ -8,6 +8,12 @@ from typing import Any, List, Mapping, Optional
|
|
|
8
8
|
|
|
9
9
|
import grpc
|
|
10
10
|
|
|
11
|
+
from hatchet_sdk.contracts.dispatcher_pb2 import (
|
|
12
|
+
GROUP_KEY_EVENT_TYPE_STARTED,
|
|
13
|
+
STEP_EVENT_TYPE_STARTED,
|
|
14
|
+
ActionType,
|
|
15
|
+
)
|
|
16
|
+
from hatchet_sdk.logger import logger
|
|
11
17
|
from hatchet_sdk.v0.client import Client, new_client_raw
|
|
12
18
|
from hatchet_sdk.v0.clients.dispatcher.action_listener import Action
|
|
13
19
|
from hatchet_sdk.v0.clients.dispatcher.dispatcher import (
|
|
@@ -16,13 +22,7 @@ from hatchet_sdk.v0.clients.dispatcher.dispatcher import (
|
|
|
16
22
|
new_dispatcher,
|
|
17
23
|
)
|
|
18
24
|
from hatchet_sdk.v0.clients.rest.models.update_worker_request import UpdateWorkerRequest
|
|
19
|
-
from hatchet_sdk.v0.contracts.dispatcher_pb2 import (
|
|
20
|
-
GROUP_KEY_EVENT_TYPE_STARTED,
|
|
21
|
-
STEP_EVENT_TYPE_STARTED,
|
|
22
|
-
ActionType,
|
|
23
|
-
)
|
|
24
25
|
from hatchet_sdk.v0.loader import ClientConfig
|
|
25
|
-
from hatchet_sdk.v0.logger import logger
|
|
26
26
|
from hatchet_sdk.v0.utils.backoff import exp_backoff_sleep
|
|
27
27
|
|
|
28
28
|
ACTION_EVENT_RETRY_COUNT = 5
|
|
@@ -4,11 +4,11 @@ from dataclasses import dataclass, field
|
|
|
4
4
|
from multiprocessing import Queue
|
|
5
5
|
from typing import Callable, TypeVar
|
|
6
6
|
|
|
7
|
+
from hatchet_sdk.logger import logger
|
|
7
8
|
from hatchet_sdk.v0 import Context
|
|
8
9
|
from hatchet_sdk.v0.client import Client, new_client_raw
|
|
9
10
|
from hatchet_sdk.v0.clients.dispatcher.action_listener import Action
|
|
10
11
|
from hatchet_sdk.v0.loader import ClientConfig
|
|
11
|
-
from hatchet_sdk.v0.logger import logger
|
|
12
12
|
from hatchet_sdk.v0.utils.types import WorkflowValidator
|
|
13
13
|
from hatchet_sdk.v0.worker.runner.runner import Runner
|
|
14
14
|
from hatchet_sdk.v0.worker.runner.utils.capture_logs import capture_logs
|
|
@@ -13,15 +13,7 @@ from typing import Any, Callable, Dict, cast
|
|
|
13
13
|
|
|
14
14
|
from pydantic import BaseModel
|
|
15
15
|
|
|
16
|
-
from hatchet_sdk.
|
|
17
|
-
from hatchet_sdk.v0.clients.admin import new_admin
|
|
18
|
-
from hatchet_sdk.v0.clients.dispatcher.action_listener import Action
|
|
19
|
-
from hatchet_sdk.v0.clients.dispatcher.dispatcher import new_dispatcher
|
|
20
|
-
from hatchet_sdk.v0.clients.run_event_listener import new_listener
|
|
21
|
-
from hatchet_sdk.v0.clients.workflow_listener import PooledWorkflowRunListener
|
|
22
|
-
from hatchet_sdk.v0.context import Context # type: ignore[attr-defined]
|
|
23
|
-
from hatchet_sdk.v0.context.worker_context import WorkerContext
|
|
24
|
-
from hatchet_sdk.v0.contracts.dispatcher_pb2 import (
|
|
16
|
+
from hatchet_sdk.contracts.dispatcher_pb2 import (
|
|
25
17
|
GROUP_KEY_EVENT_TYPE_COMPLETED,
|
|
26
18
|
GROUP_KEY_EVENT_TYPE_FAILED,
|
|
27
19
|
GROUP_KEY_EVENT_TYPE_STARTED,
|
|
@@ -30,8 +22,16 @@ from hatchet_sdk.v0.contracts.dispatcher_pb2 import (
|
|
|
30
22
|
STEP_EVENT_TYPE_STARTED,
|
|
31
23
|
ActionType,
|
|
32
24
|
)
|
|
25
|
+
from hatchet_sdk.logger import logger
|
|
26
|
+
from hatchet_sdk.v0.client import new_client_raw
|
|
27
|
+
from hatchet_sdk.v0.clients.admin import new_admin
|
|
28
|
+
from hatchet_sdk.v0.clients.dispatcher.action_listener import Action
|
|
29
|
+
from hatchet_sdk.v0.clients.dispatcher.dispatcher import new_dispatcher
|
|
30
|
+
from hatchet_sdk.v0.clients.run_event_listener import new_listener
|
|
31
|
+
from hatchet_sdk.v0.clients.workflow_listener import PooledWorkflowRunListener
|
|
32
|
+
from hatchet_sdk.v0.context import Context # type: ignore[attr-defined]
|
|
33
|
+
from hatchet_sdk.v0.context.worker_context import WorkerContext
|
|
33
34
|
from hatchet_sdk.v0.loader import ClientConfig
|
|
34
|
-
from hatchet_sdk.v0.logger import logger
|
|
35
35
|
from hatchet_sdk.v0.utils.types import WorkflowValidator
|
|
36
36
|
from hatchet_sdk.v0.v2.callable import DurableContext
|
|
37
37
|
from hatchet_sdk.v0.worker.action_listener_process import ActionEvent
|
|
@@ -5,7 +5,7 @@ from concurrent.futures import ThreadPoolExecutor
|
|
|
5
5
|
from io import StringIO
|
|
6
6
|
from typing import Any, Coroutine
|
|
7
7
|
|
|
8
|
-
from hatchet_sdk
|
|
8
|
+
from hatchet_sdk import logger
|
|
9
9
|
from hatchet_sdk.v0.clients.events import EventClient
|
|
10
10
|
|
|
11
11
|
wr: contextvars.ContextVar[str | None] = contextvars.ContextVar(
|
hatchet_sdk/v0/worker/worker.py
CHANGED
|
@@ -17,11 +17,11 @@ from aiohttp.web_request import Request
|
|
|
17
17
|
from aiohttp.web_response import Response
|
|
18
18
|
from prometheus_client import CONTENT_TYPE_LATEST, Gauge, generate_latest
|
|
19
19
|
|
|
20
|
+
from hatchet_sdk.contracts.workflows_pb2 import CreateWorkflowVersionOpts
|
|
21
|
+
from hatchet_sdk.logger import logger
|
|
20
22
|
from hatchet_sdk.v0 import Context
|
|
21
23
|
from hatchet_sdk.v0.client import Client, new_client_raw
|
|
22
|
-
from hatchet_sdk.v0.contracts.workflows_pb2 import CreateWorkflowVersionOpts
|
|
23
24
|
from hatchet_sdk.v0.loader import ClientConfig
|
|
24
|
-
from hatchet_sdk.v0.logger import logger
|
|
25
25
|
from hatchet_sdk.v0.utils.types import WorkflowValidator
|
|
26
26
|
from hatchet_sdk.v0.utils.typing import is_basemodel_subclass
|
|
27
27
|
from hatchet_sdk.v0.v2.callable import HatchetCallable
|