durabletask.azuremanaged 1.4.0.dev34__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.4.0.dev34 → durabletask_azuremanaged-1.6.0}/PKG-INFO +3 -3
- {durabletask_azuremanaged-1.4.0.dev34 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/client.py +32 -24
- {durabletask_azuremanaged-1.4.0.dev34 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/internal/access_token_manager.py +6 -7
- {durabletask_azuremanaged-1.4.0.dev34 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/internal/durabletask_grpc_interceptor.py +5 -8
- 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.4.0.dev34 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/worker.py +22 -16
- {durabletask_azuremanaged-1.4.0.dev34 → 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.4.0.dev34 → durabletask_azuremanaged-1.6.0}/pyproject.toml +3 -3
- durabletask_azuremanaged-1.4.0.dev34/durabletask.azuremanaged.egg-info/SOURCES.txt +0 -13
- durabletask_azuremanaged-1.4.0.dev34/durabletask.azuremanaged.egg-info/requires.txt +0 -5
- {durabletask_azuremanaged-1.4.0.dev34 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/__init__.py +0 -0
- {durabletask_azuremanaged-1.4.0.dev34 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/internal/py.typed +0 -0
- {durabletask_azuremanaged-1.4.0.dev34 → durabletask_azuremanaged-1.6.0}/durabletask/azuremanaged/py.typed +0 -0
- {durabletask_azuremanaged-1.4.0.dev34 → durabletask_azuremanaged-1.6.0}/durabletask.azuremanaged.egg-info/dependency_links.txt +0 -0
- {durabletask_azuremanaged-1.4.0.dev34 → durabletask_azuremanaged-1.6.0}/durabletask.azuremanaged.egg-info/top_level.txt +0 -0
- {durabletask_azuremanaged-1.4.0.dev34 → 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"
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
import logging
|
|
5
|
-
|
|
6
|
-
from typing import Optional, Sequence
|
|
5
|
+
from collections.abc import Sequence
|
|
7
6
|
|
|
8
7
|
import grpc
|
|
9
8
|
import grpc.aio
|
|
@@ -15,7 +14,10 @@ from durabletask.azuremanaged.internal.durabletask_grpc_interceptor import (
|
|
|
15
14
|
DTSDefaultClientInterceptorImpl,
|
|
16
15
|
)
|
|
17
16
|
from durabletask.client import AsyncTaskHubGrpcClient, TaskHubGrpcClient
|
|
18
|
-
from durabletask.grpc_options import
|
|
17
|
+
from durabletask.grpc_options import (
|
|
18
|
+
GrpcChannelOptions,
|
|
19
|
+
GrpcClientResiliencyOptions,
|
|
20
|
+
)
|
|
19
21
|
import durabletask.internal.shared as shared
|
|
20
22
|
from durabletask.payload.store import PayloadStore
|
|
21
23
|
|
|
@@ -25,15 +27,16 @@ class DurableTaskSchedulerClient(TaskHubGrpcClient):
|
|
|
25
27
|
def __init__(self, *,
|
|
26
28
|
host_address: str,
|
|
27
29
|
taskhub: str,
|
|
28
|
-
token_credential:
|
|
29
|
-
channel:
|
|
30
|
+
token_credential: TokenCredential | None,
|
|
31
|
+
channel: grpc.Channel | None = None,
|
|
30
32
|
secure_channel: bool = True,
|
|
31
|
-
interceptors:
|
|
32
|
-
channel_options:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
interceptors: Sequence[shared.ClientInterceptor] | None = None,
|
|
34
|
+
channel_options: GrpcChannelOptions | None = None,
|
|
35
|
+
resiliency_options: GrpcClientResiliencyOptions | None = None,
|
|
36
|
+
default_version: str | None = None,
|
|
37
|
+
payload_store: PayloadStore | None = None,
|
|
38
|
+
log_handler: logging.Handler | None = None,
|
|
39
|
+
log_formatter: logging.Formatter | None = None):
|
|
37
40
|
|
|
38
41
|
if not taskhub:
|
|
39
42
|
raise ValueError("Taskhub value cannot be empty. Please provide a value for your taskhub")
|
|
@@ -54,6 +57,7 @@ class DurableTaskSchedulerClient(TaskHubGrpcClient):
|
|
|
54
57
|
log_formatter=log_formatter,
|
|
55
58
|
interceptors=resolved_interceptors,
|
|
56
59
|
channel_options=channel_options,
|
|
60
|
+
resiliency_options=resiliency_options,
|
|
57
61
|
default_version=default_version,
|
|
58
62
|
payload_store=payload_store)
|
|
59
63
|
|
|
@@ -70,15 +74,17 @@ class AsyncDurableTaskSchedulerClient(AsyncTaskHubGrpcClient):
|
|
|
70
74
|
Args:
|
|
71
75
|
host_address (str): The gRPC endpoint address of the DTS service.
|
|
72
76
|
taskhub (str): The name of the task hub. Cannot be empty.
|
|
73
|
-
token_credential (
|
|
77
|
+
token_credential (TokenCredential | None): Azure credential for authentication.
|
|
74
78
|
If None, anonymous authentication will be used.
|
|
75
79
|
secure_channel (bool, optional): Whether to use a secure gRPC channel (TLS).
|
|
76
80
|
Defaults to True.
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
resiliency_options (GrpcClientResiliencyOptions | None, optional): Client-side
|
|
82
|
+
gRPC resiliency settings forwarded to the base async client.
|
|
83
|
+
default_version (str | None, optional): Default version string for orchestrations.
|
|
84
|
+
payload_store (PayloadStore | None, optional): A payload store for
|
|
79
85
|
externalizing large payloads. If None, payloads are sent inline.
|
|
80
|
-
log_handler (
|
|
81
|
-
log_formatter (
|
|
86
|
+
log_handler (logging.Handler | None, optional): Custom logging handler for client logs.
|
|
87
|
+
log_formatter (logging.Formatter | None, optional): Custom log formatter for client logs.
|
|
82
88
|
|
|
83
89
|
Raises:
|
|
84
90
|
ValueError: If taskhub is empty or None.
|
|
@@ -99,15 +105,16 @@ class AsyncDurableTaskSchedulerClient(AsyncTaskHubGrpcClient):
|
|
|
99
105
|
def __init__(self, *,
|
|
100
106
|
host_address: str,
|
|
101
107
|
taskhub: str,
|
|
102
|
-
token_credential:
|
|
103
|
-
channel:
|
|
108
|
+
token_credential: AsyncTokenCredential | None,
|
|
109
|
+
channel: grpc.aio.Channel | None = None,
|
|
104
110
|
secure_channel: bool = True,
|
|
105
|
-
interceptors:
|
|
106
|
-
channel_options:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
interceptors: Sequence[shared.AsyncClientInterceptor] | None = None,
|
|
112
|
+
channel_options: GrpcChannelOptions | None = None,
|
|
113
|
+
resiliency_options: GrpcClientResiliencyOptions | None = None,
|
|
114
|
+
default_version: str | None = None,
|
|
115
|
+
payload_store: PayloadStore | None = None,
|
|
116
|
+
log_handler: logging.Handler | None = None,
|
|
117
|
+
log_formatter: logging.Formatter | None = None):
|
|
111
118
|
|
|
112
119
|
if not taskhub:
|
|
113
120
|
raise ValueError("Taskhub value cannot be empty. Please provide a value for your taskhub")
|
|
@@ -128,5 +135,6 @@ class AsyncDurableTaskSchedulerClient(AsyncTaskHubGrpcClient):
|
|
|
128
135
|
log_formatter=log_formatter,
|
|
129
136
|
interceptors=resolved_interceptors,
|
|
130
137
|
channel_options=channel_options,
|
|
138
|
+
resiliency_options=resiliency_options,
|
|
131
139
|
default_version=default_version,
|
|
132
140
|
payload_store=payload_store)
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
# Licensed under the MIT License.
|
|
3
3
|
from datetime import datetime, timedelta, timezone
|
|
4
4
|
from threading import Lock
|
|
5
|
-
from typing import Optional
|
|
6
5
|
|
|
7
6
|
from azure.core.credentials import AccessToken, TokenCredential
|
|
8
7
|
from azure.core.credentials_async import AsyncTokenCredential
|
|
@@ -13,9 +12,9 @@ import durabletask.internal.shared as shared
|
|
|
13
12
|
# By default, when there's 10minutes left before the token expires, refresh the token
|
|
14
13
|
class AccessTokenManager:
|
|
15
14
|
|
|
16
|
-
_token:
|
|
15
|
+
_token: AccessToken | None
|
|
17
16
|
|
|
18
|
-
def __init__(self, token_credential:
|
|
17
|
+
def __init__(self, token_credential: TokenCredential | None, refresh_interval_seconds: int = 600):
|
|
19
18
|
self._scope = "https://durabletask.io/.default"
|
|
20
19
|
self._refresh_interval_seconds = refresh_interval_seconds
|
|
21
20
|
self._logger = shared.get_logger("token_manager")
|
|
@@ -30,7 +29,7 @@ class AccessTokenManager:
|
|
|
30
29
|
self._token = None
|
|
31
30
|
self.expiry_time = None
|
|
32
31
|
|
|
33
|
-
def get_access_token(self) ->
|
|
32
|
+
def get_access_token(self) -> AccessToken | None:
|
|
34
33
|
if self._token is None or self.is_token_expired():
|
|
35
34
|
with self._refresh_lock:
|
|
36
35
|
if self._token is None or self.is_token_expired():
|
|
@@ -59,9 +58,9 @@ class AsyncAccessTokenManager:
|
|
|
59
58
|
|
|
60
59
|
This avoids blocking the event loop when acquiring or refreshing tokens."""
|
|
61
60
|
|
|
62
|
-
_token:
|
|
61
|
+
_token: AccessToken | None
|
|
63
62
|
|
|
64
|
-
def __init__(self, token_credential:
|
|
63
|
+
def __init__(self, token_credential: AsyncTokenCredential | None,
|
|
65
64
|
refresh_interval_seconds: int = 600):
|
|
66
65
|
self._scope = "https://durabletask.io/.default"
|
|
67
66
|
self._refresh_interval_seconds = refresh_interval_seconds
|
|
@@ -71,7 +70,7 @@ class AsyncAccessTokenManager:
|
|
|
71
70
|
self._token = None
|
|
72
71
|
self.expiry_time = None
|
|
73
72
|
|
|
74
|
-
async def get_access_token(self) ->
|
|
73
|
+
async def get_access_token(self) -> AccessToken | None:
|
|
75
74
|
if self._token is None or self.is_token_expired():
|
|
76
75
|
await self.refresh_token()
|
|
77
76
|
return self._token
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
# Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
from importlib.metadata import version
|
|
5
|
-
from typing import Optional
|
|
6
5
|
|
|
7
6
|
import grpc
|
|
8
7
|
from azure.core.credentials import TokenCredential
|
|
@@ -15,8 +14,6 @@ from durabletask.azuremanaged.internal.access_token_manager import (
|
|
|
15
14
|
from durabletask.internal.grpc_interceptor import (
|
|
16
15
|
DefaultAsyncClientInterceptorImpl,
|
|
17
16
|
DefaultClientInterceptorImpl,
|
|
18
|
-
_AsyncClientCallDetails,
|
|
19
|
-
_ClientCallDetails,
|
|
20
17
|
)
|
|
21
18
|
|
|
22
19
|
|
|
@@ -27,9 +24,9 @@ class DTSDefaultClientInterceptorImpl (DefaultClientInterceptorImpl):
|
|
|
27
24
|
|
|
28
25
|
def __init__(
|
|
29
26
|
self,
|
|
30
|
-
token_credential:
|
|
27
|
+
token_credential: TokenCredential | None,
|
|
31
28
|
taskhub_name: str,
|
|
32
|
-
worker_id:
|
|
29
|
+
worker_id: str | None = None):
|
|
33
30
|
try:
|
|
34
31
|
# Get the version of the azuremanaged package
|
|
35
32
|
sdk_version = version('durabletask-azuremanaged')
|
|
@@ -63,7 +60,7 @@ class DTSDefaultClientInterceptorImpl (DefaultClientInterceptorImpl):
|
|
|
63
60
|
self._metadata.append(("authorization", f"Bearer {token}"))
|
|
64
61
|
|
|
65
62
|
def _intercept_call(
|
|
66
|
-
self, client_call_details:
|
|
63
|
+
self, client_call_details: grpc.ClientCallDetails) -> grpc.ClientCallDetails:
|
|
67
64
|
"""Internal intercept_call implementation which adds metadata to grpc metadata in the RPC
|
|
68
65
|
call details."""
|
|
69
66
|
# Refresh the auth token if a credential was provided. The call to
|
|
@@ -83,7 +80,7 @@ class DTSAsyncDefaultClientInterceptorImpl(DefaultAsyncClientInterceptorImpl):
|
|
|
83
80
|
This class implements async gRPC interceptors to add DTS-specific headers
|
|
84
81
|
(task hub name, user agent, and authentication token) to all async calls."""
|
|
85
82
|
|
|
86
|
-
def __init__(self, token_credential:
|
|
83
|
+
def __init__(self, token_credential: AsyncTokenCredential | None, taskhub_name: str):
|
|
87
84
|
try:
|
|
88
85
|
# Get the version of the azuremanaged package
|
|
89
86
|
sdk_version = version('durabletask-azuremanaged')
|
|
@@ -115,7 +112,7 @@ class DTSAsyncDefaultClientInterceptorImpl(DefaultAsyncClientInterceptorImpl):
|
|
|
115
112
|
self._metadata.append(("authorization", f"Bearer {token}"))
|
|
116
113
|
|
|
117
114
|
async def _intercept_call(
|
|
118
|
-
self, client_call_details:
|
|
115
|
+
self, client_call_details: grpc.aio.ClientCallDetails) -> grpc.aio.ClientCallDetails:
|
|
119
116
|
"""Internal intercept_call implementation which adds metadata to grpc metadata in the RPC
|
|
120
117
|
call details."""
|
|
121
118
|
# Refresh the auth token if a credential was provided. The call to
|
|
@@ -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
|
+
]
|