durabletask.azuremanaged 1.5.0__tar.gz → 1.6.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.
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/PKG-INFO +3 -3
- durabletask_azuremanaged-1.6.0/durabletask/azuremanaged/internal/sandbox_service_pb2.py +55 -0
- durabletask_azuremanaged-1.6.0/durabletask/azuremanaged/internal/sandbox_service_pb2.pyi +119 -0
- durabletask_azuremanaged-1.6.0/durabletask/azuremanaged/internal/sandbox_service_pb2_grpc.py +197 -0
- durabletask_azuremanaged-1.6.0/durabletask/azuremanaged/preview/__init__.py +4 -0
- durabletask_azuremanaged-1.6.0/durabletask/azuremanaged/preview/sandboxes/__init__.py +32 -0
- durabletask_azuremanaged-1.6.0/durabletask/azuremanaged/preview/sandboxes/client.py +61 -0
- durabletask_azuremanaged-1.6.0/durabletask/azuremanaged/preview/sandboxes/helpers.py +54 -0
- durabletask_azuremanaged-1.6.0/durabletask/azuremanaged/preview/sandboxes/profile_builder.py +180 -0
- durabletask_azuremanaged-1.6.0/durabletask/azuremanaged/preview/sandboxes/transport.py +83 -0
- durabletask_azuremanaged-1.6.0/durabletask/azuremanaged/preview/sandboxes/worker.py +281 -0
- durabletask_azuremanaged-1.6.0/durabletask/azuremanaged/preview/sandboxes/worker_messages.py +68 -0
- durabletask_azuremanaged-1.6.0/durabletask/azuremanaged/preview/sandboxes/worker_profiles.py +101 -0
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/durabletask.azuremanaged.egg-info/PKG-INFO +3 -3
- durabletask_azuremanaged-1.6.0/durabletask.azuremanaged.egg-info/SOURCES.txt +25 -0
- durabletask_azuremanaged-1.6.0/durabletask.azuremanaged.egg-info/requires.txt +5 -0
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/pyproject.toml +3 -3
- durabletask_azuremanaged-1.5.0/durabletask.azuremanaged.egg-info/SOURCES.txt +0 -13
- durabletask_azuremanaged-1.5.0/durabletask.azuremanaged.egg-info/requires.txt +0 -5
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/__init__.py +0 -0
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/client.py +0 -0
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/internal/access_token_manager.py +0 -0
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/internal/durabletask_grpc_interceptor.py +0 -0
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/internal/py.typed +0 -0
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/py.typed +0 -0
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/worker.py +0 -0
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/durabletask.azuremanaged.egg-info/dependency_links.txt +0 -0
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/durabletask.azuremanaged.egg-info/top_level.txt +0 -0
- {durabletask_azuremanaged-1.5.0 → durabletask_azuremanaged-1.6.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: durabletask.azuremanaged
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.0
|
|
4
4
|
Summary: Durable Task Python SDK provider implementation for the Azure Durable Task Scheduler
|
|
5
5
|
Project-URL: repository, https://github.com/microsoft/durabletask-python
|
|
6
6
|
Project-URL: changelog, https://github.com/microsoft/durabletask-python/blob/main/CHANGELOG.md
|
|
@@ -10,7 +10,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
11
|
Requires-Python: >=3.10
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
|
-
Requires-Dist: durabletask>=1.
|
|
13
|
+
Requires-Dist: durabletask>=1.6.0
|
|
14
14
|
Requires-Dist: azure-identity>=1.19.0
|
|
15
15
|
Provides-Extra: azure-blob-payloads
|
|
16
|
-
Requires-Dist: durabletask[azure-blob-payloads]>=1.
|
|
16
|
+
Requires-Dist: durabletask[azure-blob-payloads]>=1.6.0; extra == "azure-blob-payloads"
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# source: durabletask/azuremanaged/internal/sandbox_service.proto
|
|
4
|
+
# Protobuf Python Version: 5.26.1
|
|
5
|
+
"""Generated protocol buffer code."""
|
|
6
|
+
from google.protobuf import descriptor as _descriptor
|
|
7
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
8
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
9
|
+
from google.protobuf.internal import builder as _builder
|
|
10
|
+
# @@protoc_insertion_point(imports)
|
|
11
|
+
|
|
12
|
+
_sym_db = _symbol_database.Default()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n7durabletask/azuremanaged/internal/sandbox_service.proto\x12\x1fmicrosoft.durabletask.sandboxes\"\xcd\x01\n\x1cSandboxActivityWorkerMessage\x12L\n\x05start\x18\x01 \x01(\x0b\x32;.microsoft.durabletask.sandboxes.SandboxActivityWorkerStartH\x00\x12T\n\theartbeat\x18\x02 \x01(\x0b\x32?.microsoft.durabletask.sandboxes.SandboxActivityWorkerHeartbeatH\x00\x42\t\n\x07message\"\x9d\x02\n\x1aSandboxActivityWorkerStart\x12\x10\n\x08task_hub\x18\x01 \x01(\t\x12\x1c\n\x14max_activities_count\x18\x02 \x01(\x05\x12N\n\x10sandbox_provider\x18\x03 \x01(\x0e\x32\x34.microsoft.durabletask.sandboxes.SandboxProviderKind\x12\x1e\n\x16\x64ts_sandbox_identifier\x18\x04 \x01(\t\x12\x19\n\x11worker_profile_id\x18\x05 \x01(\t\x12\x44\n\nactivities\x18\x06 \x03(\x0b\x32\x30.microsoft.durabletask.sandboxes.SandboxActivity\"A\n\x1eSandboxActivityWorkerHeartbeat\x12\x1f\n\x17\x61\x63tive_activities_count\x18\x01 \x01(\x05\"5\n\"SandboxActivityWorkerSessionResult\x12\x0f\n\x07message\x18\x01 \x01(\t\"\x89\x04\n\x14SandboxWorkerProfile\x12\x19\n\x11worker_profile_id\x18\x01 \x01(\t\x12\x44\n\nactivities\x18\x02 \x03(\x0b\x32\x30.microsoft.durabletask.sandboxes.SandboxActivity\x12\x44\n\x05image\x18\x03 \x01(\x0b\x32\x35.microsoft.durabletask.sandboxes.SandboxActivityImage\x12n\n\x15\x65nvironment_variables\x18\x04 \x03(\x0b\x32O.microsoft.durabletask.sandboxes.SandboxWorkerProfile.EnvironmentVariablesEntry\x12!\n\x19max_concurrent_activities\x18\x05 \x01(\x05\x12L\n\tresources\x18\x06 \x01(\x0b\x32\x39.microsoft.durabletask.sandboxes.SandboxActivityResources\x12,\n$scheduler_managed_identity_client_id\x18\x07 \x01(\t\x1a;\n\x19\x45nvironmentVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"0\n\x0fSandboxActivity\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\"n\n\x14SandboxActivityImage\x12\x11\n\timage_ref\x18\x01 \x01(\t\x12\"\n\x1amanaged_identity_client_id\x18\x02 \x01(\t\x12\x12\n\nentrypoint\x18\x03 \x03(\t\x12\x0b\n\x03\x63md\x18\x04 \x03(\t\"7\n\x18SandboxActivityResources\x12\x0b\n\x03\x63pu\x18\x01 \x01(\t\x12\x0e\n\x06memory\x18\x02 \x01(\t\"#\n!DeclareSandboxWorkerProfileResult\">\n!RemoveSandboxWorkerProfileRequest\x12\x19\n\x11worker_profile_id\x18\x01 \x01(\t\"\"\n RemoveSandboxWorkerProfileResult*\x8b\x01\n\x13SandboxProviderKind\x12%\n!SANDBOX_PROVIDER_KIND_UNSPECIFIED\x10\x00\x12*\n&SANDBOX_PROVIDER_KIND_ACA_SESSION_POOL\x10\x01\x12!\n\x1dSANDBOX_PROVIDER_KIND_SANDBOX\x10\x02\x32\xfb\x03\n\x11SandboxActivities\x12\xa4\x01\n\x1c\x43onnectSandboxActivityWorker\x12=.microsoft.durabletask.sandboxes.SandboxActivityWorkerMessage\x1a\x43.microsoft.durabletask.sandboxes.SandboxActivityWorkerSessionResult(\x01\x12\x98\x01\n\x1b\x44\x65\x63lareSandboxWorkerProfile\x12\x35.microsoft.durabletask.sandboxes.SandboxWorkerProfile\x1a\x42.microsoft.durabletask.sandboxes.DeclareSandboxWorkerProfileResult\x12\xa3\x01\n\x1aRemoveSandboxWorkerProfile\x12\x42.microsoft.durabletask.sandboxes.RemoveSandboxWorkerProfileRequest\x1a\x41.microsoft.durabletask.sandboxes.RemoveSandboxWorkerProfileResultB+\xaa\x02(Microsoft.DurableTask.Protobuf.Sandboxesb\x06proto3')
|
|
18
|
+
|
|
19
|
+
_globals = globals()
|
|
20
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
21
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'durabletask.azuremanaged.internal.sandbox_service_pb2', _globals)
|
|
22
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
23
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
24
|
+
_globals['DESCRIPTOR']._serialized_options = b'\252\002(Microsoft.DurableTask.Protobuf.Sandboxes'
|
|
25
|
+
_globals['_SANDBOXWORKERPROFILE_ENVIRONMENTVARIABLESENTRY']._loaded_options = None
|
|
26
|
+
_globals['_SANDBOXWORKERPROFILE_ENVIRONMENTVARIABLESENTRY']._serialized_options = b'8\001'
|
|
27
|
+
_globals['_SANDBOXPROVIDERKIND']._serialized_start=1591
|
|
28
|
+
_globals['_SANDBOXPROVIDERKIND']._serialized_end=1730
|
|
29
|
+
_globals['_SANDBOXACTIVITYWORKERMESSAGE']._serialized_start=93
|
|
30
|
+
_globals['_SANDBOXACTIVITYWORKERMESSAGE']._serialized_end=298
|
|
31
|
+
_globals['_SANDBOXACTIVITYWORKERSTART']._serialized_start=301
|
|
32
|
+
_globals['_SANDBOXACTIVITYWORKERSTART']._serialized_end=586
|
|
33
|
+
_globals['_SANDBOXACTIVITYWORKERHEARTBEAT']._serialized_start=588
|
|
34
|
+
_globals['_SANDBOXACTIVITYWORKERHEARTBEAT']._serialized_end=653
|
|
35
|
+
_globals['_SANDBOXACTIVITYWORKERSESSIONRESULT']._serialized_start=655
|
|
36
|
+
_globals['_SANDBOXACTIVITYWORKERSESSIONRESULT']._serialized_end=708
|
|
37
|
+
_globals['_SANDBOXWORKERPROFILE']._serialized_start=711
|
|
38
|
+
_globals['_SANDBOXWORKERPROFILE']._serialized_end=1232
|
|
39
|
+
_globals['_SANDBOXWORKERPROFILE_ENVIRONMENTVARIABLESENTRY']._serialized_start=1173
|
|
40
|
+
_globals['_SANDBOXWORKERPROFILE_ENVIRONMENTVARIABLESENTRY']._serialized_end=1232
|
|
41
|
+
_globals['_SANDBOXACTIVITY']._serialized_start=1234
|
|
42
|
+
_globals['_SANDBOXACTIVITY']._serialized_end=1282
|
|
43
|
+
_globals['_SANDBOXACTIVITYIMAGE']._serialized_start=1284
|
|
44
|
+
_globals['_SANDBOXACTIVITYIMAGE']._serialized_end=1394
|
|
45
|
+
_globals['_SANDBOXACTIVITYRESOURCES']._serialized_start=1396
|
|
46
|
+
_globals['_SANDBOXACTIVITYRESOURCES']._serialized_end=1451
|
|
47
|
+
_globals['_DECLARESANDBOXWORKERPROFILERESULT']._serialized_start=1453
|
|
48
|
+
_globals['_DECLARESANDBOXWORKERPROFILERESULT']._serialized_end=1488
|
|
49
|
+
_globals['_REMOVESANDBOXWORKERPROFILEREQUEST']._serialized_start=1490
|
|
50
|
+
_globals['_REMOVESANDBOXWORKERPROFILEREQUEST']._serialized_end=1552
|
|
51
|
+
_globals['_REMOVESANDBOXWORKERPROFILERESULT']._serialized_start=1554
|
|
52
|
+
_globals['_REMOVESANDBOXWORKERPROFILERESULT']._serialized_end=1588
|
|
53
|
+
_globals['_SANDBOXACTIVITIES']._serialized_start=1733
|
|
54
|
+
_globals['_SANDBOXACTIVITIES']._serialized_end=2240
|
|
55
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
from google.protobuf.internal import containers as _containers
|
|
2
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
3
|
+
from google.protobuf import descriptor as _descriptor
|
|
4
|
+
from google.protobuf import message as _message
|
|
5
|
+
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
|
6
|
+
|
|
7
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
8
|
+
|
|
9
|
+
class SandboxProviderKind(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
10
|
+
__slots__ = ()
|
|
11
|
+
SANDBOX_PROVIDER_KIND_UNSPECIFIED: _ClassVar[SandboxProviderKind]
|
|
12
|
+
SANDBOX_PROVIDER_KIND_ACA_SESSION_POOL: _ClassVar[SandboxProviderKind]
|
|
13
|
+
SANDBOX_PROVIDER_KIND_SANDBOX: _ClassVar[SandboxProviderKind]
|
|
14
|
+
SANDBOX_PROVIDER_KIND_UNSPECIFIED: SandboxProviderKind
|
|
15
|
+
SANDBOX_PROVIDER_KIND_ACA_SESSION_POOL: SandboxProviderKind
|
|
16
|
+
SANDBOX_PROVIDER_KIND_SANDBOX: SandboxProviderKind
|
|
17
|
+
|
|
18
|
+
class SandboxActivityWorkerMessage(_message.Message):
|
|
19
|
+
__slots__ = ("start", "heartbeat")
|
|
20
|
+
START_FIELD_NUMBER: _ClassVar[int]
|
|
21
|
+
HEARTBEAT_FIELD_NUMBER: _ClassVar[int]
|
|
22
|
+
start: SandboxActivityWorkerStart
|
|
23
|
+
heartbeat: SandboxActivityWorkerHeartbeat
|
|
24
|
+
def __init__(self, start: _Optional[_Union[SandboxActivityWorkerStart, _Mapping]] = ..., heartbeat: _Optional[_Union[SandboxActivityWorkerHeartbeat, _Mapping]] = ...) -> None: ...
|
|
25
|
+
|
|
26
|
+
class SandboxActivityWorkerStart(_message.Message):
|
|
27
|
+
__slots__ = ("task_hub", "max_activities_count", "sandbox_provider", "dts_sandbox_identifier", "worker_profile_id", "activities")
|
|
28
|
+
TASK_HUB_FIELD_NUMBER: _ClassVar[int]
|
|
29
|
+
MAX_ACTIVITIES_COUNT_FIELD_NUMBER: _ClassVar[int]
|
|
30
|
+
SANDBOX_PROVIDER_FIELD_NUMBER: _ClassVar[int]
|
|
31
|
+
DTS_SANDBOX_IDENTIFIER_FIELD_NUMBER: _ClassVar[int]
|
|
32
|
+
WORKER_PROFILE_ID_FIELD_NUMBER: _ClassVar[int]
|
|
33
|
+
ACTIVITIES_FIELD_NUMBER: _ClassVar[int]
|
|
34
|
+
task_hub: str
|
|
35
|
+
max_activities_count: int
|
|
36
|
+
sandbox_provider: SandboxProviderKind
|
|
37
|
+
dts_sandbox_identifier: str
|
|
38
|
+
worker_profile_id: str
|
|
39
|
+
activities: _containers.RepeatedCompositeFieldContainer[SandboxActivity]
|
|
40
|
+
def __init__(self, task_hub: _Optional[str] = ..., max_activities_count: _Optional[int] = ..., sandbox_provider: _Optional[_Union[SandboxProviderKind, str]] = ..., dts_sandbox_identifier: _Optional[str] = ..., worker_profile_id: _Optional[str] = ..., activities: _Optional[_Iterable[_Union[SandboxActivity, _Mapping]]] = ...) -> None: ...
|
|
41
|
+
|
|
42
|
+
class SandboxActivityWorkerHeartbeat(_message.Message):
|
|
43
|
+
__slots__ = ("active_activities_count",)
|
|
44
|
+
ACTIVE_ACTIVITIES_COUNT_FIELD_NUMBER: _ClassVar[int]
|
|
45
|
+
active_activities_count: int
|
|
46
|
+
def __init__(self, active_activities_count: _Optional[int] = ...) -> None: ...
|
|
47
|
+
|
|
48
|
+
class SandboxActivityWorkerSessionResult(_message.Message):
|
|
49
|
+
__slots__ = ("message",)
|
|
50
|
+
MESSAGE_FIELD_NUMBER: _ClassVar[int]
|
|
51
|
+
message: str
|
|
52
|
+
def __init__(self, message: _Optional[str] = ...) -> None: ...
|
|
53
|
+
|
|
54
|
+
class SandboxWorkerProfile(_message.Message):
|
|
55
|
+
__slots__ = ("worker_profile_id", "activities", "image", "environment_variables", "max_concurrent_activities", "resources", "scheduler_managed_identity_client_id")
|
|
56
|
+
class EnvironmentVariablesEntry(_message.Message):
|
|
57
|
+
__slots__ = ("key", "value")
|
|
58
|
+
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
59
|
+
VALUE_FIELD_NUMBER: _ClassVar[int]
|
|
60
|
+
key: str
|
|
61
|
+
value: str
|
|
62
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
|
|
63
|
+
WORKER_PROFILE_ID_FIELD_NUMBER: _ClassVar[int]
|
|
64
|
+
ACTIVITIES_FIELD_NUMBER: _ClassVar[int]
|
|
65
|
+
IMAGE_FIELD_NUMBER: _ClassVar[int]
|
|
66
|
+
ENVIRONMENT_VARIABLES_FIELD_NUMBER: _ClassVar[int]
|
|
67
|
+
MAX_CONCURRENT_ACTIVITIES_FIELD_NUMBER: _ClassVar[int]
|
|
68
|
+
RESOURCES_FIELD_NUMBER: _ClassVar[int]
|
|
69
|
+
SCHEDULER_MANAGED_IDENTITY_CLIENT_ID_FIELD_NUMBER: _ClassVar[int]
|
|
70
|
+
worker_profile_id: str
|
|
71
|
+
activities: _containers.RepeatedCompositeFieldContainer[SandboxActivity]
|
|
72
|
+
image: SandboxActivityImage
|
|
73
|
+
environment_variables: _containers.ScalarMap[str, str]
|
|
74
|
+
max_concurrent_activities: int
|
|
75
|
+
resources: SandboxActivityResources
|
|
76
|
+
scheduler_managed_identity_client_id: str
|
|
77
|
+
def __init__(self, worker_profile_id: _Optional[str] = ..., activities: _Optional[_Iterable[_Union[SandboxActivity, _Mapping]]] = ..., image: _Optional[_Union[SandboxActivityImage, _Mapping]] = ..., environment_variables: _Optional[_Mapping[str, str]] = ..., max_concurrent_activities: _Optional[int] = ..., resources: _Optional[_Union[SandboxActivityResources, _Mapping]] = ..., scheduler_managed_identity_client_id: _Optional[str] = ...) -> None: ...
|
|
78
|
+
|
|
79
|
+
class SandboxActivity(_message.Message):
|
|
80
|
+
__slots__ = ("name", "version")
|
|
81
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
82
|
+
VERSION_FIELD_NUMBER: _ClassVar[int]
|
|
83
|
+
name: str
|
|
84
|
+
version: str
|
|
85
|
+
def __init__(self, name: _Optional[str] = ..., version: _Optional[str] = ...) -> None: ...
|
|
86
|
+
|
|
87
|
+
class SandboxActivityImage(_message.Message):
|
|
88
|
+
__slots__ = ("image_ref", "managed_identity_client_id", "entrypoint", "cmd")
|
|
89
|
+
IMAGE_REF_FIELD_NUMBER: _ClassVar[int]
|
|
90
|
+
MANAGED_IDENTITY_CLIENT_ID_FIELD_NUMBER: _ClassVar[int]
|
|
91
|
+
ENTRYPOINT_FIELD_NUMBER: _ClassVar[int]
|
|
92
|
+
CMD_FIELD_NUMBER: _ClassVar[int]
|
|
93
|
+
image_ref: str
|
|
94
|
+
managed_identity_client_id: str
|
|
95
|
+
entrypoint: _containers.RepeatedScalarFieldContainer[str]
|
|
96
|
+
cmd: _containers.RepeatedScalarFieldContainer[str]
|
|
97
|
+
def __init__(self, image_ref: _Optional[str] = ..., managed_identity_client_id: _Optional[str] = ..., entrypoint: _Optional[_Iterable[str]] = ..., cmd: _Optional[_Iterable[str]] = ...) -> None: ...
|
|
98
|
+
|
|
99
|
+
class SandboxActivityResources(_message.Message):
|
|
100
|
+
__slots__ = ("cpu", "memory")
|
|
101
|
+
CPU_FIELD_NUMBER: _ClassVar[int]
|
|
102
|
+
MEMORY_FIELD_NUMBER: _ClassVar[int]
|
|
103
|
+
cpu: str
|
|
104
|
+
memory: str
|
|
105
|
+
def __init__(self, cpu: _Optional[str] = ..., memory: _Optional[str] = ...) -> None: ...
|
|
106
|
+
|
|
107
|
+
class DeclareSandboxWorkerProfileResult(_message.Message):
|
|
108
|
+
__slots__ = ()
|
|
109
|
+
def __init__(self) -> None: ...
|
|
110
|
+
|
|
111
|
+
class RemoveSandboxWorkerProfileRequest(_message.Message):
|
|
112
|
+
__slots__ = ("worker_profile_id",)
|
|
113
|
+
WORKER_PROFILE_ID_FIELD_NUMBER: _ClassVar[int]
|
|
114
|
+
worker_profile_id: str
|
|
115
|
+
def __init__(self, worker_profile_id: _Optional[str] = ...) -> None: ...
|
|
116
|
+
|
|
117
|
+
class RemoveSandboxWorkerProfileResult(_message.Message):
|
|
118
|
+
__slots__ = ()
|
|
119
|
+
def __init__(self) -> None: ...
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
from durabletask.azuremanaged.internal import sandbox_service_pb2 as durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2
|
|
7
|
+
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.65.4'
|
|
9
|
+
GRPC_VERSION = grpc.__version__
|
|
10
|
+
EXPECTED_ERROR_RELEASE = '1.66.0'
|
|
11
|
+
SCHEDULED_RELEASE_DATE = 'August 6, 2024'
|
|
12
|
+
_version_not_supported = False
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
from grpc._utilities import first_version_is_lower
|
|
16
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
17
|
+
except ImportError:
|
|
18
|
+
_version_not_supported = True
|
|
19
|
+
|
|
20
|
+
if _version_not_supported:
|
|
21
|
+
warnings.warn(
|
|
22
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
23
|
+
+ f' but the generated code in durabletask/azuremanaged/internal/sandbox_service_pb2_grpc.py depends on'
|
|
24
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
25
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
26
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
27
|
+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
|
|
28
|
+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
|
|
29
|
+
RuntimeWarning
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class SandboxActivitiesStub(object):
|
|
34
|
+
"""Missing associated documentation comment in .proto file."""
|
|
35
|
+
|
|
36
|
+
def __init__(self, channel):
|
|
37
|
+
"""Constructor.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
channel: A grpc.Channel.
|
|
41
|
+
"""
|
|
42
|
+
self.ConnectSandboxActivityWorker = channel.stream_unary(
|
|
43
|
+
'/microsoft.durabletask.sandboxes.SandboxActivities/ConnectSandboxActivityWorker',
|
|
44
|
+
request_serializer=durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.SandboxActivityWorkerMessage.SerializeToString,
|
|
45
|
+
response_deserializer=durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.SandboxActivityWorkerSessionResult.FromString,
|
|
46
|
+
_registered_method=True)
|
|
47
|
+
self.DeclareSandboxWorkerProfile = channel.unary_unary(
|
|
48
|
+
'/microsoft.durabletask.sandboxes.SandboxActivities/DeclareSandboxWorkerProfile',
|
|
49
|
+
request_serializer=durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.SandboxWorkerProfile.SerializeToString,
|
|
50
|
+
response_deserializer=durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.DeclareSandboxWorkerProfileResult.FromString,
|
|
51
|
+
_registered_method=True)
|
|
52
|
+
self.RemoveSandboxWorkerProfile = channel.unary_unary(
|
|
53
|
+
'/microsoft.durabletask.sandboxes.SandboxActivities/RemoveSandboxWorkerProfile',
|
|
54
|
+
request_serializer=durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.RemoveSandboxWorkerProfileRequest.SerializeToString,
|
|
55
|
+
response_deserializer=durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.RemoveSandboxWorkerProfileResult.FromString,
|
|
56
|
+
_registered_method=True)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class SandboxActivitiesServicer(object):
|
|
60
|
+
"""Missing associated documentation comment in .proto file."""
|
|
61
|
+
|
|
62
|
+
def ConnectSandboxActivityWorker(self, request_iterator, context):
|
|
63
|
+
"""Opens a live sandbox activity worker session. The first message
|
|
64
|
+
must be a start message with static worker metadata. Heartbeats carry
|
|
65
|
+
dynamic state only. Closing the stream deregisters the worker.
|
|
66
|
+
"""
|
|
67
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
68
|
+
context.set_details('Method not implemented!')
|
|
69
|
+
raise NotImplementedError('Method not implemented!')
|
|
70
|
+
|
|
71
|
+
def DeclareSandboxWorkerProfile(self, request, context):
|
|
72
|
+
"""Creates or updates a sandbox worker profile before any live worker stream exists.
|
|
73
|
+
This is a configuration contract and does not advertise active worker
|
|
74
|
+
capacity.
|
|
75
|
+
"""
|
|
76
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
77
|
+
context.set_details('Method not implemented!')
|
|
78
|
+
raise NotImplementedError('Method not implemented!')
|
|
79
|
+
|
|
80
|
+
def RemoveSandboxWorkerProfile(self, request, context):
|
|
81
|
+
"""Removes a sandbox worker profile so the backend stops
|
|
82
|
+
waking new sandbox workers for the specified worker profile. Existing
|
|
83
|
+
workers are not terminated by this RPC.
|
|
84
|
+
"""
|
|
85
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
86
|
+
context.set_details('Method not implemented!')
|
|
87
|
+
raise NotImplementedError('Method not implemented!')
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def add_SandboxActivitiesServicer_to_server(servicer, server):
|
|
91
|
+
rpc_method_handlers = {
|
|
92
|
+
'ConnectSandboxActivityWorker': grpc.stream_unary_rpc_method_handler(
|
|
93
|
+
servicer.ConnectSandboxActivityWorker,
|
|
94
|
+
request_deserializer=durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.SandboxActivityWorkerMessage.FromString,
|
|
95
|
+
response_serializer=durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.SandboxActivityWorkerSessionResult.SerializeToString,
|
|
96
|
+
),
|
|
97
|
+
'DeclareSandboxWorkerProfile': grpc.unary_unary_rpc_method_handler(
|
|
98
|
+
servicer.DeclareSandboxWorkerProfile,
|
|
99
|
+
request_deserializer=durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.SandboxWorkerProfile.FromString,
|
|
100
|
+
response_serializer=durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.DeclareSandboxWorkerProfileResult.SerializeToString,
|
|
101
|
+
),
|
|
102
|
+
'RemoveSandboxWorkerProfile': grpc.unary_unary_rpc_method_handler(
|
|
103
|
+
servicer.RemoveSandboxWorkerProfile,
|
|
104
|
+
request_deserializer=durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.RemoveSandboxWorkerProfileRequest.FromString,
|
|
105
|
+
response_serializer=durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.RemoveSandboxWorkerProfileResult.SerializeToString,
|
|
106
|
+
),
|
|
107
|
+
}
|
|
108
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
109
|
+
'microsoft.durabletask.sandboxes.SandboxActivities', rpc_method_handlers)
|
|
110
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
111
|
+
server.add_registered_method_handlers('microsoft.durabletask.sandboxes.SandboxActivities', rpc_method_handlers)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
# This class is part of an EXPERIMENTAL API.
|
|
115
|
+
class SandboxActivities(object):
|
|
116
|
+
"""Missing associated documentation comment in .proto file."""
|
|
117
|
+
|
|
118
|
+
@staticmethod
|
|
119
|
+
def ConnectSandboxActivityWorker(request_iterator,
|
|
120
|
+
target,
|
|
121
|
+
options=(),
|
|
122
|
+
channel_credentials=None,
|
|
123
|
+
call_credentials=None,
|
|
124
|
+
insecure=False,
|
|
125
|
+
compression=None,
|
|
126
|
+
wait_for_ready=None,
|
|
127
|
+
timeout=None,
|
|
128
|
+
metadata=None):
|
|
129
|
+
return grpc.experimental.stream_unary(
|
|
130
|
+
request_iterator,
|
|
131
|
+
target,
|
|
132
|
+
'/microsoft.durabletask.sandboxes.SandboxActivities/ConnectSandboxActivityWorker',
|
|
133
|
+
durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.SandboxActivityWorkerMessage.SerializeToString,
|
|
134
|
+
durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.SandboxActivityWorkerSessionResult.FromString,
|
|
135
|
+
options,
|
|
136
|
+
channel_credentials,
|
|
137
|
+
insecure,
|
|
138
|
+
call_credentials,
|
|
139
|
+
compression,
|
|
140
|
+
wait_for_ready,
|
|
141
|
+
timeout,
|
|
142
|
+
metadata,
|
|
143
|
+
_registered_method=True)
|
|
144
|
+
|
|
145
|
+
@staticmethod
|
|
146
|
+
def DeclareSandboxWorkerProfile(request,
|
|
147
|
+
target,
|
|
148
|
+
options=(),
|
|
149
|
+
channel_credentials=None,
|
|
150
|
+
call_credentials=None,
|
|
151
|
+
insecure=False,
|
|
152
|
+
compression=None,
|
|
153
|
+
wait_for_ready=None,
|
|
154
|
+
timeout=None,
|
|
155
|
+
metadata=None):
|
|
156
|
+
return grpc.experimental.unary_unary(
|
|
157
|
+
request,
|
|
158
|
+
target,
|
|
159
|
+
'/microsoft.durabletask.sandboxes.SandboxActivities/DeclareSandboxWorkerProfile',
|
|
160
|
+
durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.SandboxWorkerProfile.SerializeToString,
|
|
161
|
+
durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.DeclareSandboxWorkerProfileResult.FromString,
|
|
162
|
+
options,
|
|
163
|
+
channel_credentials,
|
|
164
|
+
insecure,
|
|
165
|
+
call_credentials,
|
|
166
|
+
compression,
|
|
167
|
+
wait_for_ready,
|
|
168
|
+
timeout,
|
|
169
|
+
metadata,
|
|
170
|
+
_registered_method=True)
|
|
171
|
+
|
|
172
|
+
@staticmethod
|
|
173
|
+
def RemoveSandboxWorkerProfile(request,
|
|
174
|
+
target,
|
|
175
|
+
options=(),
|
|
176
|
+
channel_credentials=None,
|
|
177
|
+
call_credentials=None,
|
|
178
|
+
insecure=False,
|
|
179
|
+
compression=None,
|
|
180
|
+
wait_for_ready=None,
|
|
181
|
+
timeout=None,
|
|
182
|
+
metadata=None):
|
|
183
|
+
return grpc.experimental.unary_unary(
|
|
184
|
+
request,
|
|
185
|
+
target,
|
|
186
|
+
'/microsoft.durabletask.sandboxes.SandboxActivities/RemoveSandboxWorkerProfile',
|
|
187
|
+
durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.RemoveSandboxWorkerProfileRequest.SerializeToString,
|
|
188
|
+
durabletask_dot_azuremanaged_dot_internal_dot_sandbox__service__pb2.RemoveSandboxWorkerProfileResult.FromString,
|
|
189
|
+
options,
|
|
190
|
+
channel_credentials,
|
|
191
|
+
insecure,
|
|
192
|
+
call_credentials,
|
|
193
|
+
compression,
|
|
194
|
+
wait_for_ready,
|
|
195
|
+
timeout,
|
|
196
|
+
metadata,
|
|
197
|
+
_registered_method=True)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
"""Sandbox preview APIs for Durable Task Scheduler.
|
|
5
|
+
|
|
6
|
+
This extension provides preview APIs for declaring sandbox activity
|
|
7
|
+
worker images and running a Python activity worker inside a Durable Task
|
|
8
|
+
Scheduler-launched sandbox.
|
|
9
|
+
|
|
10
|
+
Usage::
|
|
11
|
+
|
|
12
|
+
from durabletask.azuremanaged.preview.sandboxes import (
|
|
13
|
+
SandboxWorker,
|
|
14
|
+
SandboxActivitiesClient,
|
|
15
|
+
)
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from durabletask.azuremanaged.preview.sandboxes.client import SandboxActivitiesClient
|
|
19
|
+
from durabletask.azuremanaged.preview.sandboxes.helpers import SandboxActivity
|
|
20
|
+
from durabletask.azuremanaged.preview.sandboxes.worker_profiles import SandboxWorkerProfile
|
|
21
|
+
from durabletask.azuremanaged.preview.sandboxes.worker_profiles import SandboxWorkerProfileOptions
|
|
22
|
+
from durabletask.azuremanaged.preview.sandboxes.worker_profiles import sandbox_worker_profile
|
|
23
|
+
from durabletask.azuremanaged.preview.sandboxes.worker import SandboxWorker
|
|
24
|
+
|
|
25
|
+
__all__ = [
|
|
26
|
+
"SandboxWorker",
|
|
27
|
+
"SandboxActivity",
|
|
28
|
+
"SandboxWorkerProfile",
|
|
29
|
+
"SandboxWorkerProfileOptions",
|
|
30
|
+
"SandboxActivitiesClient",
|
|
31
|
+
"sandbox_worker_profile",
|
|
32
|
+
]
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from typing import Optional, Sequence
|
|
5
|
+
|
|
6
|
+
import grpc
|
|
7
|
+
from azure.core.credentials import TokenCredential
|
|
8
|
+
|
|
9
|
+
from durabletask.azuremanaged.preview.sandboxes.helpers import normalize_required
|
|
10
|
+
from durabletask.azuremanaged.preview.sandboxes.profile_builder import (
|
|
11
|
+
build_sandbox_worker_profiles,
|
|
12
|
+
)
|
|
13
|
+
from durabletask.azuremanaged.preview.sandboxes.transport import (
|
|
14
|
+
SandboxActivitiesGrpcTransport,
|
|
15
|
+
)
|
|
16
|
+
from durabletask.grpc_options import GrpcChannelOptions
|
|
17
|
+
import durabletask.internal.shared as shared
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class SandboxActivitiesClient:
|
|
21
|
+
"""Client for Durable Task Scheduler sandbox activity management operations."""
|
|
22
|
+
|
|
23
|
+
def __init__(
|
|
24
|
+
self, *,
|
|
25
|
+
host_address: str,
|
|
26
|
+
taskhub: str,
|
|
27
|
+
token_credential: Optional[TokenCredential],
|
|
28
|
+
channel: Optional[grpc.Channel] = None,
|
|
29
|
+
secure_channel: bool = True,
|
|
30
|
+
interceptors: Optional[Sequence[shared.ClientInterceptor]] = None,
|
|
31
|
+
channel_options: Optional[GrpcChannelOptions] = None):
|
|
32
|
+
self._transport = SandboxActivitiesGrpcTransport(
|
|
33
|
+
host_address=host_address,
|
|
34
|
+
taskhub=taskhub,
|
|
35
|
+
token_credential=token_credential,
|
|
36
|
+
channel=channel,
|
|
37
|
+
secure_channel=secure_channel,
|
|
38
|
+
interceptors=interceptors,
|
|
39
|
+
channel_options=channel_options)
|
|
40
|
+
|
|
41
|
+
def close(self) -> None:
|
|
42
|
+
self._transport.close()
|
|
43
|
+
|
|
44
|
+
def __enter__(self) -> "SandboxActivitiesClient":
|
|
45
|
+
return self
|
|
46
|
+
|
|
47
|
+
def __exit__(self, exc_type: object, exc_value: object, traceback: object) -> None:
|
|
48
|
+
self.close()
|
|
49
|
+
|
|
50
|
+
def enable_sandbox_activities(self) -> None:
|
|
51
|
+
"""Declare all configured sandbox worker profiles with Durable Task Scheduler."""
|
|
52
|
+
worker_profiles = build_sandbox_worker_profiles()
|
|
53
|
+
if not worker_profiles:
|
|
54
|
+
raise ValueError("No configured sandbox activities were found.")
|
|
55
|
+
|
|
56
|
+
for worker_profile in worker_profiles:
|
|
57
|
+
self._transport.declare_sandbox_worker_profile(worker_profile)
|
|
58
|
+
|
|
59
|
+
def remove_sandbox_worker_profile(self, worker_profile_id: str) -> None:
|
|
60
|
+
worker_profile_id = normalize_required(worker_profile_id, "Worker profile ID is required.")
|
|
61
|
+
self._transport.remove_sandbox_worker_profile(worker_profile_id)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import Iterable, Optional
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@dataclass(frozen=True)
|
|
9
|
+
class SandboxActivity:
|
|
10
|
+
name: str
|
|
11
|
+
version: Optional[str] = None
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def normalize_required(value: Optional[str], message: str) -> str:
|
|
15
|
+
if not value or not value.strip():
|
|
16
|
+
raise ValueError(message)
|
|
17
|
+
return value.strip()
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def normalize_optional(value: Optional[str]) -> Optional[str]:
|
|
21
|
+
if not value or not value.strip():
|
|
22
|
+
return None
|
|
23
|
+
return value.strip()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def resolve_activities(
|
|
27
|
+
activities: Iterable[SandboxActivity]) -> list[SandboxActivity]:
|
|
28
|
+
resolved: list[SandboxActivity] = []
|
|
29
|
+
seen: set[tuple[str, Optional[str]]] = set()
|
|
30
|
+
for activity in activities:
|
|
31
|
+
normalized_name = activity.name.strip()
|
|
32
|
+
if not normalized_name:
|
|
33
|
+
continue
|
|
34
|
+
|
|
35
|
+
normalized = SandboxActivity(
|
|
36
|
+
name=normalized_name,
|
|
37
|
+
version=normalize_optional(activity.version))
|
|
38
|
+
key = (normalized.name.casefold(), normalized.version)
|
|
39
|
+
if key not in seen:
|
|
40
|
+
resolved.append(normalized)
|
|
41
|
+
seen.add(key)
|
|
42
|
+
return resolved
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def activities_overlap(
|
|
46
|
+
left: SandboxActivity,
|
|
47
|
+
right: SandboxActivity) -> bool:
|
|
48
|
+
return (
|
|
49
|
+
left.name.casefold() == right.name.casefold()
|
|
50
|
+
and (left.version is None or right.version is None or left.version == right.version))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def format_activity(activity: SandboxActivity) -> str:
|
|
54
|
+
return activity.name if activity.version is None else f"{activity.name}@{activity.version}"
|