Skip to content

Commit 5ecc8f8

Browse files
YunchuWangCopilot
andcommitted
Address on-demand sandbox review feedback
Remove the checked-in on-demand sandbox proto source and extend proto generation to fetch it from durabletask-protobuf using the recorded source hash. Simplify the preview changelog entry and use Durable Task Scheduler in new public prose instead of DTS shorthand. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9d409d6 commit 5ecc8f8

10 files changed

Lines changed: 24 additions & 132 deletions

File tree

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ install:
99

1010
gen-proto:
1111
curl -o durabletask/internal/orchestrator_service.proto https://raw.githubusercontent.com/microsoft/durabletask-protobuf/refs/heads/main/protos/orchestrator_service.proto
12-
curl -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/microsoft/durabletask-protobuf/commits?path=protos/orchestrator_service.proto&sha=main&per_page=1" | jq -r '.[0].sha' >> durabletask/internal/PROTO_SOURCE_COMMIT_HASH
12+
curl -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/microsoft/durabletask-protobuf/commits?path=protos/orchestrator_service.proto&sha=main&per_page=1" | jq -r '.[0].sha' > durabletask/internal/PROTO_SOURCE_COMMIT_HASH
1313
python3 -m grpc_tools.protoc --proto_path=. --python_out=. --pyi_out=. --grpc_python_out=. ./durabletask/internal/orchestrator_service.proto
1414
rm durabletask/internal/*.proto
15+
ON_DEMAND_SANDBOX_PROTO_SOURCE_COMMIT_HASH=$$(cat durabletask-azuremanaged/durabletask/azuremanaged/internal/ON_DEMAND_SANDBOX_PROTO_SOURCE_COMMIT_HASH); \
16+
curl -o durabletask-azuremanaged/durabletask/azuremanaged/internal/on_demand_sandbox_activities_service.proto https://raw.githubusercontent.com/microsoft/durabletask-protobuf/$${ON_DEMAND_SANDBOX_PROTO_SOURCE_COMMIT_HASH}/protos/serverless_activities_service.proto
17+
python3 -m grpc_tools.protoc --proto_path=. --python_out=. --pyi_out=. --grpc_python_out=. ./durabletask-azuremanaged/durabletask/azuremanaged/internal/on_demand_sandbox_activities_service.proto
18+
rm durabletask-azuremanaged/durabletask/azuremanaged/internal/*.proto
1519

1620
.PHONY: init test gen-proto install

durabletask-azuremanaged/CHANGELOG.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88
## Unreleased
99

1010
- Added preview `durabletask.azuremanaged.preview.on_demand_sandbox` APIs for
11-
declaring DTS on-demand sandbox activities and running a sandbox activity worker.
12-
- Added profile-based DTS on-demand sandbox declarations with
13-
`@on_demand_sandbox_worker_profile`, `OnDemandSandboxWorkerProfile.configure()`,
14-
`OnDemandSandboxWorkerProfileOptions.add_activity(...)`, and
15-
`OnDemandSandboxActivitiesClient.enable_on_demand_sandbox_activities()`.
16-
- Changed on-demand sandbox worker profile declarations so the decorator names the
17-
profile and the profile class configures image, resources, concurrency, and
18-
customer environment variables explicitly.
19-
- Changed on-demand sandbox activity worker configuration to require explicit SDK
20-
parameters instead of reading DTS environment variables inside the SDK.
21-
- Removed the on-demand sandbox worker wakeup HTTP listener because ADC sandbox
22-
workers use outbound DTS registration and do not require an inbound probe
23-
endpoint.
24-
- Changed on-demand sandbox worker registration to rely on gRPC status instead of an
25-
accepted response flag.
11+
declaring Durable Task Scheduler on-demand sandbox activities, registering
12+
worker profiles, and running sandbox activity workers.
2613

2714
## v1.5.0
2815

durabletask-azuremanaged/durabletask/azuremanaged/internal/on_demand_sandbox_activities_service.proto

Lines changed: 0 additions & 97 deletions
This file was deleted.

durabletask-azuremanaged/durabletask/azuremanaged/preview/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
# Licensed under the MIT License.
33

44
"""Preview Azure Managed Durable Task Scheduler APIs."""
5-

durabletask-azuremanaged/durabletask/azuremanaged/preview/on_demand_sandbox/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"""On-demand sandbox preview APIs for Azure Managed Durable Task Scheduler.
55
66
This extension provides preview APIs for declaring on-demand sandbox activity
7-
worker images and running a Python activity worker inside a DTS-launched
8-
sandbox.
7+
worker images and running a Python activity worker inside a Durable Task
8+
Scheduler-launched sandbox.
99
1010
Usage::
1111
@@ -28,4 +28,3 @@
2828
"OnDemandSandboxActivitiesClient",
2929
"on_demand_sandbox_worker_profile",
3030
]
31-

durabletask-azuremanaged/durabletask/azuremanaged/preview/on_demand_sandbox/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def build_on_demand_sandbox_activity_declaration(
161161

162162
resolved_scheduler_managed_identity_client_id = _normalize_required(
163163
scheduler_managed_identity_client_id,
164-
"On-demand sandbox activity declaration requires the managed identity client ID workers use to connect to the DTS scheduler.")
164+
"On-demand sandbox activity declaration requires the managed identity client ID workers use to connect to Durable Task Scheduler.")
165165
resolved_image_pull_managed_identity_client_id = _normalize_required(
166166
image_pull_managed_identity_client_id,
167167
"On-demand sandbox activity declaration requires the managed identity client ID ADC uses to pull the worker image.")
@@ -265,7 +265,7 @@ def build_on_demand_sandbox_worker_heartbeat(active_activities_count: int) -> pb
265265

266266

267267
class OnDemandSandboxActivitiesClient:
268-
"""Client for DTS on-demand sandbox activity management operations."""
268+
"""Client for Durable Task Scheduler on-demand sandbox activity management operations."""
269269

270270
def __init__(
271271
self, *,
@@ -298,7 +298,7 @@ def close(self) -> None:
298298
self._channel.close()
299299

300300
def enable_on_demand_sandbox_activities(self) -> None:
301-
"""Declare all configured on-demand sandbox worker profiles with DTS."""
301+
"""Declare all configured on-demand sandbox worker profiles with Durable Task Scheduler."""
302302
declarations = build_profile_on_demand_sandbox_activity_declarations()
303303
if not declarations:
304304
raise ValueError("No configured on-demand sandbox activities were found.")

durabletask-azuremanaged/durabletask/azuremanaged/preview/on_demand_sandbox/worker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727

2828

2929
class OnDemandSandboxWorker(DurableTaskSchedulerWorker):
30-
"""DTS worker mode for activity containers started by on-demand sandbox activities.
30+
"""Durable Task Scheduler worker mode for activity containers started by on-demand sandbox activities.
3131
32-
This worker registers a live worker session with DTS and restricts dispatch
33-
to the activities registered on this worker.
32+
This worker registers a live worker session with Durable Task Scheduler and
33+
restricts dispatch to the activities registered on this worker.
3434
"""
3535

3636
def __init__(self):

examples/on_demand_sandbox/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# DTS on-demand sandbox activities sample
1+
# Durable Task Scheduler on-demand sandbox activities sample
22

3-
This sample mirrors the .NET on-demand sandbox sample with two customer-owned pieces:
3+
This sample mirrors the .NET on-demand sandbox sample with three customer-owned pieces:
44

55
1. A **declarer app** (`main_app.py`) that declares which activity should run
66
in an on-demand sandbox, starts the orchestration, and waits for the result.
77
2. A **remote worker image** (`remote_worker.py` plus `Containerfile`) that
8-
DTS starts in a sandbox to execute the declared activity.
8+
Durable Task Scheduler starts in a sandbox to execute the declared activity.
99
3. A tiny shared module (`activity_names.py`) that keeps the declarer and remote
1010
worker on the same activity name constants.
1111

@@ -36,12 +36,12 @@ memory, max concurrency, customer environment variables, and on-demand sandbox a
3636
names with `options.add_activity(...)`. The declarer and remote worker both use
3737
`activity_names.py` so they stay in sync.
3838

39-
The remote worker code cannot pass DTS runtime settings to the SDK. In a
39+
The remote worker code cannot pass Durable Task Scheduler runtime settings to the SDK. In a
4040
sandbox, `OnDemandSandboxWorker()` reads `DTS_ENDPOINT`,
4141
`DTS_TASK_HUB`, `DTS_WORKER_PROFILE_ID`, `DTS_ON_DEMAND_SANDBOX_MAX_ACTIVITIES`,
4242
`DTS_SUBSTRATE`, and `DTS_SANDBOX_ID` from environment variables injected by
43-
DTS. The worker reports its registered activity names when it connects, and
44-
DTS validates they match the declaration before advertising worker capacity.
43+
Durable Task Scheduler. The worker reports its registered activity names when it connects, and
44+
Durable Task Scheduler validates they match the declaration before advertising worker capacity.
4545

4646
## Build the remote worker image
4747

@@ -55,7 +55,7 @@ docker build `
5555
docker push <public container image reference>
5656
```
5757

58-
Private preview requires the image to be publicly pullable by ADC/DTS.
58+
Private preview requires the image to be publicly pullable by the sandbox platform.
5959

6060
## Run the declarer app
6161

examples/on_demand_sandbox/main_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Declarer app for the DTS on-demand sandbox activities sample."""
1+
"""Declarer app for the Durable Task Scheduler on-demand sandbox activities sample."""
22

33
import os
44

examples/on_demand_sandbox/remote_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Remote worker image entrypoint for the DTS on-demand sandbox activities sample."""
1+
"""Remote worker image entrypoint for the Durable Task Scheduler on-demand sandbox activities sample."""
22

33
import os
44
import time

0 commit comments

Comments
 (0)