Skip to content

Commit e86fc77

Browse files
Merge pull request #8 from elena-kolevska/protos
Update protos
2 parents 6ef52fc + e5057f3 commit e86fc77

File tree

9 files changed

+393
-201
lines changed

9 files changed

+393
-201
lines changed

.gitmodules

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

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
- Protos are compiled with gRPC 1.62.3 / protobuf 3.25.X instead of the latest release. This ensures compatibility with a wider range of grpcio versions for better compatibility with other packages / libraries ([#36](https://github.com/microsoft/durabletask-python/pull/36)) - by [@berndverst](https://github.com/berndverst)
1818
- Http and grpc protocols and their secure variants are stripped from the host name parameter if provided. Secure mode is enabled if the protocol provided is https or grpcs ([#38](https://github.com/microsoft/durabletask-python/pull/38) - by [@berndverst)(https://github.com/berndverst)
19+
- Improve ProtoGen by downloading proto file directly instead of using submodule ([#39](https://github.com/microsoft/durabletask-python/pull/39) - by [@berndverst](https://github.com/berndverst)
1920

2021
### Updates
2122

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ install:
1111
python3 -m pip install .
1212

1313
gen-proto:
14-
cp ./submodules/durabletask-protobuf/protos/orchestrator_service.proto durabletask/internal/orchestrator_service.proto
14+
curl -o durabletask/internal/orchestrator_service.proto https://raw.githubusercontent.com/microsoft/durabletask-protobuf/refs/heads/main/protos/orchestrator_service.proto
15+
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
1516
python3 -m grpc_tools.protoc --proto_path=. --python_out=. --pyi_out=. --grpc_python_out=. ./durabletask/internal/orchestrator_service.proto
1617
rm durabletask/internal/*.proto
1718

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,19 +161,13 @@ The following is more information about how to develop this project. Note that d
161161

162162
### Generating protobufs
163163

164-
Protobuf definitions are stored in the [./submodules/durabletask-proto](./submodules/durabletask-proto) directory, which is a submodule. To update the submodule, run the following command from the project root:
165-
166-
```sh
167-
git submodule update --init
168-
```
169-
170-
Once the submodule is available, the corresponding source code can be regenerated using the following command from the project root:
171-
172164
```sh
173165
pip3 install -r dev-requirements.txt
174166
make gen-proto
175167
```
176168

169+
This will download the `orchestrator_service.proto` from the `microsoft/durabletask-protobuf` repo and compile it using `grpcio-tools`. The version of the source proto file that was downloaded can be found in the file `durabletask/internal/PROTO_SOURCE_COMMIT_HASH`.
170+
177171
### Running unit tests
178172

179173
Unit tests can be run using the following command from the project root. Unit tests _don't_ require a sidecar process to be running.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
c672a0dc97c06587d7399ee12f1c5b0b9fc492a7c672a0dc97c06587d7399ee12f1c5b0b9fc492a7

durabletask/internal/orchestrator_service_pb2.py

Lines changed: 198 additions & 176 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

durabletask/internal/orchestrator_service_pb2.pyi

Lines changed: 155 additions & 12 deletions
Large diffs are not rendered by default.

durabletask/internal/orchestrator_service_pb2_grpc.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ def __init__(self, channel):
9595
request_serializer=durabletask_dot_internal_dot_orchestrator__service__pb2.EntityBatchResult.SerializeToString,
9696
response_deserializer=durabletask_dot_internal_dot_orchestrator__service__pb2.CompleteTaskResponse.FromString,
9797
)
98+
self.StreamInstanceHistory = channel.unary_stream(
99+
'/TaskHubSidecarService/StreamInstanceHistory',
100+
request_serializer=durabletask_dot_internal_dot_orchestrator__service__pb2.StreamInstanceHistoryRequest.SerializeToString,
101+
response_deserializer=durabletask_dot_internal_dot_orchestrator__service__pb2.HistoryChunk.FromString,
102+
)
98103
self.CreateTaskHub = channel.unary_unary(
99104
'/TaskHubSidecarService/CreateTaskHub',
100105
request_serializer=durabletask_dot_internal_dot_orchestrator__service__pb2.CreateTaskHubRequest.SerializeToString,
@@ -238,6 +243,13 @@ def CompleteEntityTask(self, request, context):
238243
context.set_details('Method not implemented!')
239244
raise NotImplementedError('Method not implemented!')
240245

246+
def StreamInstanceHistory(self, request, context):
247+
"""Gets the history of an orchestration instance as a stream of events.
248+
"""
249+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
250+
context.set_details('Method not implemented!')
251+
raise NotImplementedError('Method not implemented!')
252+
241253
def CreateTaskHub(self, request, context):
242254
"""Deletes and Creates the necessary resources for the orchestration service and the instance store
243255
"""
@@ -363,6 +375,11 @@ def add_TaskHubSidecarServiceServicer_to_server(servicer, server):
363375
request_deserializer=durabletask_dot_internal_dot_orchestrator__service__pb2.EntityBatchResult.FromString,
364376
response_serializer=durabletask_dot_internal_dot_orchestrator__service__pb2.CompleteTaskResponse.SerializeToString,
365377
),
378+
'StreamInstanceHistory': grpc.unary_stream_rpc_method_handler(
379+
servicer.StreamInstanceHistory,
380+
request_deserializer=durabletask_dot_internal_dot_orchestrator__service__pb2.StreamInstanceHistoryRequest.FromString,
381+
response_serializer=durabletask_dot_internal_dot_orchestrator__service__pb2.HistoryChunk.SerializeToString,
382+
),
366383
'CreateTaskHub': grpc.unary_unary_rpc_method_handler(
367384
servicer.CreateTaskHub,
368385
request_deserializer=durabletask_dot_internal_dot_orchestrator__service__pb2.CreateTaskHubRequest.FromString,
@@ -675,6 +692,23 @@ def CompleteEntityTask(request,
675692
options, channel_credentials,
676693
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
677694

695+
@staticmethod
696+
def StreamInstanceHistory(request,
697+
target,
698+
options=(),
699+
channel_credentials=None,
700+
call_credentials=None,
701+
insecure=False,
702+
compression=None,
703+
wait_for_ready=None,
704+
timeout=None,
705+
metadata=None):
706+
return grpc.experimental.unary_stream(request, target, '/TaskHubSidecarService/StreamInstanceHistory',
707+
durabletask_dot_internal_dot_orchestrator__service__pb2.StreamInstanceHistoryRequest.SerializeToString,
708+
durabletask_dot_internal_dot_orchestrator__service__pb2.HistoryChunk.FromString,
709+
options, channel_credentials,
710+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
711+
678712
@staticmethod
679713
def CreateTaskHub(request,
680714
target,

submodules/durabletask-protobuf

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)