From 229314b1ee7ea00887f68163de708090de3a43c9 Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Thu, 1 Feb 2024 15:10:05 -0500 Subject: [PATCH 1/4] Update proto repos to just use dispatch-sdk --- Makefile | 12 +++++------- buf.work.yaml | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 1daae54d..3447e720 100644 --- a/Makefile +++ b/Makefile @@ -29,17 +29,15 @@ test: typecheck unittest .proto: mkdir -p $@ -.proto/ring: .proto - buf export buf.build/stealthrocket/ring --output=.proto/ring - -.proto/dispatch: .proto - buf export buf.build/stealthrocket/dispatch --output=.proto/dispatch +.proto/dispatch-sdk: .proto + buf export buf.build/stealthrocket/dispatch-sdk --output=.proto/dispatch-sdk update-proto: $(MAKE) clean + find . -type f -name '*_pb2*.py*' -exec rm {} \; $(MAKE) generate -generate: .proto/ring .proto/dispatch +generate: .proto/dispatch-sdk buf generate --template buf.gen.yaml cd src && find . -type d | while IFS= read -r dir; do touch $$dir/__init__.py; done rm src/__init__.py @@ -49,5 +47,5 @@ clean: rm -rf .proto rm -rf .coverage rm -rf .coverage-html - find . -type f -name '*.pyc' -delete + find . -type f -name '*.pyc' -exec rm {} \; find . -type d -name '__pycache__' -exec rm -r {} \; diff --git a/buf.work.yaml b/buf.work.yaml index 85018e50..54f2c8b4 100644 --- a/buf.work.yaml +++ b/buf.work.yaml @@ -1,4 +1,3 @@ version: v1 directories: - - .proto/ring - - .proto/dispatch + - .proto/dispatch-sdk From 08516efc5d4f5f505ecdc261fdef8df0249403c4 Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Thu, 1 Feb 2024 15:10:26 -0500 Subject: [PATCH 2/4] Regen protos --- src/dispatch/http/v1/http_pb2.py | 41 --- src/dispatch/http/v1/http_pb2.pyi | 61 ---- src/dispatch/http/v1/http_pb2_grpc.py | 3 - src/dispatch/sdk/__init__.py | 0 src/dispatch/sdk/v1/__init__.py | 0 src/dispatch/sdk/v1/endpoint_pb2.py | 42 +++ src/dispatch/sdk/v1/endpoint_pb2.pyi | 46 +++ src/dispatch/sdk/v1/endpoint_pb2_grpc.py | 94 ++++++ src/dispatch/sdk/v1/executor_pb2.py | 55 ++++ .../sdk/v1/executor_pb2.pyi} | 13 +- .../sdk/v1/executor_pb2_grpc.py} | 22 +- src/dispatch/sdk/v1/key_pb2.py | 44 +++ src/dispatch/sdk/v1/key_pb2.pyi | 48 +++ src/dispatch/sdk/v1/key_pb2_grpc.py | 169 ++++++++++ src/dispatch/sdk/v1/status_pb2.py | 32 ++ .../status => dispatch/sdk}/v1/status_pb2.pyi | 0 .../sdk}/v1/status_pb2_grpc.py | 0 src/dispatch/security/v1/security_pb2.py | 34 -- src/dispatch/security/v1/security_pb2.pyi | 34 -- src/dispatch/security/v1/security_pb2_grpc.py | 3 - src/dispatch/v1/metadata_pb2.py | 32 -- src/dispatch/v1/metadata_pb2.pyi | 15 - src/dispatch/v1/metadata_pb2_grpc.py | 3 - src/ring/admin/v1/cluster_pb2.py | 103 ------ src/ring/admin/v1/cluster_pb2.pyi | 294 ----------------- src/ring/admin/v1/cluster_pb2_grpc.py | 304 ------------------ src/ring/admin/v1/member_pb2.py | 49 --- src/ring/admin/v1/member_pb2.pyi | 65 ---- src/ring/admin/v1/member_pb2_grpc.py | 79 ----- src/ring/coroutine/v1/coroutine_pb2.py | 55 ---- src/ring/http/v1/http_pb2.py | 34 -- src/ring/http/v1/http_pb2.pyi | 55 ---- src/ring/http/v1/http_pb2_grpc.py | 3 - src/ring/record/v1/record_pb2.py | 84 ----- src/ring/record/v1/record_pb2.pyi | 242 -------------- src/ring/record/v1/record_pb2_grpc.py | 190 ----------- src/ring/snapshot/v1/snapshot_pb2.py | 40 --- src/ring/snapshot/v1/snapshot_pb2.pyi | 79 ----- src/ring/snapshot/v1/snapshot_pb2_grpc.py | 3 - src/ring/status/v1/status_pb2.py | 32 -- src/ring/task/v1/config_pb2.py | 35 -- src/ring/task/v1/config_pb2.pyi | 41 --- src/ring/task/v1/config_pb2_grpc.py | 3 - src/ring/task/v1/service_pb2.py | 45 --- src/ring/task/v1/service_pb2.pyi | 61 ---- src/ring/task/v1/service_pb2_grpc.py | 85 ----- src/ring/task/v1/task_pb2.py | 45 --- src/ring/task/v1/task_pb2.pyi | 170 ---------- src/ring/task/v1/task_pb2_grpc.py | 3 - 49 files changed, 542 insertions(+), 2448 deletions(-) delete mode 100644 src/dispatch/http/v1/http_pb2.py delete mode 100644 src/dispatch/http/v1/http_pb2.pyi delete mode 100644 src/dispatch/http/v1/http_pb2_grpc.py create mode 100644 src/dispatch/sdk/__init__.py create mode 100644 src/dispatch/sdk/v1/__init__.py create mode 100644 src/dispatch/sdk/v1/endpoint_pb2.py create mode 100644 src/dispatch/sdk/v1/endpoint_pb2.pyi create mode 100644 src/dispatch/sdk/v1/endpoint_pb2_grpc.py create mode 100644 src/dispatch/sdk/v1/executor_pb2.py rename src/{ring/coroutine/v1/coroutine_pb2.pyi => dispatch/sdk/v1/executor_pb2.pyi} (94%) rename src/{ring/coroutine/v1/coroutine_pb2_grpc.py => dispatch/sdk/v1/executor_pb2_grpc.py} (67%) create mode 100644 src/dispatch/sdk/v1/key_pb2.py create mode 100644 src/dispatch/sdk/v1/key_pb2.pyi create mode 100644 src/dispatch/sdk/v1/key_pb2_grpc.py create mode 100644 src/dispatch/sdk/v1/status_pb2.py rename src/{ring/status => dispatch/sdk}/v1/status_pb2.pyi (100%) rename src/{ring/status => dispatch/sdk}/v1/status_pb2_grpc.py (100%) delete mode 100644 src/dispatch/security/v1/security_pb2.py delete mode 100644 src/dispatch/security/v1/security_pb2.pyi delete mode 100644 src/dispatch/security/v1/security_pb2_grpc.py delete mode 100644 src/dispatch/v1/metadata_pb2.py delete mode 100644 src/dispatch/v1/metadata_pb2.pyi delete mode 100644 src/dispatch/v1/metadata_pb2_grpc.py delete mode 100644 src/ring/admin/v1/cluster_pb2.py delete mode 100644 src/ring/admin/v1/cluster_pb2.pyi delete mode 100644 src/ring/admin/v1/cluster_pb2_grpc.py delete mode 100644 src/ring/admin/v1/member_pb2.py delete mode 100644 src/ring/admin/v1/member_pb2.pyi delete mode 100644 src/ring/admin/v1/member_pb2_grpc.py delete mode 100644 src/ring/coroutine/v1/coroutine_pb2.py delete mode 100644 src/ring/http/v1/http_pb2.py delete mode 100644 src/ring/http/v1/http_pb2.pyi delete mode 100644 src/ring/http/v1/http_pb2_grpc.py delete mode 100644 src/ring/record/v1/record_pb2.py delete mode 100644 src/ring/record/v1/record_pb2.pyi delete mode 100644 src/ring/record/v1/record_pb2_grpc.py delete mode 100644 src/ring/snapshot/v1/snapshot_pb2.py delete mode 100644 src/ring/snapshot/v1/snapshot_pb2.pyi delete mode 100644 src/ring/snapshot/v1/snapshot_pb2_grpc.py delete mode 100644 src/ring/status/v1/status_pb2.py delete mode 100644 src/ring/task/v1/config_pb2.py delete mode 100644 src/ring/task/v1/config_pb2.pyi delete mode 100644 src/ring/task/v1/config_pb2_grpc.py delete mode 100644 src/ring/task/v1/service_pb2.py delete mode 100644 src/ring/task/v1/service_pb2.pyi delete mode 100644 src/ring/task/v1/service_pb2_grpc.py delete mode 100644 src/ring/task/v1/task_pb2.py delete mode 100644 src/ring/task/v1/task_pb2.pyi delete mode 100644 src/ring/task/v1/task_pb2_grpc.py diff --git a/src/dispatch/http/v1/http_pb2.py b/src/dispatch/http/v1/http_pb2.py deleted file mode 100644 index d553bc80..00000000 --- a/src/dispatch/http/v1/http_pb2.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: dispatch/http/v1/http.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from dispatch.security.v1 import ( - security_pb2 as dispatch_dot_security_dot_v1_dot_security__pb2, -) - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x1b\x64ispatch/http/v1/http.proto\x12\x10\x64ispatch.http.v1\x1a#dispatch/security/v1/security.proto"\xdb\x01\n\x07Request\x12\x16\n\x06method\x18\x01 \x01(\tR\x06method\x12\x10\n\x03url\x18\x02 \x01(\tR\x03url\x12\x30\n\x06header\x18\x04 \x03(\x0b\x32\x18.dispatch.http.v1.HeaderR\x06header\x12\x12\n\x04\x62ody\x18\x03 \x01(\x0cR\x04\x62ody\x12`\n\x16network_access_control\x18\x05 \x01(\x0b\x32*.dispatch.security.v1.NetworkAccessControlR\x14networkAccessControl"q\n\x08Response\x12\x1f\n\x0bstatus_code\x18\x01 \x01(\x05R\nstatusCode\x12\x30\n\x06header\x18\x02 \x03(\x0b\x32\x18.dispatch.http.v1.HeaderR\x06header\x12\x12\n\x04\x62ody\x18\x03 \x01(\x0cR\x04\x62ody"2\n\x06Header\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05valueB\x83\x01\n\x14\x63om.dispatch.http.v1B\tHttpProtoP\x01\xa2\x02\x03\x44HX\xaa\x02\x10\x44ispatch.Http.V1\xca\x02\x10\x44ispatch\\Http\\V1\xe2\x02\x1c\x44ispatch\\Http\\V1\\GPBMetadata\xea\x02\x12\x44ispatch::Http::V1b\x06proto3' -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages( - DESCRIPTOR, "dispatch.http.v1.http_pb2", _globals -) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\024com.dispatch.http.v1B\tHttpProtoP\001\242\002\003DHX\252\002\020Dispatch.Http.V1\312\002\020Dispatch\\Http\\V1\342\002\034Dispatch\\Http\\V1\\GPBMetadata\352\002\022Dispatch::Http::V1" - ) - _globals["_REQUEST"]._serialized_start = 87 - _globals["_REQUEST"]._serialized_end = 306 - _globals["_RESPONSE"]._serialized_start = 308 - _globals["_RESPONSE"]._serialized_end = 421 - _globals["_HEADER"]._serialized_start = 423 - _globals["_HEADER"]._serialized_end = 473 -# @@protoc_insertion_point(module_scope) diff --git a/src/dispatch/http/v1/http_pb2.pyi b/src/dispatch/http/v1/http_pb2.pyi deleted file mode 100644 index 0879b9a0..00000000 --- a/src/dispatch/http/v1/http_pb2.pyi +++ /dev/null @@ -1,61 +0,0 @@ -from dispatch.security.v1 import security_pb2 as _security_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) - -DESCRIPTOR: _descriptor.FileDescriptor - -class Request(_message.Message): - __slots__ = ("method", "url", "header", "body", "network_access_control") - METHOD_FIELD_NUMBER: _ClassVar[int] - URL_FIELD_NUMBER: _ClassVar[int] - HEADER_FIELD_NUMBER: _ClassVar[int] - BODY_FIELD_NUMBER: _ClassVar[int] - NETWORK_ACCESS_CONTROL_FIELD_NUMBER: _ClassVar[int] - method: str - url: str - header: _containers.RepeatedCompositeFieldContainer[Header] - body: bytes - network_access_control: _security_pb2.NetworkAccessControl - def __init__( - self, - method: _Optional[str] = ..., - url: _Optional[str] = ..., - header: _Optional[_Iterable[_Union[Header, _Mapping]]] = ..., - body: _Optional[bytes] = ..., - network_access_control: _Optional[ - _Union[_security_pb2.NetworkAccessControl, _Mapping] - ] = ..., - ) -> None: ... - -class Response(_message.Message): - __slots__ = ("status_code", "header", "body") - STATUS_CODE_FIELD_NUMBER: _ClassVar[int] - HEADER_FIELD_NUMBER: _ClassVar[int] - BODY_FIELD_NUMBER: _ClassVar[int] - status_code: int - header: _containers.RepeatedCompositeFieldContainer[Header] - body: bytes - def __init__( - self, - status_code: _Optional[int] = ..., - header: _Optional[_Iterable[_Union[Header, _Mapping]]] = ..., - body: _Optional[bytes] = ..., - ) -> None: ... - -class Header(_message.Message): - __slots__ = ("name", "value") - NAME_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - name: str - value: str - def __init__( - self, name: _Optional[str] = ..., value: _Optional[str] = ... - ) -> None: ... diff --git a/src/dispatch/http/v1/http_pb2_grpc.py b/src/dispatch/http/v1/http_pb2_grpc.py deleted file mode 100644 index 8a939394..00000000 --- a/src/dispatch/http/v1/http_pb2_grpc.py +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc diff --git a/src/dispatch/sdk/__init__.py b/src/dispatch/sdk/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/dispatch/sdk/v1/__init__.py b/src/dispatch/sdk/v1/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/dispatch/sdk/v1/endpoint_pb2.py b/src/dispatch/sdk/v1/endpoint_pb2.py new file mode 100644 index 00000000..06032d20 --- /dev/null +++ b/src/dispatch/sdk/v1/endpoint_pb2.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: dispatch/sdk/v1/endpoint.proto +# Protobuf Python Version: 4.25.2 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\n\x1e\x64ispatch/sdk/v1/endpoint.proto\x12\x0f\x64ispatch.sdk.v1\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto"U\n\x17\x43reateExecutionsRequest\x12:\n\nexecutions\x18\x01 \x03(\x0b\x32\x1a.dispatch.sdk.v1.ExecutionR\nexecutions",\n\x18\x43reateExecutionsResponse\x12\x10\n\x03ids\x18\x01 \x03(\tR\x03ids"\xc4\x01\n\tExecution\x12#\n\rcoroutine_uri\x18\x01 \x01(\tR\x0c\x63oroutineUri\x12+\n\x11\x63oroutine_version\x18\x02 \x01(\tR\x10\x63oroutineVersion\x12*\n\x05input\x18\x03 \x01(\x0b\x32\x14.google.protobuf.AnyR\x05input\x12\x39\n\nexpiration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationR\nexpiration2|\n\x0f\x45ndpointService\x12i\n\x10\x43reateExecutions\x12(.dispatch.sdk.v1.CreateExecutionsRequest\x1a).dispatch.sdk.v1.CreateExecutionsResponse"\x00\x42\x82\x01\n\x13\x63om.dispatch.sdk.v1B\rEndpointProtoP\x01\xa2\x02\x03\x44SX\xaa\x02\x0f\x44ispatch.Sdk.V1\xca\x02\x0f\x44ispatch\\Sdk\\V1\xe2\x02\x1b\x44ispatch\\Sdk\\V1\\GPBMetadata\xea\x02\x11\x44ispatch::Sdk::V1b\x06proto3' +) + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages( + DESCRIPTOR, "dispatch.sdk.v1.endpoint_pb2", _globals +) +if _descriptor._USE_C_DESCRIPTORS == False: + _globals["DESCRIPTOR"]._options = None + _globals["DESCRIPTOR"]._serialized_options = ( + b"\n\023com.dispatch.sdk.v1B\rEndpointProtoP\001\242\002\003DSX\252\002\017Dispatch.Sdk.V1\312\002\017Dispatch\\Sdk\\V1\342\002\033Dispatch\\Sdk\\V1\\GPBMetadata\352\002\021Dispatch::Sdk::V1" + ) + _globals["_CREATEEXECUTIONSREQUEST"]._serialized_start = 110 + _globals["_CREATEEXECUTIONSREQUEST"]._serialized_end = 195 + _globals["_CREATEEXECUTIONSRESPONSE"]._serialized_start = 197 + _globals["_CREATEEXECUTIONSRESPONSE"]._serialized_end = 241 + _globals["_EXECUTION"]._serialized_start = 244 + _globals["_EXECUTION"]._serialized_end = 440 + _globals["_ENDPOINTSERVICE"]._serialized_start = 442 + _globals["_ENDPOINTSERVICE"]._serialized_end = 566 +# @@protoc_insertion_point(module_scope) diff --git a/src/dispatch/sdk/v1/endpoint_pb2.pyi b/src/dispatch/sdk/v1/endpoint_pb2.pyi new file mode 100644 index 00000000..081227f5 --- /dev/null +++ b/src/dispatch/sdk/v1/endpoint_pb2.pyi @@ -0,0 +1,46 @@ +from google.protobuf import any_pb2 as _any_pb2 +from google.protobuf import duration_pb2 as _duration_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ( + ClassVar as _ClassVar, + Iterable as _Iterable, + Mapping as _Mapping, + Optional as _Optional, + Union as _Union, +) + +DESCRIPTOR: _descriptor.FileDescriptor + +class CreateExecutionsRequest(_message.Message): + __slots__ = ("executions",) + EXECUTIONS_FIELD_NUMBER: _ClassVar[int] + executions: _containers.RepeatedCompositeFieldContainer[Execution] + def __init__( + self, executions: _Optional[_Iterable[_Union[Execution, _Mapping]]] = ... + ) -> None: ... + +class CreateExecutionsResponse(_message.Message): + __slots__ = ("ids",) + IDS_FIELD_NUMBER: _ClassVar[int] + ids: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, ids: _Optional[_Iterable[str]] = ...) -> None: ... + +class Execution(_message.Message): + __slots__ = ("coroutine_uri", "coroutine_version", "input", "expiration") + COROUTINE_URI_FIELD_NUMBER: _ClassVar[int] + COROUTINE_VERSION_FIELD_NUMBER: _ClassVar[int] + INPUT_FIELD_NUMBER: _ClassVar[int] + EXPIRATION_FIELD_NUMBER: _ClassVar[int] + coroutine_uri: str + coroutine_version: str + input: _any_pb2.Any + expiration: _duration_pb2.Duration + def __init__( + self, + coroutine_uri: _Optional[str] = ..., + coroutine_version: _Optional[str] = ..., + input: _Optional[_Union[_any_pb2.Any, _Mapping]] = ..., + expiration: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., + ) -> None: ... diff --git a/src/dispatch/sdk/v1/endpoint_pb2_grpc.py b/src/dispatch/sdk/v1/endpoint_pb2_grpc.py new file mode 100644 index 00000000..7f0a40b5 --- /dev/null +++ b/src/dispatch/sdk/v1/endpoint_pb2_grpc.py @@ -0,0 +1,94 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from dispatch.sdk.v1 import endpoint_pb2 as dispatch_dot_sdk_dot_v1_dot_endpoint__pb2 + + +class EndpointServiceStub(object): + """EndpointService is a service allowing the trigger of programmable endpoints + from a dispatch SDK. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.CreateExecutions = channel.unary_unary( + "/dispatch.sdk.v1.EndpointService/CreateExecutions", + request_serializer=dispatch_dot_sdk_dot_v1_dot_endpoint__pb2.CreateExecutionsRequest.SerializeToString, + response_deserializer=dispatch_dot_sdk_dot_v1_dot_endpoint__pb2.CreateExecutionsResponse.FromString, + ) + + +class EndpointServiceServicer(object): + """EndpointService is a service allowing the trigger of programmable endpoints + from a dispatch SDK. + """ + + def CreateExecutions(self, request, context): + """CreateExecutions triggers executions of programmable endpoints. + + Executions are always asynchronous. The method does not wait for executions + to complete before returning, it only ensures that the creation was + persisted, and returns unique identifiers to represent the executions. + + The request contains a list of executions to be triggered; the method is + atomic, either all executions are recorded, or none and an error is + returned to explain the reason for the failure. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + +def add_EndpointServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + "CreateExecutions": grpc.unary_unary_rpc_method_handler( + servicer.CreateExecutions, + request_deserializer=dispatch_dot_sdk_dot_v1_dot_endpoint__pb2.CreateExecutionsRequest.FromString, + response_serializer=dispatch_dot_sdk_dot_v1_dot_endpoint__pb2.CreateExecutionsResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + "dispatch.sdk.v1.EndpointService", rpc_method_handlers + ) + server.add_generic_rpc_handlers((generic_handler,)) + + +# This class is part of an EXPERIMENTAL API. +class EndpointService(object): + """EndpointService is a service allowing the trigger of programmable endpoints + from a dispatch SDK. + """ + + @staticmethod + def CreateExecutions( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/dispatch.sdk.v1.EndpointService/CreateExecutions", + dispatch_dot_sdk_dot_v1_dot_endpoint__pb2.CreateExecutionsRequest.SerializeToString, + dispatch_dot_sdk_dot_v1_dot_endpoint__pb2.CreateExecutionsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) diff --git a/src/dispatch/sdk/v1/executor_pb2.py b/src/dispatch/sdk/v1/executor_pb2.py new file mode 100644 index 00000000..fe084951 --- /dev/null +++ b/src/dispatch/sdk/v1/executor_pb2.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: dispatch/sdk/v1/executor.proto +# Protobuf Python Version: 4.25.2 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from dispatch.sdk.v1 import status_pb2 as dispatch_dot_sdk_dot_v1_dot_status__pb2 +from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\n\x1e\x64ispatch/sdk/v1/executor.proto\x12\x0f\x64ispatch.sdk.v1\x1a\x1c\x64ispatch/sdk/v1/status.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto"\xe3\x01\n\x0e\x45xecuteRequest\x12#\n\rcoroutine_uri\x18\x01 \x01(\tR\x0c\x63oroutineUri\x12+\n\x11\x63oroutine_version\x18\x02 \x01(\tR\x10\x63oroutineVersion\x12,\n\x05input\x18\x03 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00R\x05input\x12\x44\n\rpoll_response\x18\x04 \x01(\x0b\x32\x1d.dispatch.sdk.v1.PollResponseH\x00R\x0cpollResponseB\x0b\n\tcoroutine"\xfb\x01\n\x0f\x45xecuteResponse\x12#\n\rcoroutine_uri\x18\x01 \x01(\tR\x0c\x63oroutineUri\x12+\n\x11\x63oroutine_version\x18\x02 \x01(\tR\x10\x63oroutineVersion\x12/\n\x06status\x18\x03 \x01(\x0e\x32\x17.dispatch.sdk.v1.StatusR\x06status\x12+\n\x04\x65xit\x18\x04 \x01(\x0b\x32\x15.dispatch.sdk.v1.ExitH\x00R\x04\x65xit\x12+\n\x04poll\x18\x05 \x01(\x0b\x32\x15.dispatch.sdk.v1.PollH\x00R\x04pollB\x0b\n\tdirective"k\n\x04\x45xit\x12/\n\x06result\x18\x01 \x01(\x0b\x32\x17.dispatch.sdk.v1.ResultR\x06result\x12\x32\n\ttail_call\x18\x02 \x01(\x0b\x32\x15.dispatch.sdk.v1.CallR\x08tailCall"d\n\x06Result\x12,\n\x06output\x18\x03 \x01(\x0b\x32\x14.google.protobuf.AnyR\x06output\x12,\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x16.dispatch.sdk.v1.ErrorR\x05\x65rror"5\n\x05\x45rror\x12\x12\n\x04type\x18\x01 \x01(\tR\x04type\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message"\xa0\x01\n\x04Poll\x12\x14\n\x05state\x18\x01 \x01(\x0cR\x05state\x12+\n\x05\x63\x61lls\x18\x02 \x03(\x0b\x32\x15.dispatch.sdk.v1.CallR\x05\x63\x61lls\x12\x34\n\x08max_wait\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationR\x07maxWait\x12\x1f\n\x0bmax_results\x18\x04 \x01(\x05R\nmaxResults"[\n\x0cPollResponse\x12\x14\n\x05state\x18\x01 \x01(\x0cR\x05state\x12\x35\n\x07results\x18\x02 \x03(\x0b\x32\x1b.dispatch.sdk.v1.CallResultR\x07results"\xab\x01\n\x04\x43\x61ll\x12#\n\rcoroutine_uri\x18\x01 \x01(\tR\x0c\x63oroutineUri\x12+\n\x11\x63oroutine_version\x18\x02 \x01(\tR\x10\x63oroutineVersion\x12%\n\x0e\x63orrelation_id\x18\x03 \x01(\x04R\rcorrelationId\x12*\n\x05input\x18\x04 \x01(\x0b\x32\x14.google.protobuf.AnyR\x05input"\xb6\x01\n\nCallResult\x12#\n\rcoroutine_uri\x18\x01 \x01(\tR\x0c\x63oroutineUri\x12+\n\x11\x63oroutine_version\x18\x02 \x01(\tR\x10\x63oroutineVersion\x12%\n\x0e\x63orrelation_id\x18\x03 \x01(\x04R\rcorrelationId\x12/\n\x06result\x18\x04 \x01(\x0b\x32\x17.dispatch.sdk.v1.ResultR\x06result2a\n\x0f\x45xecutorService\x12N\n\x07\x45xecute\x12\x1f.dispatch.sdk.v1.ExecuteRequest\x1a .dispatch.sdk.v1.ExecuteResponse"\x00\x42\x82\x01\n\x13\x63om.dispatch.sdk.v1B\rExecutorProtoP\x01\xa2\x02\x03\x44SX\xaa\x02\x0f\x44ispatch.Sdk.V1\xca\x02\x0f\x44ispatch\\Sdk\\V1\xe2\x02\x1b\x44ispatch\\Sdk\\V1\\GPBMetadata\xea\x02\x11\x44ispatch::Sdk::V1b\x06proto3' +) + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages( + DESCRIPTOR, "dispatch.sdk.v1.executor_pb2", _globals +) +if _descriptor._USE_C_DESCRIPTORS == False: + _globals["DESCRIPTOR"]._options = None + _globals["DESCRIPTOR"]._serialized_options = ( + b"\n\023com.dispatch.sdk.v1B\rExecutorProtoP\001\242\002\003DSX\252\002\017Dispatch.Sdk.V1\312\002\017Dispatch\\Sdk\\V1\342\002\033Dispatch\\Sdk\\V1\\GPBMetadata\352\002\021Dispatch::Sdk::V1" + ) + _globals["_EXECUTEREQUEST"]._serialized_start = 141 + _globals["_EXECUTEREQUEST"]._serialized_end = 368 + _globals["_EXECUTERESPONSE"]._serialized_start = 371 + _globals["_EXECUTERESPONSE"]._serialized_end = 622 + _globals["_EXIT"]._serialized_start = 624 + _globals["_EXIT"]._serialized_end = 731 + _globals["_RESULT"]._serialized_start = 733 + _globals["_RESULT"]._serialized_end = 833 + _globals["_ERROR"]._serialized_start = 835 + _globals["_ERROR"]._serialized_end = 888 + _globals["_POLL"]._serialized_start = 891 + _globals["_POLL"]._serialized_end = 1051 + _globals["_POLLRESPONSE"]._serialized_start = 1053 + _globals["_POLLRESPONSE"]._serialized_end = 1144 + _globals["_CALL"]._serialized_start = 1147 + _globals["_CALL"]._serialized_end = 1318 + _globals["_CALLRESULT"]._serialized_start = 1321 + _globals["_CALLRESULT"]._serialized_end = 1503 + _globals["_EXECUTORSERVICE"]._serialized_start = 1505 + _globals["_EXECUTORSERVICE"]._serialized_end = 1602 +# @@protoc_insertion_point(module_scope) diff --git a/src/ring/coroutine/v1/coroutine_pb2.pyi b/src/dispatch/sdk/v1/executor_pb2.pyi similarity index 94% rename from src/ring/coroutine/v1/coroutine_pb2.pyi rename to src/dispatch/sdk/v1/executor_pb2.pyi index bbe849a1..0f04ec33 100644 --- a/src/ring/coroutine/v1/coroutine_pb2.pyi +++ b/src/dispatch/sdk/v1/executor_pb2.pyi @@ -1,4 +1,4 @@ -from ring.status.v1 import status_pb2 as _status_pb2 +from dispatch.sdk.v1 import status_pb2 as _status_pb2 from google.protobuf import any_pb2 as _any_pb2 from google.protobuf import duration_pb2 as _duration_pb2 from google.protobuf.internal import containers as _containers @@ -15,30 +15,21 @@ from typing import ( DESCRIPTOR: _descriptor.FileDescriptor class ExecuteRequest(_message.Message): - __slots__ = ( - "coroutine_uri", - "coroutine_version", - "input", - "poll_response", - "signing_key_urn", - ) + __slots__ = ("coroutine_uri", "coroutine_version", "input", "poll_response") COROUTINE_URI_FIELD_NUMBER: _ClassVar[int] COROUTINE_VERSION_FIELD_NUMBER: _ClassVar[int] INPUT_FIELD_NUMBER: _ClassVar[int] POLL_RESPONSE_FIELD_NUMBER: _ClassVar[int] - SIGNING_KEY_URN_FIELD_NUMBER: _ClassVar[int] coroutine_uri: str coroutine_version: str input: _any_pb2.Any poll_response: PollResponse - signing_key_urn: str def __init__( self, coroutine_uri: _Optional[str] = ..., coroutine_version: _Optional[str] = ..., input: _Optional[_Union[_any_pb2.Any, _Mapping]] = ..., poll_response: _Optional[_Union[PollResponse, _Mapping]] = ..., - signing_key_urn: _Optional[str] = ..., ) -> None: ... class ExecuteResponse(_message.Message): diff --git a/src/ring/coroutine/v1/coroutine_pb2_grpc.py b/src/dispatch/sdk/v1/executor_pb2_grpc.py similarity index 67% rename from src/ring/coroutine/v1/coroutine_pb2_grpc.py rename to src/dispatch/sdk/v1/executor_pb2_grpc.py index 5280f1bb..dc2b6ab6 100644 --- a/src/ring/coroutine/v1/coroutine_pb2_grpc.py +++ b/src/dispatch/sdk/v1/executor_pb2_grpc.py @@ -2,9 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -from ring.coroutine.v1 import ( - coroutine_pb2 as ring_dot_coroutine_dot_v1_dot_coroutine__pb2, -) +from dispatch.sdk.v1 import executor_pb2 as dispatch_dot_sdk_dot_v1_dot_executor__pb2 class ExecutorServiceStub(object): @@ -17,9 +15,9 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.Execute = channel.unary_unary( - "/ring.coroutine.v1.ExecutorService/Execute", - request_serializer=ring_dot_coroutine_dot_v1_dot_coroutine__pb2.ExecuteRequest.SerializeToString, - response_deserializer=ring_dot_coroutine_dot_v1_dot_coroutine__pb2.ExecuteResponse.FromString, + "/dispatch.sdk.v1.ExecutorService/Execute", + request_serializer=dispatch_dot_sdk_dot_v1_dot_executor__pb2.ExecuteRequest.SerializeToString, + response_deserializer=dispatch_dot_sdk_dot_v1_dot_executor__pb2.ExecuteResponse.FromString, ) @@ -37,12 +35,12 @@ def add_ExecutorServiceServicer_to_server(servicer, server): rpc_method_handlers = { "Execute": grpc.unary_unary_rpc_method_handler( servicer.Execute, - request_deserializer=ring_dot_coroutine_dot_v1_dot_coroutine__pb2.ExecuteRequest.FromString, - response_serializer=ring_dot_coroutine_dot_v1_dot_coroutine__pb2.ExecuteResponse.SerializeToString, + request_deserializer=dispatch_dot_sdk_dot_v1_dot_executor__pb2.ExecuteRequest.FromString, + response_serializer=dispatch_dot_sdk_dot_v1_dot_executor__pb2.ExecuteResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( - "ring.coroutine.v1.ExecutorService", rpc_method_handlers + "dispatch.sdk.v1.ExecutorService", rpc_method_handlers ) server.add_generic_rpc_handlers((generic_handler,)) @@ -67,9 +65,9 @@ def Execute( return grpc.experimental.unary_unary( request, target, - "/ring.coroutine.v1.ExecutorService/Execute", - ring_dot_coroutine_dot_v1_dot_coroutine__pb2.ExecuteRequest.SerializeToString, - ring_dot_coroutine_dot_v1_dot_coroutine__pb2.ExecuteResponse.FromString, + "/dispatch.sdk.v1.ExecutorService/Execute", + dispatch_dot_sdk_dot_v1_dot_executor__pb2.ExecuteRequest.SerializeToString, + dispatch_dot_sdk_dot_v1_dot_executor__pb2.ExecuteResponse.FromString, options, channel_credentials, insecure, diff --git a/src/dispatch/sdk/v1/key_pb2.py b/src/dispatch/sdk/v1/key_pb2.py new file mode 100644 index 00000000..26d6825d --- /dev/null +++ b/src/dispatch/sdk/v1/key_pb2.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: dispatch/sdk/v1/key.proto +# Protobuf Python Version: 4.25.2 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\n\x19\x64ispatch/sdk/v1/key.proto\x12\x0f\x64ispatch.sdk.v1"\x19\n\x17\x43reateSigningKeyRequest"I\n\x18\x43reateSigningKeyResponse\x12-\n\x03key\x18\x01 \x01(\x0b\x32\x1b.dispatch.sdk.v1.SigningKeyR\x03key"\x19\n\x17\x44\x65leteSigningKeyRequest"\x1a\n\x18\x44\x65leteSigningKeyResponse"\x18\n\x16ListSigningKeysRequest"J\n\x17ListSigningKeysResponse\x12/\n\x04keys\x18\x01 \x03(\x0b\x32\x1b.dispatch.sdk.v1.SigningKeyR\x04keys"4\n\nSigningKey\x12\x1f\n\npublic_key\x18\x02 \x01(\x0cH\x00R\tpublicKeyB\x05\n\x03key2\xcb\x02\n\x11SigningKeyService\x12g\n\x10\x43reateSigningKey\x12(.dispatch.sdk.v1.CreateSigningKeyRequest\x1a).dispatch.sdk.v1.CreateSigningKeyResponse\x12g\n\x10\x44\x65leteSigningKey\x12(.dispatch.sdk.v1.DeleteSigningKeyRequest\x1a).dispatch.sdk.v1.DeleteSigningKeyResponse\x12\x64\n\x0fListSigningKeys\x12\'.dispatch.sdk.v1.ListSigningKeysRequest\x1a(.dispatch.sdk.v1.ListSigningKeysResponseB}\n\x13\x63om.dispatch.sdk.v1B\x08KeyProtoP\x01\xa2\x02\x03\x44SX\xaa\x02\x0f\x44ispatch.Sdk.V1\xca\x02\x0f\x44ispatch\\Sdk\\V1\xe2\x02\x1b\x44ispatch\\Sdk\\V1\\GPBMetadata\xea\x02\x11\x44ispatch::Sdk::V1b\x06proto3' +) + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "dispatch.sdk.v1.key_pb2", _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + _globals["DESCRIPTOR"]._options = None + _globals["DESCRIPTOR"]._serialized_options = ( + b"\n\023com.dispatch.sdk.v1B\010KeyProtoP\001\242\002\003DSX\252\002\017Dispatch.Sdk.V1\312\002\017Dispatch\\Sdk\\V1\342\002\033Dispatch\\Sdk\\V1\\GPBMetadata\352\002\021Dispatch::Sdk::V1" + ) + _globals["_CREATESIGNINGKEYREQUEST"]._serialized_start = 46 + _globals["_CREATESIGNINGKEYREQUEST"]._serialized_end = 71 + _globals["_CREATESIGNINGKEYRESPONSE"]._serialized_start = 73 + _globals["_CREATESIGNINGKEYRESPONSE"]._serialized_end = 146 + _globals["_DELETESIGNINGKEYREQUEST"]._serialized_start = 148 + _globals["_DELETESIGNINGKEYREQUEST"]._serialized_end = 173 + _globals["_DELETESIGNINGKEYRESPONSE"]._serialized_start = 175 + _globals["_DELETESIGNINGKEYRESPONSE"]._serialized_end = 201 + _globals["_LISTSIGNINGKEYSREQUEST"]._serialized_start = 203 + _globals["_LISTSIGNINGKEYSREQUEST"]._serialized_end = 227 + _globals["_LISTSIGNINGKEYSRESPONSE"]._serialized_start = 229 + _globals["_LISTSIGNINGKEYSRESPONSE"]._serialized_end = 303 + _globals["_SIGNINGKEY"]._serialized_start = 305 + _globals["_SIGNINGKEY"]._serialized_end = 357 + _globals["_SIGNINGKEYSERVICE"]._serialized_start = 360 + _globals["_SIGNINGKEYSERVICE"]._serialized_end = 691 +# @@protoc_insertion_point(module_scope) diff --git a/src/dispatch/sdk/v1/key_pb2.pyi b/src/dispatch/sdk/v1/key_pb2.pyi new file mode 100644 index 00000000..157b97e5 --- /dev/null +++ b/src/dispatch/sdk/v1/key_pb2.pyi @@ -0,0 +1,48 @@ +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ( + ClassVar as _ClassVar, + Iterable as _Iterable, + Mapping as _Mapping, + Optional as _Optional, + Union as _Union, +) + +DESCRIPTOR: _descriptor.FileDescriptor + +class CreateSigningKeyRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class CreateSigningKeyResponse(_message.Message): + __slots__ = ("key",) + KEY_FIELD_NUMBER: _ClassVar[int] + key: SigningKey + def __init__(self, key: _Optional[_Union[SigningKey, _Mapping]] = ...) -> None: ... + +class DeleteSigningKeyRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class DeleteSigningKeyResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class ListSigningKeysRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class ListSigningKeysResponse(_message.Message): + __slots__ = ("keys",) + KEYS_FIELD_NUMBER: _ClassVar[int] + keys: _containers.RepeatedCompositeFieldContainer[SigningKey] + def __init__( + self, keys: _Optional[_Iterable[_Union[SigningKey, _Mapping]]] = ... + ) -> None: ... + +class SigningKey(_message.Message): + __slots__ = ("public_key",) + PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] + public_key: bytes + def __init__(self, public_key: _Optional[bytes] = ...) -> None: ... diff --git a/src/dispatch/sdk/v1/key_pb2_grpc.py b/src/dispatch/sdk/v1/key_pb2_grpc.py new file mode 100644 index 00000000..f41d50f4 --- /dev/null +++ b/src/dispatch/sdk/v1/key_pb2_grpc.py @@ -0,0 +1,169 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from dispatch.sdk.v1 import key_pb2 as dispatch_dot_sdk_dot_v1_dot_key__pb2 + + +class SigningKeyServiceStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.CreateSigningKey = channel.unary_unary( + "/dispatch.sdk.v1.SigningKeyService/CreateSigningKey", + request_serializer=dispatch_dot_sdk_dot_v1_dot_key__pb2.CreateSigningKeyRequest.SerializeToString, + response_deserializer=dispatch_dot_sdk_dot_v1_dot_key__pb2.CreateSigningKeyResponse.FromString, + ) + self.DeleteSigningKey = channel.unary_unary( + "/dispatch.sdk.v1.SigningKeyService/DeleteSigningKey", + request_serializer=dispatch_dot_sdk_dot_v1_dot_key__pb2.DeleteSigningKeyRequest.SerializeToString, + response_deserializer=dispatch_dot_sdk_dot_v1_dot_key__pb2.DeleteSigningKeyResponse.FromString, + ) + self.ListSigningKeys = channel.unary_unary( + "/dispatch.sdk.v1.SigningKeyService/ListSigningKeys", + request_serializer=dispatch_dot_sdk_dot_v1_dot_key__pb2.ListSigningKeysRequest.SerializeToString, + response_deserializer=dispatch_dot_sdk_dot_v1_dot_key__pb2.ListSigningKeysResponse.FromString, + ) + + +class SigningKeyServiceServicer(object): + """Missing associated documentation comment in .proto file.""" + + def CreateSigningKey(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def DeleteSigningKey(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ListSigningKeys(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + +def add_SigningKeyServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + "CreateSigningKey": grpc.unary_unary_rpc_method_handler( + servicer.CreateSigningKey, + request_deserializer=dispatch_dot_sdk_dot_v1_dot_key__pb2.CreateSigningKeyRequest.FromString, + response_serializer=dispatch_dot_sdk_dot_v1_dot_key__pb2.CreateSigningKeyResponse.SerializeToString, + ), + "DeleteSigningKey": grpc.unary_unary_rpc_method_handler( + servicer.DeleteSigningKey, + request_deserializer=dispatch_dot_sdk_dot_v1_dot_key__pb2.DeleteSigningKeyRequest.FromString, + response_serializer=dispatch_dot_sdk_dot_v1_dot_key__pb2.DeleteSigningKeyResponse.SerializeToString, + ), + "ListSigningKeys": grpc.unary_unary_rpc_method_handler( + servicer.ListSigningKeys, + request_deserializer=dispatch_dot_sdk_dot_v1_dot_key__pb2.ListSigningKeysRequest.FromString, + response_serializer=dispatch_dot_sdk_dot_v1_dot_key__pb2.ListSigningKeysResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + "dispatch.sdk.v1.SigningKeyService", rpc_method_handlers + ) + server.add_generic_rpc_handlers((generic_handler,)) + + +# This class is part of an EXPERIMENTAL API. +class SigningKeyService(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def CreateSigningKey( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/dispatch.sdk.v1.SigningKeyService/CreateSigningKey", + dispatch_dot_sdk_dot_v1_dot_key__pb2.CreateSigningKeyRequest.SerializeToString, + dispatch_dot_sdk_dot_v1_dot_key__pb2.CreateSigningKeyResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def DeleteSigningKey( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/dispatch.sdk.v1.SigningKeyService/DeleteSigningKey", + dispatch_dot_sdk_dot_v1_dot_key__pb2.DeleteSigningKeyRequest.SerializeToString, + dispatch_dot_sdk_dot_v1_dot_key__pb2.DeleteSigningKeyResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def ListSigningKeys( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/dispatch.sdk.v1.SigningKeyService/ListSigningKeys", + dispatch_dot_sdk_dot_v1_dot_key__pb2.ListSigningKeysRequest.SerializeToString, + dispatch_dot_sdk_dot_v1_dot_key__pb2.ListSigningKeysResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) diff --git a/src/dispatch/sdk/v1/status_pb2.py b/src/dispatch/sdk/v1/status_pb2.py new file mode 100644 index 00000000..a72009c4 --- /dev/null +++ b/src/dispatch/sdk/v1/status_pb2.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: dispatch/sdk/v1/status.proto +# Protobuf Python Version: 4.25.2 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b"\n\x1c\x64ispatch/sdk/v1/status.proto\x12\x0f\x64ispatch.sdk.v1*\xea\x01\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\r\n\tSTATUS_OK\x10\x01\x12\x12\n\x0eSTATUS_TIMEOUT\x10\x02\x12\x14\n\x10STATUS_THROTTLED\x10\x03\x12\x1b\n\x17STATUS_INVALID_ARGUMENT\x10\x04\x12\x1b\n\x17STATUS_INVALID_RESPONSE\x10\x05\x12\x1a\n\x16STATUS_TEMPORARY_ERROR\x10\x06\x12\x1a\n\x16STATUS_PERMANENT_ERROR\x10\x07\x12\x1d\n\x19STATUS_INCOMPATIBLE_STATE\x10\x08\x42\x80\x01\n\x13\x63om.dispatch.sdk.v1B\x0bStatusProtoP\x01\xa2\x02\x03\x44SX\xaa\x02\x0f\x44ispatch.Sdk.V1\xca\x02\x0f\x44ispatch\\Sdk\\V1\xe2\x02\x1b\x44ispatch\\Sdk\\V1\\GPBMetadata\xea\x02\x11\x44ispatch::Sdk::V1b\x06proto3" +) + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages( + DESCRIPTOR, "dispatch.sdk.v1.status_pb2", _globals +) +if _descriptor._USE_C_DESCRIPTORS == False: + _globals["DESCRIPTOR"]._options = None + _globals["DESCRIPTOR"]._serialized_options = ( + b"\n\023com.dispatch.sdk.v1B\013StatusProtoP\001\242\002\003DSX\252\002\017Dispatch.Sdk.V1\312\002\017Dispatch\\Sdk\\V1\342\002\033Dispatch\\Sdk\\V1\\GPBMetadata\352\002\021Dispatch::Sdk::V1" + ) + _globals["_STATUS"]._serialized_start = 50 + _globals["_STATUS"]._serialized_end = 284 +# @@protoc_insertion_point(module_scope) diff --git a/src/ring/status/v1/status_pb2.pyi b/src/dispatch/sdk/v1/status_pb2.pyi similarity index 100% rename from src/ring/status/v1/status_pb2.pyi rename to src/dispatch/sdk/v1/status_pb2.pyi diff --git a/src/ring/status/v1/status_pb2_grpc.py b/src/dispatch/sdk/v1/status_pb2_grpc.py similarity index 100% rename from src/ring/status/v1/status_pb2_grpc.py rename to src/dispatch/sdk/v1/status_pb2_grpc.py diff --git a/src/dispatch/security/v1/security_pb2.py b/src/dispatch/security/v1/security_pb2.py deleted file mode 100644 index 0db6ea2c..00000000 --- a/src/dispatch/security/v1/security_pb2.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: dispatch/security/v1/security.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n#dispatch/security/v1/security.proto\x12\x14\x64ispatch.security.v1"\x8c\x01\n\x14NetworkAccessControl\x12\x39\n\x05\x61llow\x18\x01 \x03(\x0b\x32#.dispatch.security.v1.NetworkPrefixR\x05\x61llow\x12\x39\n\x05\x62lock\x18\x02 \x03(\x0b\x32#.dispatch.security.v1.NetworkPrefixR\x05\x62lock"7\n\rNetworkPrefix\x12\x12\n\x04\x61\x64\x64r\x18\x01 \x01(\x0cR\x04\x61\x64\x64r\x12\x12\n\x04\x62its\x18\x02 \x01(\rR\x04\x62itsB\x9b\x01\n\x18\x63om.dispatch.security.v1B\rSecurityProtoP\x01\xa2\x02\x03\x44SX\xaa\x02\x14\x44ispatch.Security.V1\xca\x02\x14\x44ispatch\\Security\\V1\xe2\x02 Dispatch\\Security\\V1\\GPBMetadata\xea\x02\x16\x44ispatch::Security::V1b\x06proto3' -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages( - DESCRIPTOR, "dispatch.security.v1.security_pb2", _globals -) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\030com.dispatch.security.v1B\rSecurityProtoP\001\242\002\003DSX\252\002\024Dispatch.Security.V1\312\002\024Dispatch\\Security\\V1\342\002 Dispatch\\Security\\V1\\GPBMetadata\352\002\026Dispatch::Security::V1" - ) - _globals["_NETWORKACCESSCONTROL"]._serialized_start = 62 - _globals["_NETWORKACCESSCONTROL"]._serialized_end = 202 - _globals["_NETWORKPREFIX"]._serialized_start = 204 - _globals["_NETWORKPREFIX"]._serialized_end = 259 -# @@protoc_insertion_point(module_scope) diff --git a/src/dispatch/security/v1/security_pb2.pyi b/src/dispatch/security/v1/security_pb2.pyi deleted file mode 100644 index 95c0e4d7..00000000 --- a/src/dispatch/security/v1/security_pb2.pyi +++ /dev/null @@ -1,34 +0,0 @@ -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) - -DESCRIPTOR: _descriptor.FileDescriptor - -class NetworkAccessControl(_message.Message): - __slots__ = ("allow", "block") - ALLOW_FIELD_NUMBER: _ClassVar[int] - BLOCK_FIELD_NUMBER: _ClassVar[int] - allow: _containers.RepeatedCompositeFieldContainer[NetworkPrefix] - block: _containers.RepeatedCompositeFieldContainer[NetworkPrefix] - def __init__( - self, - allow: _Optional[_Iterable[_Union[NetworkPrefix, _Mapping]]] = ..., - block: _Optional[_Iterable[_Union[NetworkPrefix, _Mapping]]] = ..., - ) -> None: ... - -class NetworkPrefix(_message.Message): - __slots__ = ("addr", "bits") - ADDR_FIELD_NUMBER: _ClassVar[int] - BITS_FIELD_NUMBER: _ClassVar[int] - addr: bytes - bits: int - def __init__( - self, addr: _Optional[bytes] = ..., bits: _Optional[int] = ... - ) -> None: ... diff --git a/src/dispatch/security/v1/security_pb2_grpc.py b/src/dispatch/security/v1/security_pb2_grpc.py deleted file mode 100644 index 8a939394..00000000 --- a/src/dispatch/security/v1/security_pb2_grpc.py +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc diff --git a/src/dispatch/v1/metadata_pb2.py b/src/dispatch/v1/metadata_pb2.py deleted file mode 100644 index 0747e034..00000000 --- a/src/dispatch/v1/metadata_pb2.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: dispatch/v1/metadata.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b"\n\x1a\x64ispatch/v1/metadata.proto\x12\x0b\x64ispatch.v1\"J\n\x08Metadata\x12'\n\x0forganization_id\x18\x01 \x01(\rR\x0eorganizationId\x12\x15\n\x06key_id\x18\x02 \x01(\rR\x05keyIdBm\n\x0f\x63om.dispatch.v1B\rMetadataProtoP\x01\xa2\x02\x03\x44XX\xaa\x02\x0b\x44ispatch.V1\xca\x02\x0b\x44ispatch\\V1\xe2\x02\x17\x44ispatch\\V1\\GPBMetadata\xea\x02\x0c\x44ispatch::V1b\x06proto3" -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages( - DESCRIPTOR, "dispatch.v1.metadata_pb2", _globals -) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\017com.dispatch.v1B\rMetadataProtoP\001\242\002\003DXX\252\002\013Dispatch.V1\312\002\013Dispatch\\V1\342\002\027Dispatch\\V1\\GPBMetadata\352\002\014Dispatch::V1" - ) - _globals["_METADATA"]._serialized_start = 43 - _globals["_METADATA"]._serialized_end = 117 -# @@protoc_insertion_point(module_scope) diff --git a/src/dispatch/v1/metadata_pb2.pyi b/src/dispatch/v1/metadata_pb2.pyi deleted file mode 100644 index 34c0c803..00000000 --- a/src/dispatch/v1/metadata_pb2.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ClassVar as _ClassVar, Optional as _Optional - -DESCRIPTOR: _descriptor.FileDescriptor - -class Metadata(_message.Message): - __slots__ = ("organization_id", "key_id") - ORGANIZATION_ID_FIELD_NUMBER: _ClassVar[int] - KEY_ID_FIELD_NUMBER: _ClassVar[int] - organization_id: int - key_id: int - def __init__( - self, organization_id: _Optional[int] = ..., key_id: _Optional[int] = ... - ) -> None: ... diff --git a/src/dispatch/v1/metadata_pb2_grpc.py b/src/dispatch/v1/metadata_pb2_grpc.py deleted file mode 100644 index 8a939394..00000000 --- a/src/dispatch/v1/metadata_pb2_grpc.py +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc diff --git a/src/ring/admin/v1/cluster_pb2.py b/src/ring/admin/v1/cluster_pb2.py deleted file mode 100644 index 65be5807..00000000 --- a/src/ring/admin/v1/cluster_pb2.py +++ /dev/null @@ -1,103 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ring/admin/v1/cluster.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x1bring/admin/v1/cluster.proto\x12\rring.admin.v1\x1a\x1fgoogle/protobuf/timestamp.proto"\x8e\x03\n\x13InstanceDescription\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04zone\x18\x02 \x01(\tR\x04zone\x12-\n\x06status\x18\x03 \x01(\x0e\x32\x15.ring.admin.v1.StatusR\x06status\x12\x12\n\x04port\x18\x04 \x01(\x05R\x04port\x12%\n\x0eipv4_addresses\x18\x05 \x03(\tR\ripv4Addresses\x12%\n\x0eipv6_addresses\x18\x06 \x03(\tR\ripv6Addresses\x12\x1e\n\npartitions\x18\x07 \x03(\x05R\npartitions\x12,\n\x03ttl\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x03ttl\x12\x39\n\ncreated_at\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12\x39\n\nupdated_at\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt",\n\x18\x44\x65scribeInstancesRequest\x12\x10\n\x03ids\x18\x01 \x03(\tR\x03ids"]\n\x19\x44\x65scribeInstancesResponse\x12@\n\tinstances\x18\x01 \x03(\x0b\x32".ring.admin.v1.InstanceDescriptionR\tinstances"\x9b\x02\n\x14PartitionDescription\x12\x16\n\x06number\x18\x01 \x01(\x05R\x06number\x12\x14\n\x05owner\x18\x02 \x01(\tR\x05owner\x12\x18\n\x07\x63reator\x18\x03 \x01(\tR\x07\x63reator\x12\x39\n\ncreated_at\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12\x39\n\nupdated_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x45\n\tchangelog\x18\x06 \x03(\x0b\x32\'.ring.admin.v1.PartitionOwnershipChangeR\tchangelog"`\n\x18PartitionOwnershipChange\x12.\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12\x14\n\x05owner\x18\x02 \x01(\tR\x05owner"5\n\x19\x44\x65scribePartitionsRequest\x12\x18\n\x07numbers\x18\x01 \x03(\x05R\x07numbers"a\n\x1a\x44\x65scribePartitionsResponse\x12\x43\n\npartitions\x18\x01 \x03(\x0b\x32#.ring.admin.v1.PartitionDescriptionR\npartitions"c\n\x0fZoneDescription\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x1c\n\tinstances\x18\x02 \x03(\tR\tinstances\x12\x1e\n\npartitions\x18\x03 \x03(\x05R\npartitions",\n\x14\x44\x65scribeZonesRequest\x12\x14\n\x05names\x18\x01 \x03(\tR\x05names"M\n\x15\x44\x65scribeZonesResponse\x12\x34\n\x05zones\x18\x01 \x03(\x0b\x32\x1e.ring.admin.v1.ZoneDescriptionR\x05zones"\xb4\x02\n\x0fInstanceSummary\x12\x1a\n\x08instance\x18\x01 \x01(\tR\x08instance\x12\x12\n\x04zone\x18\x02 \x01(\tR\x04zone\x12-\n\x06status\x18\x03 \x01(\x0e\x32\x15.ring.admin.v1.StatusR\x06status\x12\x1e\n\npartitions\x18\x04 \x01(\x05R\npartitions\x12,\n\x03ttl\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x03ttl\x12\x39\n\ncreated_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12\x39\n\nupdated_at\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt"\x16\n\x14ListInstancesRequest"K\n\x15ListInstancesResponse\x12\x32\n\x04list\x18\x01 \x03(\x0b\x32\x1e.ring.admin.v1.InstanceSummaryR\x04list"x\n\x19PartitionOwnershipSummary\x12\x1a\n\x08instance\x18\x01 \x01(\tR\x08instance\x12?\n\npartitions\x18\x02 \x03(\x0b\x32\x1f.ring.admin.v1.PartitionSummaryR\npartitions"\xde\x01\n\x10PartitionSummary\x12\x1c\n\tpartition\x18\x01 \x01(\x05R\tpartition\x12\x39\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12\x39\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x36\n\x06status\x18\x04 \x01(\x0e\x32\x1e.ring.admin.v1.PartitionStatusR\x06status"\x17\n\x15ListPartitionsRequest"V\n\x16ListPartitionsResponse\x12<\n\x04list\x18\x01 \x03(\x0b\x32(.ring.admin.v1.PartitionOwnershipSummaryR\x04list"_\n\x0bZoneSummary\x12\x12\n\x04zone\x18\x01 \x01(\tR\x04zone\x12\x1c\n\tinstances\x18\x02 \x01(\x05R\tinstances\x12\x1e\n\npartitions\x18\x03 \x01(\x05R\npartitions"\x12\n\x10ListZonesRequest"C\n\x11ListZonesResponse\x12.\n\x04list\x18\x01 \x03(\x0b\x32\x1a.ring.admin.v1.ZoneSummaryR\x04list*J\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x12\n\x0eSTATUS_HEALTHY\x10\x01\x12\x14\n\x10STATUS_UNHEALTHY\x10\x02*n\n\x0fPartitionStatus\x12 \n\x1cPARTITION_STATUS_UNSPECIFIED\x10\x00\x12\x1b\n\x17PARTITION_STATUS_ACTIVE\x10\x01\x12\x1c\n\x18PARTITION_STATUS_PASSIVE\x10\x02\x32\xe8\x04\n\x0e\x43lusterService\x12k\n\x11\x44\x65scribeInstances\x12\'.ring.admin.v1.DescribeInstancesRequest\x1a(.ring.admin.v1.DescribeInstancesResponse"\x03\x90\x02\x01\x12n\n\x12\x44\x65scribePartitions\x12(.ring.admin.v1.DescribePartitionsRequest\x1a).ring.admin.v1.DescribePartitionsResponse"\x03\x90\x02\x01\x12_\n\rDescribeZones\x12#.ring.admin.v1.DescribeZonesRequest\x1a$.ring.admin.v1.DescribeZonesResponse"\x03\x90\x02\x01\x12_\n\rListInstances\x12#.ring.admin.v1.ListInstancesRequest\x1a$.ring.admin.v1.ListInstancesResponse"\x03\x90\x02\x01\x12\x62\n\x0eListPartitions\x12$.ring.admin.v1.ListPartitionsRequest\x1a%.ring.admin.v1.ListPartitionsResponse"\x03\x90\x02\x01\x12S\n\tListZones\x12\x1f.ring.admin.v1.ListZonesRequest\x1a .ring.admin.v1.ListZonesResponse"\x03\x90\x02\x01\x42w\n\x11\x63om.ring.admin.v1B\x0c\x43lusterProtoP\x01\xa2\x02\x03RAX\xaa\x02\rRing.Admin.V1\xca\x02\rRing\\Admin\\V1\xe2\x02\x19Ring\\Admin\\V1\\GPBMetadata\xea\x02\x0fRing::Admin::V1b\x06proto3' -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages( - DESCRIPTOR, "ring.admin.v1.cluster_pb2", _globals -) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\021com.ring.admin.v1B\014ClusterProtoP\001\242\002\003RAX\252\002\rRing.Admin.V1\312\002\rRing\\Admin\\V1\342\002\031Ring\\Admin\\V1\\GPBMetadata\352\002\017Ring::Admin::V1" - ) - _globals["_CLUSTERSERVICE"].methods_by_name["DescribeInstances"]._options = None - _globals["_CLUSTERSERVICE"].methods_by_name[ - "DescribeInstances" - ]._serialized_options = b"\220\002\001" - _globals["_CLUSTERSERVICE"].methods_by_name["DescribePartitions"]._options = None - _globals["_CLUSTERSERVICE"].methods_by_name[ - "DescribePartitions" - ]._serialized_options = b"\220\002\001" - _globals["_CLUSTERSERVICE"].methods_by_name["DescribeZones"]._options = None - _globals["_CLUSTERSERVICE"].methods_by_name[ - "DescribeZones" - ]._serialized_options = b"\220\002\001" - _globals["_CLUSTERSERVICE"].methods_by_name["ListInstances"]._options = None - _globals["_CLUSTERSERVICE"].methods_by_name[ - "ListInstances" - ]._serialized_options = b"\220\002\001" - _globals["_CLUSTERSERVICE"].methods_by_name["ListPartitions"]._options = None - _globals["_CLUSTERSERVICE"].methods_by_name[ - "ListPartitions" - ]._serialized_options = b"\220\002\001" - _globals["_CLUSTERSERVICE"].methods_by_name["ListZones"]._options = None - _globals["_CLUSTERSERVICE"].methods_by_name[ - "ListZones" - ]._serialized_options = b"\220\002\001" - _globals["_STATUS"]._serialized_start = 2443 - _globals["_STATUS"]._serialized_end = 2517 - _globals["_PARTITIONSTATUS"]._serialized_start = 2519 - _globals["_PARTITIONSTATUS"]._serialized_end = 2629 - _globals["_INSTANCEDESCRIPTION"]._serialized_start = 80 - _globals["_INSTANCEDESCRIPTION"]._serialized_end = 478 - _globals["_DESCRIBEINSTANCESREQUEST"]._serialized_start = 480 - _globals["_DESCRIBEINSTANCESREQUEST"]._serialized_end = 524 - _globals["_DESCRIBEINSTANCESRESPONSE"]._serialized_start = 526 - _globals["_DESCRIBEINSTANCESRESPONSE"]._serialized_end = 619 - _globals["_PARTITIONDESCRIPTION"]._serialized_start = 622 - _globals["_PARTITIONDESCRIPTION"]._serialized_end = 905 - _globals["_PARTITIONOWNERSHIPCHANGE"]._serialized_start = 907 - _globals["_PARTITIONOWNERSHIPCHANGE"]._serialized_end = 1003 - _globals["_DESCRIBEPARTITIONSREQUEST"]._serialized_start = 1005 - _globals["_DESCRIBEPARTITIONSREQUEST"]._serialized_end = 1058 - _globals["_DESCRIBEPARTITIONSRESPONSE"]._serialized_start = 1060 - _globals["_DESCRIBEPARTITIONSRESPONSE"]._serialized_end = 1157 - _globals["_ZONEDESCRIPTION"]._serialized_start = 1159 - _globals["_ZONEDESCRIPTION"]._serialized_end = 1258 - _globals["_DESCRIBEZONESREQUEST"]._serialized_start = 1260 - _globals["_DESCRIBEZONESREQUEST"]._serialized_end = 1304 - _globals["_DESCRIBEZONESRESPONSE"]._serialized_start = 1306 - _globals["_DESCRIBEZONESRESPONSE"]._serialized_end = 1383 - _globals["_INSTANCESUMMARY"]._serialized_start = 1386 - _globals["_INSTANCESUMMARY"]._serialized_end = 1694 - _globals["_LISTINSTANCESREQUEST"]._serialized_start = 1696 - _globals["_LISTINSTANCESREQUEST"]._serialized_end = 1718 - _globals["_LISTINSTANCESRESPONSE"]._serialized_start = 1720 - _globals["_LISTINSTANCESRESPONSE"]._serialized_end = 1795 - _globals["_PARTITIONOWNERSHIPSUMMARY"]._serialized_start = 1797 - _globals["_PARTITIONOWNERSHIPSUMMARY"]._serialized_end = 1917 - _globals["_PARTITIONSUMMARY"]._serialized_start = 1920 - _globals["_PARTITIONSUMMARY"]._serialized_end = 2142 - _globals["_LISTPARTITIONSREQUEST"]._serialized_start = 2144 - _globals["_LISTPARTITIONSREQUEST"]._serialized_end = 2167 - _globals["_LISTPARTITIONSRESPONSE"]._serialized_start = 2169 - _globals["_LISTPARTITIONSRESPONSE"]._serialized_end = 2255 - _globals["_ZONESUMMARY"]._serialized_start = 2257 - _globals["_ZONESUMMARY"]._serialized_end = 2352 - _globals["_LISTZONESREQUEST"]._serialized_start = 2354 - _globals["_LISTZONESREQUEST"]._serialized_end = 2372 - _globals["_LISTZONESRESPONSE"]._serialized_start = 2374 - _globals["_LISTZONESRESPONSE"]._serialized_end = 2441 - _globals["_CLUSTERSERVICE"]._serialized_start = 2632 - _globals["_CLUSTERSERVICE"]._serialized_end = 3248 -# @@protoc_insertion_point(module_scope) diff --git a/src/ring/admin/v1/cluster_pb2.pyi b/src/ring/admin/v1/cluster_pb2.pyi deleted file mode 100644 index 3cf7f705..00000000 --- a/src/ring/admin/v1/cluster_pb2.pyi +++ /dev/null @@ -1,294 +0,0 @@ -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) - -DESCRIPTOR: _descriptor.FileDescriptor - -class Status(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - STATUS_UNSPECIFIED: _ClassVar[Status] - STATUS_HEALTHY: _ClassVar[Status] - STATUS_UNHEALTHY: _ClassVar[Status] - -class PartitionStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - PARTITION_STATUS_UNSPECIFIED: _ClassVar[PartitionStatus] - PARTITION_STATUS_ACTIVE: _ClassVar[PartitionStatus] - PARTITION_STATUS_PASSIVE: _ClassVar[PartitionStatus] - -STATUS_UNSPECIFIED: Status -STATUS_HEALTHY: Status -STATUS_UNHEALTHY: Status -PARTITION_STATUS_UNSPECIFIED: PartitionStatus -PARTITION_STATUS_ACTIVE: PartitionStatus -PARTITION_STATUS_PASSIVE: PartitionStatus - -class InstanceDescription(_message.Message): - __slots__ = ( - "id", - "zone", - "status", - "port", - "ipv4_addresses", - "ipv6_addresses", - "partitions", - "ttl", - "created_at", - "updated_at", - ) - ID_FIELD_NUMBER: _ClassVar[int] - ZONE_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - PORT_FIELD_NUMBER: _ClassVar[int] - IPV4_ADDRESSES_FIELD_NUMBER: _ClassVar[int] - IPV6_ADDRESSES_FIELD_NUMBER: _ClassVar[int] - PARTITIONS_FIELD_NUMBER: _ClassVar[int] - TTL_FIELD_NUMBER: _ClassVar[int] - CREATED_AT_FIELD_NUMBER: _ClassVar[int] - UPDATED_AT_FIELD_NUMBER: _ClassVar[int] - id: str - zone: str - status: Status - port: int - ipv4_addresses: _containers.RepeatedScalarFieldContainer[str] - ipv6_addresses: _containers.RepeatedScalarFieldContainer[str] - partitions: _containers.RepeatedScalarFieldContainer[int] - ttl: _timestamp_pb2.Timestamp - created_at: _timestamp_pb2.Timestamp - updated_at: _timestamp_pb2.Timestamp - def __init__( - self, - id: _Optional[str] = ..., - zone: _Optional[str] = ..., - status: _Optional[_Union[Status, str]] = ..., - port: _Optional[int] = ..., - ipv4_addresses: _Optional[_Iterable[str]] = ..., - ipv6_addresses: _Optional[_Iterable[str]] = ..., - partitions: _Optional[_Iterable[int]] = ..., - ttl: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - created_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - updated_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - ) -> None: ... - -class DescribeInstancesRequest(_message.Message): - __slots__ = ("ids",) - IDS_FIELD_NUMBER: _ClassVar[int] - ids: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, ids: _Optional[_Iterable[str]] = ...) -> None: ... - -class DescribeInstancesResponse(_message.Message): - __slots__ = ("instances",) - INSTANCES_FIELD_NUMBER: _ClassVar[int] - instances: _containers.RepeatedCompositeFieldContainer[InstanceDescription] - def __init__( - self, - instances: _Optional[_Iterable[_Union[InstanceDescription, _Mapping]]] = ..., - ) -> None: ... - -class PartitionDescription(_message.Message): - __slots__ = ("number", "owner", "creator", "created_at", "updated_at", "changelog") - NUMBER_FIELD_NUMBER: _ClassVar[int] - OWNER_FIELD_NUMBER: _ClassVar[int] - CREATOR_FIELD_NUMBER: _ClassVar[int] - CREATED_AT_FIELD_NUMBER: _ClassVar[int] - UPDATED_AT_FIELD_NUMBER: _ClassVar[int] - CHANGELOG_FIELD_NUMBER: _ClassVar[int] - number: int - owner: str - creator: str - created_at: _timestamp_pb2.Timestamp - updated_at: _timestamp_pb2.Timestamp - changelog: _containers.RepeatedCompositeFieldContainer[PartitionOwnershipChange] - def __init__( - self, - number: _Optional[int] = ..., - owner: _Optional[str] = ..., - creator: _Optional[str] = ..., - created_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - updated_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - changelog: _Optional[ - _Iterable[_Union[PartitionOwnershipChange, _Mapping]] - ] = ..., - ) -> None: ... - -class PartitionOwnershipChange(_message.Message): - __slots__ = ("time", "owner") - TIME_FIELD_NUMBER: _ClassVar[int] - OWNER_FIELD_NUMBER: _ClassVar[int] - time: _timestamp_pb2.Timestamp - owner: str - def __init__( - self, - time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - owner: _Optional[str] = ..., - ) -> None: ... - -class DescribePartitionsRequest(_message.Message): - __slots__ = ("numbers",) - NUMBERS_FIELD_NUMBER: _ClassVar[int] - numbers: _containers.RepeatedScalarFieldContainer[int] - def __init__(self, numbers: _Optional[_Iterable[int]] = ...) -> None: ... - -class DescribePartitionsResponse(_message.Message): - __slots__ = ("partitions",) - PARTITIONS_FIELD_NUMBER: _ClassVar[int] - partitions: _containers.RepeatedCompositeFieldContainer[PartitionDescription] - def __init__( - self, - partitions: _Optional[_Iterable[_Union[PartitionDescription, _Mapping]]] = ..., - ) -> None: ... - -class ZoneDescription(_message.Message): - __slots__ = ("name", "instances", "partitions") - NAME_FIELD_NUMBER: _ClassVar[int] - INSTANCES_FIELD_NUMBER: _ClassVar[int] - PARTITIONS_FIELD_NUMBER: _ClassVar[int] - name: str - instances: _containers.RepeatedScalarFieldContainer[str] - partitions: _containers.RepeatedScalarFieldContainer[int] - def __init__( - self, - name: _Optional[str] = ..., - instances: _Optional[_Iterable[str]] = ..., - partitions: _Optional[_Iterable[int]] = ..., - ) -> None: ... - -class DescribeZonesRequest(_message.Message): - __slots__ = ("names",) - NAMES_FIELD_NUMBER: _ClassVar[int] - names: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, names: _Optional[_Iterable[str]] = ...) -> None: ... - -class DescribeZonesResponse(_message.Message): - __slots__ = ("zones",) - ZONES_FIELD_NUMBER: _ClassVar[int] - zones: _containers.RepeatedCompositeFieldContainer[ZoneDescription] - def __init__( - self, zones: _Optional[_Iterable[_Union[ZoneDescription, _Mapping]]] = ... - ) -> None: ... - -class InstanceSummary(_message.Message): - __slots__ = ( - "instance", - "zone", - "status", - "partitions", - "ttl", - "created_at", - "updated_at", - ) - INSTANCE_FIELD_NUMBER: _ClassVar[int] - ZONE_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - PARTITIONS_FIELD_NUMBER: _ClassVar[int] - TTL_FIELD_NUMBER: _ClassVar[int] - CREATED_AT_FIELD_NUMBER: _ClassVar[int] - UPDATED_AT_FIELD_NUMBER: _ClassVar[int] - instance: str - zone: str - status: Status - partitions: int - ttl: _timestamp_pb2.Timestamp - created_at: _timestamp_pb2.Timestamp - updated_at: _timestamp_pb2.Timestamp - def __init__( - self, - instance: _Optional[str] = ..., - zone: _Optional[str] = ..., - status: _Optional[_Union[Status, str]] = ..., - partitions: _Optional[int] = ..., - ttl: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - created_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - updated_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - ) -> None: ... - -class ListInstancesRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class ListInstancesResponse(_message.Message): - __slots__ = ("list",) - LIST_FIELD_NUMBER: _ClassVar[int] - list: _containers.RepeatedCompositeFieldContainer[InstanceSummary] - def __init__( - self, list: _Optional[_Iterable[_Union[InstanceSummary, _Mapping]]] = ... - ) -> None: ... - -class PartitionOwnershipSummary(_message.Message): - __slots__ = ("instance", "partitions") - INSTANCE_FIELD_NUMBER: _ClassVar[int] - PARTITIONS_FIELD_NUMBER: _ClassVar[int] - instance: str - partitions: _containers.RepeatedCompositeFieldContainer[PartitionSummary] - def __init__( - self, - instance: _Optional[str] = ..., - partitions: _Optional[_Iterable[_Union[PartitionSummary, _Mapping]]] = ..., - ) -> None: ... - -class PartitionSummary(_message.Message): - __slots__ = ("partition", "created_at", "updated_at", "status") - PARTITION_FIELD_NUMBER: _ClassVar[int] - CREATED_AT_FIELD_NUMBER: _ClassVar[int] - UPDATED_AT_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - partition: int - created_at: _timestamp_pb2.Timestamp - updated_at: _timestamp_pb2.Timestamp - status: PartitionStatus - def __init__( - self, - partition: _Optional[int] = ..., - created_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - updated_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - status: _Optional[_Union[PartitionStatus, str]] = ..., - ) -> None: ... - -class ListPartitionsRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class ListPartitionsResponse(_message.Message): - __slots__ = ("list",) - LIST_FIELD_NUMBER: _ClassVar[int] - list: _containers.RepeatedCompositeFieldContainer[PartitionOwnershipSummary] - def __init__( - self, - list: _Optional[_Iterable[_Union[PartitionOwnershipSummary, _Mapping]]] = ..., - ) -> None: ... - -class ZoneSummary(_message.Message): - __slots__ = ("zone", "instances", "partitions") - ZONE_FIELD_NUMBER: _ClassVar[int] - INSTANCES_FIELD_NUMBER: _ClassVar[int] - PARTITIONS_FIELD_NUMBER: _ClassVar[int] - zone: str - instances: int - partitions: int - def __init__( - self, - zone: _Optional[str] = ..., - instances: _Optional[int] = ..., - partitions: _Optional[int] = ..., - ) -> None: ... - -class ListZonesRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class ListZonesResponse(_message.Message): - __slots__ = ("list",) - LIST_FIELD_NUMBER: _ClassVar[int] - list: _containers.RepeatedCompositeFieldContainer[ZoneSummary] - def __init__( - self, list: _Optional[_Iterable[_Union[ZoneSummary, _Mapping]]] = ... - ) -> None: ... diff --git a/src/ring/admin/v1/cluster_pb2_grpc.py b/src/ring/admin/v1/cluster_pb2_grpc.py deleted file mode 100644 index 009ee87e..00000000 --- a/src/ring/admin/v1/cluster_pb2_grpc.py +++ /dev/null @@ -1,304 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from ring.admin.v1 import cluster_pb2 as ring_dot_admin_dot_v1_dot_cluster__pb2 - - -class ClusterServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.DescribeInstances = channel.unary_unary( - "/ring.admin.v1.ClusterService/DescribeInstances", - request_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeInstancesRequest.SerializeToString, - response_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeInstancesResponse.FromString, - ) - self.DescribePartitions = channel.unary_unary( - "/ring.admin.v1.ClusterService/DescribePartitions", - request_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribePartitionsRequest.SerializeToString, - response_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribePartitionsResponse.FromString, - ) - self.DescribeZones = channel.unary_unary( - "/ring.admin.v1.ClusterService/DescribeZones", - request_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeZonesRequest.SerializeToString, - response_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeZonesResponse.FromString, - ) - self.ListInstances = channel.unary_unary( - "/ring.admin.v1.ClusterService/ListInstances", - request_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListInstancesRequest.SerializeToString, - response_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListInstancesResponse.FromString, - ) - self.ListPartitions = channel.unary_unary( - "/ring.admin.v1.ClusterService/ListPartitions", - request_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListPartitionsRequest.SerializeToString, - response_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListPartitionsResponse.FromString, - ) - self.ListZones = channel.unary_unary( - "/ring.admin.v1.ClusterService/ListZones", - request_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListZonesRequest.SerializeToString, - response_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListZonesResponse.FromString, - ) - - -class ClusterServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def DescribeInstances(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DescribePartitions(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DescribeZones(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListInstances(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListPartitions(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListZones(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ClusterServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "DescribeInstances": grpc.unary_unary_rpc_method_handler( - servicer.DescribeInstances, - request_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeInstancesRequest.FromString, - response_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeInstancesResponse.SerializeToString, - ), - "DescribePartitions": grpc.unary_unary_rpc_method_handler( - servicer.DescribePartitions, - request_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribePartitionsRequest.FromString, - response_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribePartitionsResponse.SerializeToString, - ), - "DescribeZones": grpc.unary_unary_rpc_method_handler( - servicer.DescribeZones, - request_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeZonesRequest.FromString, - response_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeZonesResponse.SerializeToString, - ), - "ListInstances": grpc.unary_unary_rpc_method_handler( - servicer.ListInstances, - request_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListInstancesRequest.FromString, - response_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListInstancesResponse.SerializeToString, - ), - "ListPartitions": grpc.unary_unary_rpc_method_handler( - servicer.ListPartitions, - request_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListPartitionsRequest.FromString, - response_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListPartitionsResponse.SerializeToString, - ), - "ListZones": grpc.unary_unary_rpc_method_handler( - servicer.ListZones, - request_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListZonesRequest.FromString, - response_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListZonesResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "ring.admin.v1.ClusterService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) - - -# This class is part of an EXPERIMENTAL API. -class ClusterService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def DescribeInstances( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/ring.admin.v1.ClusterService/DescribeInstances", - ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeInstancesRequest.SerializeToString, - ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeInstancesResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) - - @staticmethod - def DescribePartitions( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/ring.admin.v1.ClusterService/DescribePartitions", - ring_dot_admin_dot_v1_dot_cluster__pb2.DescribePartitionsRequest.SerializeToString, - ring_dot_admin_dot_v1_dot_cluster__pb2.DescribePartitionsResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) - - @staticmethod - def DescribeZones( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/ring.admin.v1.ClusterService/DescribeZones", - ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeZonesRequest.SerializeToString, - ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeZonesResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) - - @staticmethod - def ListInstances( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/ring.admin.v1.ClusterService/ListInstances", - ring_dot_admin_dot_v1_dot_cluster__pb2.ListInstancesRequest.SerializeToString, - ring_dot_admin_dot_v1_dot_cluster__pb2.ListInstancesResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) - - @staticmethod - def ListPartitions( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/ring.admin.v1.ClusterService/ListPartitions", - ring_dot_admin_dot_v1_dot_cluster__pb2.ListPartitionsRequest.SerializeToString, - ring_dot_admin_dot_v1_dot_cluster__pb2.ListPartitionsResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) - - @staticmethod - def ListZones( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/ring.admin.v1.ClusterService/ListZones", - ring_dot_admin_dot_v1_dot_cluster__pb2.ListZonesRequest.SerializeToString, - ring_dot_admin_dot_v1_dot_cluster__pb2.ListZonesResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) diff --git a/src/ring/admin/v1/member_pb2.py b/src/ring/admin/v1/member_pb2.py deleted file mode 100644 index 1c3f0de0..00000000 --- a/src/ring/admin/v1/member_pb2.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ring/admin/v1/member.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x1aring/admin/v1/member.proto\x12\rring.admin.v1\x1a\x1fgoogle/protobuf/timestamp.proto"\xb5\x02\n\x0bMemberState\x12\x41\n\tinstances\x18\x01 \x03(\x0b\x32#.ring.admin.v1.MemberState.InstanceR\tinstances\x12\x44\n\npartitions\x18\x02 \x03(\x0b\x32$.ring.admin.v1.MemberState.PartitionR\npartitions\x1aH\n\x08Instance\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12,\n\x03ttl\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x03ttl\x1aS\n\tPartition\x12\x16\n\x06number\x18\x01 \x01(\x05R\x06number\x12\x14\n\x05owner\x18\x02 \x01(\tR\x05owner\x12\x18\n\x07\x63reator\x18\x03 \x01(\tR\x07\x63reator"\x14\n\x12MemberStateRequest"G\n\x13MemberStateResponse\x12\x30\n\x05state\x18\x01 \x01(\x0b\x32\x1a.ring.admin.v1.MemberStateR\x05state2j\n\rMemberService\x12Y\n\x0bMemberState\x12!.ring.admin.v1.MemberStateRequest\x1a".ring.admin.v1.MemberStateResponse"\x03\x90\x02\x01\x42v\n\x11\x63om.ring.admin.v1B\x0bMemberProtoP\x01\xa2\x02\x03RAX\xaa\x02\rRing.Admin.V1\xca\x02\rRing\\Admin\\V1\xe2\x02\x19Ring\\Admin\\V1\\GPBMetadata\xea\x02\x0fRing::Admin::V1b\x06proto3' -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages( - DESCRIPTOR, "ring.admin.v1.member_pb2", _globals -) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\021com.ring.admin.v1B\013MemberProtoP\001\242\002\003RAX\252\002\rRing.Admin.V1\312\002\rRing\\Admin\\V1\342\002\031Ring\\Admin\\V1\\GPBMetadata\352\002\017Ring::Admin::V1" - ) - _globals["_MEMBERSERVICE"].methods_by_name["MemberState"]._options = None - _globals["_MEMBERSERVICE"].methods_by_name[ - "MemberState" - ]._serialized_options = b"\220\002\001" - _globals["_MEMBERSTATE"]._serialized_start = 79 - _globals["_MEMBERSTATE"]._serialized_end = 388 - _globals["_MEMBERSTATE_INSTANCE"]._serialized_start = 231 - _globals["_MEMBERSTATE_INSTANCE"]._serialized_end = 303 - _globals["_MEMBERSTATE_PARTITION"]._serialized_start = 305 - _globals["_MEMBERSTATE_PARTITION"]._serialized_end = 388 - _globals["_MEMBERSTATEREQUEST"]._serialized_start = 390 - _globals["_MEMBERSTATEREQUEST"]._serialized_end = 410 - _globals["_MEMBERSTATERESPONSE"]._serialized_start = 412 - _globals["_MEMBERSTATERESPONSE"]._serialized_end = 483 - _globals["_MEMBERSERVICE"]._serialized_start = 485 - _globals["_MEMBERSERVICE"]._serialized_end = 591 -# @@protoc_insertion_point(module_scope) diff --git a/src/ring/admin/v1/member_pb2.pyi b/src/ring/admin/v1/member_pb2.pyi deleted file mode 100644 index d48e144d..00000000 --- a/src/ring/admin/v1/member_pb2.pyi +++ /dev/null @@ -1,65 +0,0 @@ -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) - -DESCRIPTOR: _descriptor.FileDescriptor - -class MemberState(_message.Message): - __slots__ = ("instances", "partitions") - - class Instance(_message.Message): - __slots__ = ("id", "ttl") - ID_FIELD_NUMBER: _ClassVar[int] - TTL_FIELD_NUMBER: _ClassVar[int] - id: str - ttl: _timestamp_pb2.Timestamp - def __init__( - self, - id: _Optional[str] = ..., - ttl: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - ) -> None: ... - - class Partition(_message.Message): - __slots__ = ("number", "owner", "creator") - NUMBER_FIELD_NUMBER: _ClassVar[int] - OWNER_FIELD_NUMBER: _ClassVar[int] - CREATOR_FIELD_NUMBER: _ClassVar[int] - number: int - owner: str - creator: str - def __init__( - self, - number: _Optional[int] = ..., - owner: _Optional[str] = ..., - creator: _Optional[str] = ..., - ) -> None: ... - - INSTANCES_FIELD_NUMBER: _ClassVar[int] - PARTITIONS_FIELD_NUMBER: _ClassVar[int] - instances: _containers.RepeatedCompositeFieldContainer[MemberState.Instance] - partitions: _containers.RepeatedCompositeFieldContainer[MemberState.Partition] - def __init__( - self, - instances: _Optional[_Iterable[_Union[MemberState.Instance, _Mapping]]] = ..., - partitions: _Optional[_Iterable[_Union[MemberState.Partition, _Mapping]]] = ..., - ) -> None: ... - -class MemberStateRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class MemberStateResponse(_message.Message): - __slots__ = ("state",) - STATE_FIELD_NUMBER: _ClassVar[int] - state: MemberState - def __init__( - self, state: _Optional[_Union[MemberState, _Mapping]] = ... - ) -> None: ... diff --git a/src/ring/admin/v1/member_pb2_grpc.py b/src/ring/admin/v1/member_pb2_grpc.py deleted file mode 100644 index 11038de8..00000000 --- a/src/ring/admin/v1/member_pb2_grpc.py +++ /dev/null @@ -1,79 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from ring.admin.v1 import member_pb2 as ring_dot_admin_dot_v1_dot_member__pb2 - - -class MemberServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.MemberState = channel.unary_unary( - "/ring.admin.v1.MemberService/MemberState", - request_serializer=ring_dot_admin_dot_v1_dot_member__pb2.MemberStateRequest.SerializeToString, - response_deserializer=ring_dot_admin_dot_v1_dot_member__pb2.MemberStateResponse.FromString, - ) - - -class MemberServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def MemberState(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_MemberServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "MemberState": grpc.unary_unary_rpc_method_handler( - servicer.MemberState, - request_deserializer=ring_dot_admin_dot_v1_dot_member__pb2.MemberStateRequest.FromString, - response_serializer=ring_dot_admin_dot_v1_dot_member__pb2.MemberStateResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "ring.admin.v1.MemberService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) - - -# This class is part of an EXPERIMENTAL API. -class MemberService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def MemberState( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/ring.admin.v1.MemberService/MemberState", - ring_dot_admin_dot_v1_dot_member__pb2.MemberStateRequest.SerializeToString, - ring_dot_admin_dot_v1_dot_member__pb2.MemberStateResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) diff --git a/src/ring/coroutine/v1/coroutine_pb2.py b/src/ring/coroutine/v1/coroutine_pb2.py deleted file mode 100644 index 351cc365..00000000 --- a/src/ring/coroutine/v1/coroutine_pb2.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ring/coroutine/v1/coroutine.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from ring.status.v1 import status_pb2 as ring_dot_status_dot_v1_dot_status__pb2 -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n!ring/coroutine/v1/coroutine.proto\x12\x11ring.coroutine.v1\x1a\x1bring/status/v1/status.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto"\xa6\x02\n\x0e\x45xecuteRequest\x12#\n\rcoroutine_uri\x18\x01 \x01(\tR\x0c\x63oroutineUri\x12+\n\x11\x63oroutine_version\x18\x02 \x01(\tR\x10\x63oroutineVersion\x12,\n\x05input\x18\x03 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00R\x05input\x12\x46\n\rpoll_response\x18\x04 \x01(\x0b\x32\x1f.ring.coroutine.v1.PollResponseH\x00R\x0cpollResponse\x12+\n\x0fsigning_key_urn\x18\x05 \x01(\tH\x01R\rsigningKeyUrn\x88\x01\x01\x42\x0b\n\tcoroutineB\x12\n\x10_signing_key_urn"\xfe\x01\n\x0f\x45xecuteResponse\x12#\n\rcoroutine_uri\x18\x01 \x01(\tR\x0c\x63oroutineUri\x12+\n\x11\x63oroutine_version\x18\x02 \x01(\tR\x10\x63oroutineVersion\x12.\n\x06status\x18\x03 \x01(\x0e\x32\x16.ring.status.v1.StatusR\x06status\x12-\n\x04\x65xit\x18\x04 \x01(\x0b\x32\x17.ring.coroutine.v1.ExitH\x00R\x04\x65xit\x12-\n\x04poll\x18\x05 \x01(\x0b\x32\x17.ring.coroutine.v1.PollH\x00R\x04pollB\x0b\n\tdirective"o\n\x04\x45xit\x12\x31\n\x06result\x18\x01 \x01(\x0b\x32\x19.ring.coroutine.v1.ResultR\x06result\x12\x34\n\ttail_call\x18\x02 \x01(\x0b\x32\x17.ring.coroutine.v1.CallR\x08tailCall"f\n\x06Result\x12,\n\x06output\x18\x03 \x01(\x0b\x32\x14.google.protobuf.AnyR\x06output\x12.\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x18.ring.coroutine.v1.ErrorR\x05\x65rror"5\n\x05\x45rror\x12\x12\n\x04type\x18\x01 \x01(\tR\x04type\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message"\xa2\x01\n\x04Poll\x12\x14\n\x05state\x18\x01 \x01(\x0cR\x05state\x12-\n\x05\x63\x61lls\x18\x02 \x03(\x0b\x32\x17.ring.coroutine.v1.CallR\x05\x63\x61lls\x12\x34\n\x08max_wait\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationR\x07maxWait\x12\x1f\n\x0bmax_results\x18\x04 \x01(\x05R\nmaxResults"]\n\x0cPollResponse\x12\x14\n\x05state\x18\x01 \x01(\x0cR\x05state\x12\x37\n\x07results\x18\x02 \x03(\x0b\x32\x1d.ring.coroutine.v1.CallResultR\x07results"\xab\x01\n\x04\x43\x61ll\x12#\n\rcoroutine_uri\x18\x01 \x01(\tR\x0c\x63oroutineUri\x12+\n\x11\x63oroutine_version\x18\x02 \x01(\tR\x10\x63oroutineVersion\x12%\n\x0e\x63orrelation_id\x18\x03 \x01(\x04R\rcorrelationId\x12*\n\x05input\x18\x04 \x01(\x0b\x32\x14.google.protobuf.AnyR\x05input"\xb8\x01\n\nCallResult\x12#\n\rcoroutine_uri\x18\x01 \x01(\tR\x0c\x63oroutineUri\x12+\n\x11\x63oroutine_version\x18\x02 \x01(\tR\x10\x63oroutineVersion\x12%\n\x0e\x63orrelation_id\x18\x03 \x01(\x04R\rcorrelationId\x12\x31\n\x06result\x18\x04 \x01(\x0b\x32\x19.ring.coroutine.v1.ResultR\x06result2c\n\x0f\x45xecutorService\x12P\n\x07\x45xecute\x12!.ring.coroutine.v1.ExecuteRequest\x1a".ring.coroutine.v1.ExecuteResponseB\x8d\x01\n\x15\x63om.ring.coroutine.v1B\x0e\x43oroutineProtoP\x01\xa2\x02\x03RCX\xaa\x02\x11Ring.Coroutine.V1\xca\x02\x11Ring\\Coroutine\\V1\xe2\x02\x1dRing\\Coroutine\\V1\\GPBMetadata\xea\x02\x13Ring::Coroutine::V1b\x06proto3' -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages( - DESCRIPTOR, "ring.coroutine.v1.coroutine_pb2", _globals -) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\025com.ring.coroutine.v1B\016CoroutineProtoP\001\242\002\003RCX\252\002\021Ring.Coroutine.V1\312\002\021Ring\\Coroutine\\V1\342\002\035Ring\\Coroutine\\V1\\GPBMetadata\352\002\023Ring::Coroutine::V1" - ) - _globals["_EXECUTEREQUEST"]._serialized_start = 145 - _globals["_EXECUTEREQUEST"]._serialized_end = 439 - _globals["_EXECUTERESPONSE"]._serialized_start = 442 - _globals["_EXECUTERESPONSE"]._serialized_end = 696 - _globals["_EXIT"]._serialized_start = 698 - _globals["_EXIT"]._serialized_end = 809 - _globals["_RESULT"]._serialized_start = 811 - _globals["_RESULT"]._serialized_end = 913 - _globals["_ERROR"]._serialized_start = 915 - _globals["_ERROR"]._serialized_end = 968 - _globals["_POLL"]._serialized_start = 971 - _globals["_POLL"]._serialized_end = 1133 - _globals["_POLLRESPONSE"]._serialized_start = 1135 - _globals["_POLLRESPONSE"]._serialized_end = 1228 - _globals["_CALL"]._serialized_start = 1231 - _globals["_CALL"]._serialized_end = 1402 - _globals["_CALLRESULT"]._serialized_start = 1405 - _globals["_CALLRESULT"]._serialized_end = 1589 - _globals["_EXECUTORSERVICE"]._serialized_start = 1591 - _globals["_EXECUTORSERVICE"]._serialized_end = 1690 -# @@protoc_insertion_point(module_scope) diff --git a/src/ring/http/v1/http_pb2.py b/src/ring/http/v1/http_pb2.py deleted file mode 100644 index 75669ae3..00000000 --- a/src/ring/http/v1/http_pb2.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ring/http/v1/http.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x17ring/http/v1/http.proto\x12\x0cring.http.v1"u\n\x07Request\x12\x16\n\x06method\x18\x01 \x01(\tR\x06method\x12\x10\n\x03url\x18\x02 \x01(\tR\x03url\x12,\n\x06header\x18\x04 \x03(\x0b\x32\x14.ring.http.v1.HeaderR\x06header\x12\x12\n\x04\x62ody\x18\x03 \x01(\x0cR\x04\x62ody"m\n\x08Response\x12\x1f\n\x0bstatus_code\x18\x01 \x01(\x05R\nstatusCode\x12,\n\x06header\x18\x02 \x03(\x0b\x32\x14.ring.http.v1.HeaderR\x06header\x12\x12\n\x04\x62ody\x18\x03 \x01(\x0cR\x04\x62ody"2\n\x06Header\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05valueBo\n\x10\x63om.ring.http.v1B\tHttpProtoP\x01\xa2\x02\x03RHX\xaa\x02\x0cRing.Http.V1\xca\x02\x0cRing\\Http\\V1\xe2\x02\x18Ring\\Http\\V1\\GPBMetadata\xea\x02\x0eRing::Http::V1b\x06proto3' -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "ring.http.v1.http_pb2", _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\020com.ring.http.v1B\tHttpProtoP\001\242\002\003RHX\252\002\014Ring.Http.V1\312\002\014Ring\\Http\\V1\342\002\030Ring\\Http\\V1\\GPBMetadata\352\002\016Ring::Http::V1" - ) - _globals["_REQUEST"]._serialized_start = 41 - _globals["_REQUEST"]._serialized_end = 158 - _globals["_RESPONSE"]._serialized_start = 160 - _globals["_RESPONSE"]._serialized_end = 269 - _globals["_HEADER"]._serialized_start = 271 - _globals["_HEADER"]._serialized_end = 321 -# @@protoc_insertion_point(module_scope) diff --git a/src/ring/http/v1/http_pb2.pyi b/src/ring/http/v1/http_pb2.pyi deleted file mode 100644 index 4e3cf48a..00000000 --- a/src/ring/http/v1/http_pb2.pyi +++ /dev/null @@ -1,55 +0,0 @@ -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) - -DESCRIPTOR: _descriptor.FileDescriptor - -class Request(_message.Message): - __slots__ = ("method", "url", "header", "body") - METHOD_FIELD_NUMBER: _ClassVar[int] - URL_FIELD_NUMBER: _ClassVar[int] - HEADER_FIELD_NUMBER: _ClassVar[int] - BODY_FIELD_NUMBER: _ClassVar[int] - method: str - url: str - header: _containers.RepeatedCompositeFieldContainer[Header] - body: bytes - def __init__( - self, - method: _Optional[str] = ..., - url: _Optional[str] = ..., - header: _Optional[_Iterable[_Union[Header, _Mapping]]] = ..., - body: _Optional[bytes] = ..., - ) -> None: ... - -class Response(_message.Message): - __slots__ = ("status_code", "header", "body") - STATUS_CODE_FIELD_NUMBER: _ClassVar[int] - HEADER_FIELD_NUMBER: _ClassVar[int] - BODY_FIELD_NUMBER: _ClassVar[int] - status_code: int - header: _containers.RepeatedCompositeFieldContainer[Header] - body: bytes - def __init__( - self, - status_code: _Optional[int] = ..., - header: _Optional[_Iterable[_Union[Header, _Mapping]]] = ..., - body: _Optional[bytes] = ..., - ) -> None: ... - -class Header(_message.Message): - __slots__ = ("name", "value") - NAME_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - name: str - value: str - def __init__( - self, name: _Optional[str] = ..., value: _Optional[str] = ... - ) -> None: ... diff --git a/src/ring/http/v1/http_pb2_grpc.py b/src/ring/http/v1/http_pb2_grpc.py deleted file mode 100644 index 8a939394..00000000 --- a/src/ring/http/v1/http_pb2_grpc.py +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc diff --git a/src/ring/record/v1/record_pb2.py b/src/ring/record/v1/record_pb2.py deleted file mode 100644 index 4cb231ae..00000000 --- a/src/ring/record/v1/record_pb2.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ring/record/v1/record.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x1bring/record/v1/record.proto\x12\x0ering.record.v1\x1a\x19google/protobuf/any.proto\x1a\x1fgoogle/protobuf/timestamp.proto"9\n\x05\x42lock\x12\x30\n\x07records\x18\x01 \x03(\x0b\x32\x16.ring.record.v1.RecordR\x07records"u\n\x06Record\x12.\n\x07message\x18\x01 \x01(\x0b\x32\x14.google.protobuf.AnyR\x07message\x12%\n\x0e\x63rc32_checksum\x18\x02 \x01(\x07R\rcrc32Checksum\x12\x14\n\x05\x66lags\x18\x03 \x01(\rR\x05\x66lags"\x90\x01\n\x02ID\x12)\n\x10partition_number\x18\x01 \x01(\x05R\x0fpartitionNumber\x12\x19\n\x08\x62lock_id\x18\x02 \x01(\x05R\x07\x62lockId\x12#\n\rrecord_offset\x18\x03 \x01(\x05R\x0crecordOffset\x12\x1f\n\x0brecord_size\x18\x04 \x01(\x05R\nrecordSize"N\n\x06Prefix\x12)\n\x10partition_number\x18\x01 \x01(\x05R\x0fpartitionNumber\x12\x19\n\x08\x62lock_id\x18\x02 \x01(\x05R\x07\x62lockId"\xae\x01\n\x05Range\x12)\n\x10partition_number\x18\x01 \x01(\x05R\x0fpartitionNumber\x12\x19\n\x08\x62lock_id\x18\x02 \x01(\x05R\x07\x62lockId\x12!\n\x0crange_offset\x18\x03 \x01(\x05R\x0brangeOffset\x12\x1d\n\nrange_size\x18\x04 \x01(\x05R\trangeSize\x12\x1d\n\nfull_block\x18\x05 \x01(\x08R\tfullBlock"!\n\x05\x45rror\x12\x18\n\x07message\x18\x01 \x01(\tR\x07message"\x8a\x01\n\x12\x42lockTriggerRecord\x12.\n\x07message\x18\x01 \x01(\x0b\x32\x14.google.protobuf.AnyR\x07message\x12#\n\rrecord_offset\x18\x02 \x01(\x05R\x0crecordOffset\x12\x1f\n\x0brecord_size\x18\x03 \x01(\x05R\nrecordSize"\x83\x01\n\x13\x42lockTriggerRequest\x12.\n\x06prefix\x18\x01 \x01(\x0b\x32\x16.ring.record.v1.PrefixR\x06prefix\x12<\n\x07records\x18\x02 \x03(\x0b\x32".ring.record.v1.BlockTriggerRecordR\x07records"\x16\n\x14\x42lockTriggerResponse"\xa0\x01\n\nBlockRange\x12.\n\x06prefix\x18\x01 \x01(\x0b\x32\x16.ring.record.v1.PrefixR\x06prefix\x12\x35\n\x07records\x18\x02 \x03(\x0b\x32\x1b.ring.record.v1.BlockRecordR\x07records\x12+\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x15.ring.record.v1.ErrorR\x05\x65rror"\x83\x01\n\x0b\x42lockRecord\x12#\n\rrecord_offset\x18\x01 \x01(\x05R\x0crecordOffset\x12\x1f\n\x0brecord_size\x18\x02 \x01(\x05R\nrecordSize\x12.\n\x06record\x18\x03 \x01(\x0b\x32\x16.ring.record.v1.RecordR\x06record"\xd9\x01\n\nBlockEntry\x12)\n\x10partition_number\x18\x01 \x01(\x05R\x0fpartitionNumber\x12\x19\n\x08\x62lock_id\x18\x02 \x01(\x05R\x07\x62lockId\x12\x1d\n\nblock_size\x18\x03 \x01(\x05R\tblockSize\x12\x39\n\ncreated_at\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12+\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x15.ring.record.v1.ErrorR\x05\x65rror"F\n\x15GetBlockRangesRequest\x12-\n\x06ranges\x18\x01 \x03(\x0b\x32\x15.ring.record.v1.RangeR\x06ranges"L\n\x16GetBlockRangesResponse\x12\x32\n\x06ranges\x18\x01 \x03(\x0b\x32\x1a.ring.record.v1.BlockRangeR\x06ranges"M\n\x17GetBlockMetadataRequest\x12\x32\n\x08prefixes\x18\x01 \x03(\x0b\x32\x16.ring.record.v1.PrefixR\x08prefixes"P\n\x18GetBlockMetadataResponse\x12\x34\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x1a.ring.record.v1.BlockEntryR\x07\x65ntries"z\n\x11ScanBlocksRequest\x12)\n\x10partition_number\x18\x01 \x01(\x05R\x0fpartitionNumber\x12$\n\x0estart_block_id\x18\x02 \x01(\x05R\x0cstartBlockId\x12\x14\n\x05limit\x18\x03 \x01(\x05R\x05limit"\x89\x01\n\x12ScanBlocksResponse\x12\x19\n\x08\x62lock_id\x18\x01 \x01(\x05R\x07\x62lockId\x12\x1d\n\nblock_size\x18\x02 \x01(\x05R\tblockSize\x12\x39\n\ncreated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt2\xc1\x02\n\x11\x42lockStoreService\x12\x64\n\x0eGetBlockRanges\x12%.ring.record.v1.GetBlockRangesRequest\x1a&.ring.record.v1.GetBlockRangesResponse"\x03\x90\x02\x02\x12j\n\x10GetBlockMetadata\x12\'.ring.record.v1.GetBlockMetadataRequest\x1a(.ring.record.v1.GetBlockMetadataResponse"\x03\x90\x02\x02\x12Z\n\nScanBlocks\x12!.ring.record.v1.ScanBlocksRequest\x1a".ring.record.v1.ScanBlocksResponse"\x03\x90\x02\x01\x30\x01\x42{\n\x12\x63om.ring.record.v1B\x0bRecordProtoP\x01\xa2\x02\x03RRX\xaa\x02\x0eRing.Record.V1\xca\x02\x0eRing\\Record\\V1\xe2\x02\x1aRing\\Record\\V1\\GPBMetadata\xea\x02\x10Ring::Record::V1b\x06proto3' -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages( - DESCRIPTOR, "ring.record.v1.record_pb2", _globals -) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\022com.ring.record.v1B\013RecordProtoP\001\242\002\003RRX\252\002\016Ring.Record.V1\312\002\016Ring\\Record\\V1\342\002\032Ring\\Record\\V1\\GPBMetadata\352\002\020Ring::Record::V1" - ) - _globals["_BLOCKSTORESERVICE"].methods_by_name["GetBlockRanges"]._options = None - _globals["_BLOCKSTORESERVICE"].methods_by_name[ - "GetBlockRanges" - ]._serialized_options = b"\220\002\002" - _globals["_BLOCKSTORESERVICE"].methods_by_name["GetBlockMetadata"]._options = None - _globals["_BLOCKSTORESERVICE"].methods_by_name[ - "GetBlockMetadata" - ]._serialized_options = b"\220\002\002" - _globals["_BLOCKSTORESERVICE"].methods_by_name["ScanBlocks"]._options = None - _globals["_BLOCKSTORESERVICE"].methods_by_name[ - "ScanBlocks" - ]._serialized_options = b"\220\002\001" - _globals["_BLOCK"]._serialized_start = 107 - _globals["_BLOCK"]._serialized_end = 164 - _globals["_RECORD"]._serialized_start = 166 - _globals["_RECORD"]._serialized_end = 283 - _globals["_ID"]._serialized_start = 286 - _globals["_ID"]._serialized_end = 430 - _globals["_PREFIX"]._serialized_start = 432 - _globals["_PREFIX"]._serialized_end = 510 - _globals["_RANGE"]._serialized_start = 513 - _globals["_RANGE"]._serialized_end = 687 - _globals["_ERROR"]._serialized_start = 689 - _globals["_ERROR"]._serialized_end = 722 - _globals["_BLOCKTRIGGERRECORD"]._serialized_start = 725 - _globals["_BLOCKTRIGGERRECORD"]._serialized_end = 863 - _globals["_BLOCKTRIGGERREQUEST"]._serialized_start = 866 - _globals["_BLOCKTRIGGERREQUEST"]._serialized_end = 997 - _globals["_BLOCKTRIGGERRESPONSE"]._serialized_start = 999 - _globals["_BLOCKTRIGGERRESPONSE"]._serialized_end = 1021 - _globals["_BLOCKRANGE"]._serialized_start = 1024 - _globals["_BLOCKRANGE"]._serialized_end = 1184 - _globals["_BLOCKRECORD"]._serialized_start = 1187 - _globals["_BLOCKRECORD"]._serialized_end = 1318 - _globals["_BLOCKENTRY"]._serialized_start = 1321 - _globals["_BLOCKENTRY"]._serialized_end = 1538 - _globals["_GETBLOCKRANGESREQUEST"]._serialized_start = 1540 - _globals["_GETBLOCKRANGESREQUEST"]._serialized_end = 1610 - _globals["_GETBLOCKRANGESRESPONSE"]._serialized_start = 1612 - _globals["_GETBLOCKRANGESRESPONSE"]._serialized_end = 1688 - _globals["_GETBLOCKMETADATAREQUEST"]._serialized_start = 1690 - _globals["_GETBLOCKMETADATAREQUEST"]._serialized_end = 1767 - _globals["_GETBLOCKMETADATARESPONSE"]._serialized_start = 1769 - _globals["_GETBLOCKMETADATARESPONSE"]._serialized_end = 1849 - _globals["_SCANBLOCKSREQUEST"]._serialized_start = 1851 - _globals["_SCANBLOCKSREQUEST"]._serialized_end = 1973 - _globals["_SCANBLOCKSRESPONSE"]._serialized_start = 1976 - _globals["_SCANBLOCKSRESPONSE"]._serialized_end = 2113 - _globals["_BLOCKSTORESERVICE"]._serialized_start = 2116 - _globals["_BLOCKSTORESERVICE"]._serialized_end = 2437 -# @@protoc_insertion_point(module_scope) diff --git a/src/ring/record/v1/record_pb2.pyi b/src/ring/record/v1/record_pb2.pyi deleted file mode 100644 index db7558ed..00000000 --- a/src/ring/record/v1/record_pb2.pyi +++ /dev/null @@ -1,242 +0,0 @@ -from google.protobuf import any_pb2 as _any_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) - -DESCRIPTOR: _descriptor.FileDescriptor - -class Block(_message.Message): - __slots__ = ("records",) - RECORDS_FIELD_NUMBER: _ClassVar[int] - records: _containers.RepeatedCompositeFieldContainer[Record] - def __init__( - self, records: _Optional[_Iterable[_Union[Record, _Mapping]]] = ... - ) -> None: ... - -class Record(_message.Message): - __slots__ = ("message", "crc32_checksum", "flags") - MESSAGE_FIELD_NUMBER: _ClassVar[int] - CRC32_CHECKSUM_FIELD_NUMBER: _ClassVar[int] - FLAGS_FIELD_NUMBER: _ClassVar[int] - message: _any_pb2.Any - crc32_checksum: int - flags: int - def __init__( - self, - message: _Optional[_Union[_any_pb2.Any, _Mapping]] = ..., - crc32_checksum: _Optional[int] = ..., - flags: _Optional[int] = ..., - ) -> None: ... - -class ID(_message.Message): - __slots__ = ("partition_number", "block_id", "record_offset", "record_size") - PARTITION_NUMBER_FIELD_NUMBER: _ClassVar[int] - BLOCK_ID_FIELD_NUMBER: _ClassVar[int] - RECORD_OFFSET_FIELD_NUMBER: _ClassVar[int] - RECORD_SIZE_FIELD_NUMBER: _ClassVar[int] - partition_number: int - block_id: int - record_offset: int - record_size: int - def __init__( - self, - partition_number: _Optional[int] = ..., - block_id: _Optional[int] = ..., - record_offset: _Optional[int] = ..., - record_size: _Optional[int] = ..., - ) -> None: ... - -class Prefix(_message.Message): - __slots__ = ("partition_number", "block_id") - PARTITION_NUMBER_FIELD_NUMBER: _ClassVar[int] - BLOCK_ID_FIELD_NUMBER: _ClassVar[int] - partition_number: int - block_id: int - def __init__( - self, partition_number: _Optional[int] = ..., block_id: _Optional[int] = ... - ) -> None: ... - -class Range(_message.Message): - __slots__ = ( - "partition_number", - "block_id", - "range_offset", - "range_size", - "full_block", - ) - PARTITION_NUMBER_FIELD_NUMBER: _ClassVar[int] - BLOCK_ID_FIELD_NUMBER: _ClassVar[int] - RANGE_OFFSET_FIELD_NUMBER: _ClassVar[int] - RANGE_SIZE_FIELD_NUMBER: _ClassVar[int] - FULL_BLOCK_FIELD_NUMBER: _ClassVar[int] - partition_number: int - block_id: int - range_offset: int - range_size: int - full_block: bool - def __init__( - self, - partition_number: _Optional[int] = ..., - block_id: _Optional[int] = ..., - range_offset: _Optional[int] = ..., - range_size: _Optional[int] = ..., - full_block: bool = ..., - ) -> None: ... - -class Error(_message.Message): - __slots__ = ("message",) - MESSAGE_FIELD_NUMBER: _ClassVar[int] - message: str - def __init__(self, message: _Optional[str] = ...) -> None: ... - -class BlockTriggerRecord(_message.Message): - __slots__ = ("message", "record_offset", "record_size") - MESSAGE_FIELD_NUMBER: _ClassVar[int] - RECORD_OFFSET_FIELD_NUMBER: _ClassVar[int] - RECORD_SIZE_FIELD_NUMBER: _ClassVar[int] - message: _any_pb2.Any - record_offset: int - record_size: int - def __init__( - self, - message: _Optional[_Union[_any_pb2.Any, _Mapping]] = ..., - record_offset: _Optional[int] = ..., - record_size: _Optional[int] = ..., - ) -> None: ... - -class BlockTriggerRequest(_message.Message): - __slots__ = ("prefix", "records") - PREFIX_FIELD_NUMBER: _ClassVar[int] - RECORDS_FIELD_NUMBER: _ClassVar[int] - prefix: Prefix - records: _containers.RepeatedCompositeFieldContainer[BlockTriggerRecord] - def __init__( - self, - prefix: _Optional[_Union[Prefix, _Mapping]] = ..., - records: _Optional[_Iterable[_Union[BlockTriggerRecord, _Mapping]]] = ..., - ) -> None: ... - -class BlockTriggerResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class BlockRange(_message.Message): - __slots__ = ("prefix", "records", "error") - PREFIX_FIELD_NUMBER: _ClassVar[int] - RECORDS_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - prefix: Prefix - records: _containers.RepeatedCompositeFieldContainer[BlockRecord] - error: Error - def __init__( - self, - prefix: _Optional[_Union[Prefix, _Mapping]] = ..., - records: _Optional[_Iterable[_Union[BlockRecord, _Mapping]]] = ..., - error: _Optional[_Union[Error, _Mapping]] = ..., - ) -> None: ... - -class BlockRecord(_message.Message): - __slots__ = ("record_offset", "record_size", "record") - RECORD_OFFSET_FIELD_NUMBER: _ClassVar[int] - RECORD_SIZE_FIELD_NUMBER: _ClassVar[int] - RECORD_FIELD_NUMBER: _ClassVar[int] - record_offset: int - record_size: int - record: Record - def __init__( - self, - record_offset: _Optional[int] = ..., - record_size: _Optional[int] = ..., - record: _Optional[_Union[Record, _Mapping]] = ..., - ) -> None: ... - -class BlockEntry(_message.Message): - __slots__ = ("partition_number", "block_id", "block_size", "created_at", "error") - PARTITION_NUMBER_FIELD_NUMBER: _ClassVar[int] - BLOCK_ID_FIELD_NUMBER: _ClassVar[int] - BLOCK_SIZE_FIELD_NUMBER: _ClassVar[int] - CREATED_AT_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - partition_number: int - block_id: int - block_size: int - created_at: _timestamp_pb2.Timestamp - error: Error - def __init__( - self, - partition_number: _Optional[int] = ..., - block_id: _Optional[int] = ..., - block_size: _Optional[int] = ..., - created_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - error: _Optional[_Union[Error, _Mapping]] = ..., - ) -> None: ... - -class GetBlockRangesRequest(_message.Message): - __slots__ = ("ranges",) - RANGES_FIELD_NUMBER: _ClassVar[int] - ranges: _containers.RepeatedCompositeFieldContainer[Range] - def __init__( - self, ranges: _Optional[_Iterable[_Union[Range, _Mapping]]] = ... - ) -> None: ... - -class GetBlockRangesResponse(_message.Message): - __slots__ = ("ranges",) - RANGES_FIELD_NUMBER: _ClassVar[int] - ranges: _containers.RepeatedCompositeFieldContainer[BlockRange] - def __init__( - self, ranges: _Optional[_Iterable[_Union[BlockRange, _Mapping]]] = ... - ) -> None: ... - -class GetBlockMetadataRequest(_message.Message): - __slots__ = ("prefixes",) - PREFIXES_FIELD_NUMBER: _ClassVar[int] - prefixes: _containers.RepeatedCompositeFieldContainer[Prefix] - def __init__( - self, prefixes: _Optional[_Iterable[_Union[Prefix, _Mapping]]] = ... - ) -> None: ... - -class GetBlockMetadataResponse(_message.Message): - __slots__ = ("entries",) - ENTRIES_FIELD_NUMBER: _ClassVar[int] - entries: _containers.RepeatedCompositeFieldContainer[BlockEntry] - def __init__( - self, entries: _Optional[_Iterable[_Union[BlockEntry, _Mapping]]] = ... - ) -> None: ... - -class ScanBlocksRequest(_message.Message): - __slots__ = ("partition_number", "start_block_id", "limit") - PARTITION_NUMBER_FIELD_NUMBER: _ClassVar[int] - START_BLOCK_ID_FIELD_NUMBER: _ClassVar[int] - LIMIT_FIELD_NUMBER: _ClassVar[int] - partition_number: int - start_block_id: int - limit: int - def __init__( - self, - partition_number: _Optional[int] = ..., - start_block_id: _Optional[int] = ..., - limit: _Optional[int] = ..., - ) -> None: ... - -class ScanBlocksResponse(_message.Message): - __slots__ = ("block_id", "block_size", "created_at") - BLOCK_ID_FIELD_NUMBER: _ClassVar[int] - BLOCK_SIZE_FIELD_NUMBER: _ClassVar[int] - CREATED_AT_FIELD_NUMBER: _ClassVar[int] - block_id: int - block_size: int - created_at: _timestamp_pb2.Timestamp - def __init__( - self, - block_id: _Optional[int] = ..., - block_size: _Optional[int] = ..., - created_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - ) -> None: ... diff --git a/src/ring/record/v1/record_pb2_grpc.py b/src/ring/record/v1/record_pb2_grpc.py deleted file mode 100644 index a704a76c..00000000 --- a/src/ring/record/v1/record_pb2_grpc.py +++ /dev/null @@ -1,190 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from ring.record.v1 import record_pb2 as ring_dot_record_dot_v1_dot_record__pb2 - - -class BlockStoreServiceStub(object): - """BlockStoreService is a service that provides access to record blocks stored - by Ring instances. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.GetBlockRanges = channel.unary_unary( - "/ring.record.v1.BlockStoreService/GetBlockRanges", - request_serializer=ring_dot_record_dot_v1_dot_record__pb2.GetBlockRangesRequest.SerializeToString, - response_deserializer=ring_dot_record_dot_v1_dot_record__pb2.GetBlockRangesResponse.FromString, - ) - self.GetBlockMetadata = channel.unary_unary( - "/ring.record.v1.BlockStoreService/GetBlockMetadata", - request_serializer=ring_dot_record_dot_v1_dot_record__pb2.GetBlockMetadataRequest.SerializeToString, - response_deserializer=ring_dot_record_dot_v1_dot_record__pb2.GetBlockMetadataResponse.FromString, - ) - self.ScanBlocks = channel.unary_stream( - "/ring.record.v1.BlockStoreService/ScanBlocks", - request_serializer=ring_dot_record_dot_v1_dot_record__pb2.ScanBlocksRequest.SerializeToString, - response_deserializer=ring_dot_record_dot_v1_dot_record__pb2.ScanBlocksResponse.FromString, - ) - - -class BlockStoreServiceServicer(object): - """BlockStoreService is a service that provides access to record blocks stored - by Ring instances. - """ - - def GetBlockRanges(self, request, context): - """GetBlockRanges queries ranges of record blocks. - - The method allows querying multiple ranges, and returns one block range - for each range that was queried. If one of the requested ranges could not - be read, the corresponding block range will contain an error. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetBlockMetadata(self, request, context): - """GetBlockMetadata queries metadata about record blocks. - - The method allows querying multiple prefixes, and returns one block entry - for each prefix that was queried. If one of the requested prefixes could - not be read, the corresponding block entry will contain an error. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ScanBlocks(self, request, context): - """ScanBlocks scans blocks of records for a given partition, returning a - stream of ScanBlocksResponse messages. - - The request can set a limit to the number of block entries returned in the - response. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_BlockStoreServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "GetBlockRanges": grpc.unary_unary_rpc_method_handler( - servicer.GetBlockRanges, - request_deserializer=ring_dot_record_dot_v1_dot_record__pb2.GetBlockRangesRequest.FromString, - response_serializer=ring_dot_record_dot_v1_dot_record__pb2.GetBlockRangesResponse.SerializeToString, - ), - "GetBlockMetadata": grpc.unary_unary_rpc_method_handler( - servicer.GetBlockMetadata, - request_deserializer=ring_dot_record_dot_v1_dot_record__pb2.GetBlockMetadataRequest.FromString, - response_serializer=ring_dot_record_dot_v1_dot_record__pb2.GetBlockMetadataResponse.SerializeToString, - ), - "ScanBlocks": grpc.unary_stream_rpc_method_handler( - servicer.ScanBlocks, - request_deserializer=ring_dot_record_dot_v1_dot_record__pb2.ScanBlocksRequest.FromString, - response_serializer=ring_dot_record_dot_v1_dot_record__pb2.ScanBlocksResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "ring.record.v1.BlockStoreService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) - - -# This class is part of an EXPERIMENTAL API. -class BlockStoreService(object): - """BlockStoreService is a service that provides access to record blocks stored - by Ring instances. - """ - - @staticmethod - def GetBlockRanges( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/ring.record.v1.BlockStoreService/GetBlockRanges", - ring_dot_record_dot_v1_dot_record__pb2.GetBlockRangesRequest.SerializeToString, - ring_dot_record_dot_v1_dot_record__pb2.GetBlockRangesResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) - - @staticmethod - def GetBlockMetadata( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/ring.record.v1.BlockStoreService/GetBlockMetadata", - ring_dot_record_dot_v1_dot_record__pb2.GetBlockMetadataRequest.SerializeToString, - ring_dot_record_dot_v1_dot_record__pb2.GetBlockMetadataResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) - - @staticmethod - def ScanBlocks( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_stream( - request, - target, - "/ring.record.v1.BlockStoreService/ScanBlocks", - ring_dot_record_dot_v1_dot_record__pb2.ScanBlocksRequest.SerializeToString, - ring_dot_record_dot_v1_dot_record__pb2.ScanBlocksResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) diff --git a/src/ring/snapshot/v1/snapshot_pb2.py b/src/ring/snapshot/v1/snapshot_pb2.py deleted file mode 100644 index 7ec86acf..00000000 --- a/src/ring/snapshot/v1/snapshot_pb2.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ring/snapshot/v1/snapshot.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from ring.record.v1 import record_pb2 as ring_dot_record_dot_v1_dot_record__pb2 -from ring.status.v1 import status_pb2 as ring_dot_status_dot_v1_dot_status__pb2 -from ring.task.v1 import config_pb2 as ring_dot_task_dot_v1_dot_config__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x1fring/snapshot/v1/snapshot.proto\x12\x10ring.snapshot.v1\x1a\x1bring/record/v1/record.proto\x1a\x1bring/status/v1/status.proto\x1a\x19ring/task/v1/config.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\\\n\x08Snapshot\x12,\n\x05tasks\x18\x01 \x03(\x0b\x32\x16.ring.snapshot.v1.TaskR\x05tasks\x12"\n\rnext_block_id\x18\x02 \x01(\x04R\x0bnextBlockId"\x9c\x04\n\x04Task\x12\x37\n\rsubmission_id\x18\x01 \x01(\x0b\x32\x12.ring.record.v1.IDR\x0csubmissionId\x12\x37\n\rsuspension_id\x18\x02 \x01(\x0b\x32\x12.ring.record.v1.IDR\x0csuspensionId\x12\x37\n\rcompletion_id\x18\x03 \x01(\x0b\x32\x12.ring.record.v1.IDR\x0c\x63ompletionId\x12,\n\x06\x63onfig\x18\x04 \x01(\x0b\x32\x14.ring.task.v1.ConfigR\x06\x63onfig\x12\x14\n\x05\x66lags\x18\x05 \x01(\rR\x05\x66lags\x12#\n\rcoroutine_uri\x18\x06 \x01(\tR\x0c\x63oroutineUri\x12+\n\x07task_id\x18\x07 \x01(\x0b\x32\x12.ring.record.v1.IDR\x06taskId\x12.\n\x06status\x18\x08 \x01(\x0e\x32\x16.ring.status.v1.StatusR\x06status\x12\x38\n\x0eparent_task_id\x18\t \x01(\x0b\x32\x12.ring.record.v1.IDR\x0cparentTaskId\x12?\n\rpoll_deadline\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0cpollDeadline\x12(\n\x10poll_max_results\x18\x0b \x01(\x05R\x0epollMaxResultsB\x87\x01\n\x14\x63om.ring.snapshot.v1B\rSnapshotProtoP\x01\xa2\x02\x03RSX\xaa\x02\x10Ring.Snapshot.V1\xca\x02\x10Ring\\Snapshot\\V1\xe2\x02\x1cRing\\Snapshot\\V1\\GPBMetadata\xea\x02\x12Ring::Snapshot::V1b\x06proto3' -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages( - DESCRIPTOR, "ring.snapshot.v1.snapshot_pb2", _globals -) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\024com.ring.snapshot.v1B\rSnapshotProtoP\001\242\002\003RSX\252\002\020Ring.Snapshot.V1\312\002\020Ring\\Snapshot\\V1\342\002\034Ring\\Snapshot\\V1\\GPBMetadata\352\002\022Ring::Snapshot::V1" - ) - _globals["_SNAPSHOT"]._serialized_start = 171 - _globals["_SNAPSHOT"]._serialized_end = 263 - _globals["_TASK"]._serialized_start = 266 - _globals["_TASK"]._serialized_end = 806 -# @@protoc_insertion_point(module_scope) diff --git a/src/ring/snapshot/v1/snapshot_pb2.pyi b/src/ring/snapshot/v1/snapshot_pb2.pyi deleted file mode 100644 index 06f1df0c..00000000 --- a/src/ring/snapshot/v1/snapshot_pb2.pyi +++ /dev/null @@ -1,79 +0,0 @@ -from ring.record.v1 import record_pb2 as _record_pb2 -from ring.status.v1 import status_pb2 as _status_pb2 -from ring.task.v1 import config_pb2 as _config_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) - -DESCRIPTOR: _descriptor.FileDescriptor - -class Snapshot(_message.Message): - __slots__ = ("tasks", "next_block_id") - TASKS_FIELD_NUMBER: _ClassVar[int] - NEXT_BLOCK_ID_FIELD_NUMBER: _ClassVar[int] - tasks: _containers.RepeatedCompositeFieldContainer[Task] - next_block_id: int - def __init__( - self, - tasks: _Optional[_Iterable[_Union[Task, _Mapping]]] = ..., - next_block_id: _Optional[int] = ..., - ) -> None: ... - -class Task(_message.Message): - __slots__ = ( - "submission_id", - "suspension_id", - "completion_id", - "config", - "flags", - "coroutine_uri", - "task_id", - "status", - "parent_task_id", - "poll_deadline", - "poll_max_results", - ) - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - SUSPENSION_ID_FIELD_NUMBER: _ClassVar[int] - COMPLETION_ID_FIELD_NUMBER: _ClassVar[int] - CONFIG_FIELD_NUMBER: _ClassVar[int] - FLAGS_FIELD_NUMBER: _ClassVar[int] - COROUTINE_URI_FIELD_NUMBER: _ClassVar[int] - TASK_ID_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - PARENT_TASK_ID_FIELD_NUMBER: _ClassVar[int] - POLL_DEADLINE_FIELD_NUMBER: _ClassVar[int] - POLL_MAX_RESULTS_FIELD_NUMBER: _ClassVar[int] - submission_id: _record_pb2.ID - suspension_id: _record_pb2.ID - completion_id: _record_pb2.ID - config: _config_pb2.Config - flags: int - coroutine_uri: str - task_id: _record_pb2.ID - status: _status_pb2.Status - parent_task_id: _record_pb2.ID - poll_deadline: _timestamp_pb2.Timestamp - poll_max_results: int - def __init__( - self, - submission_id: _Optional[_Union[_record_pb2.ID, _Mapping]] = ..., - suspension_id: _Optional[_Union[_record_pb2.ID, _Mapping]] = ..., - completion_id: _Optional[_Union[_record_pb2.ID, _Mapping]] = ..., - config: _Optional[_Union[_config_pb2.Config, _Mapping]] = ..., - flags: _Optional[int] = ..., - coroutine_uri: _Optional[str] = ..., - task_id: _Optional[_Union[_record_pb2.ID, _Mapping]] = ..., - status: _Optional[_Union[_status_pb2.Status, str]] = ..., - parent_task_id: _Optional[_Union[_record_pb2.ID, _Mapping]] = ..., - poll_deadline: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - poll_max_results: _Optional[int] = ..., - ) -> None: ... diff --git a/src/ring/snapshot/v1/snapshot_pb2_grpc.py b/src/ring/snapshot/v1/snapshot_pb2_grpc.py deleted file mode 100644 index 8a939394..00000000 --- a/src/ring/snapshot/v1/snapshot_pb2_grpc.py +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc diff --git a/src/ring/status/v1/status_pb2.py b/src/ring/status/v1/status_pb2.py deleted file mode 100644 index 4fa6d886..00000000 --- a/src/ring/status/v1/status_pb2.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ring/status/v1/status.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b"\n\x1bring/status/v1/status.proto\x12\x0ering.status.v1*\xea\x01\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\r\n\tSTATUS_OK\x10\x01\x12\x12\n\x0eSTATUS_TIMEOUT\x10\x02\x12\x14\n\x10STATUS_THROTTLED\x10\x03\x12\x1b\n\x17STATUS_INVALID_ARGUMENT\x10\x04\x12\x1b\n\x17STATUS_INVALID_RESPONSE\x10\x05\x12\x1a\n\x16STATUS_TEMPORARY_ERROR\x10\x06\x12\x1a\n\x16STATUS_PERMANENT_ERROR\x10\x07\x12\x1d\n\x19STATUS_INCOMPATIBLE_STATE\x10\x08\x42{\n\x12\x63om.ring.status.v1B\x0bStatusProtoP\x01\xa2\x02\x03RSX\xaa\x02\x0eRing.Status.V1\xca\x02\x0eRing\\Status\\V1\xe2\x02\x1aRing\\Status\\V1\\GPBMetadata\xea\x02\x10Ring::Status::V1b\x06proto3" -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages( - DESCRIPTOR, "ring.status.v1.status_pb2", _globals -) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\022com.ring.status.v1B\013StatusProtoP\001\242\002\003RSX\252\002\016Ring.Status.V1\312\002\016Ring\\Status\\V1\342\002\032Ring\\Status\\V1\\GPBMetadata\352\002\020Ring::Status::V1" - ) - _globals["_STATUS"]._serialized_start = 48 - _globals["_STATUS"]._serialized_end = 282 -# @@protoc_insertion_point(module_scope) diff --git a/src/ring/task/v1/config_pb2.py b/src/ring/task/v1/config_pb2.py deleted file mode 100644 index 1a8de73a..00000000 --- a/src/ring/task/v1/config_pb2.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ring/task/v1/config.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x19ring/task/v1/config.proto\x12\x0cring.task.v1\x1a\x1fgoogle/protobuf/timestamp.proto"\xd0\x01\n\x06\x43onfig\x12\x37\n\texpire_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08\x65xpireAt\x12!\n\x0c\x61uto_discard\x18\x02 \x01(\x08R\x0b\x61utoDiscard\x12)\n\x05scope\x18\x03 \x03(\x0b\x32\x13.ring.task.v1.ScopeR\x05scope\x12+\n\x0fsigning_key_urn\x18\x04 \x01(\tH\x00R\rsigningKeyUrn\x88\x01\x01\x42\x12\n\x10_signing_key_urn"/\n\x05Scope\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05valueBq\n\x10\x63om.ring.task.v1B\x0b\x43onfigProtoP\x01\xa2\x02\x03RTX\xaa\x02\x0cRing.Task.V1\xca\x02\x0cRing\\Task\\V1\xe2\x02\x18Ring\\Task\\V1\\GPBMetadata\xea\x02\x0eRing::Task::V1b\x06proto3' -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "ring.task.v1.config_pb2", _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\020com.ring.task.v1B\013ConfigProtoP\001\242\002\003RTX\252\002\014Ring.Task.V1\312\002\014Ring\\Task\\V1\342\002\030Ring\\Task\\V1\\GPBMetadata\352\002\016Ring::Task::V1" - ) - _globals["_CONFIG"]._serialized_start = 77 - _globals["_CONFIG"]._serialized_end = 285 - _globals["_SCOPE"]._serialized_start = 287 - _globals["_SCOPE"]._serialized_end = 334 -# @@protoc_insertion_point(module_scope) diff --git a/src/ring/task/v1/config_pb2.pyi b/src/ring/task/v1/config_pb2.pyi deleted file mode 100644 index d403c4d6..00000000 --- a/src/ring/task/v1/config_pb2.pyi +++ /dev/null @@ -1,41 +0,0 @@ -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) - -DESCRIPTOR: _descriptor.FileDescriptor - -class Config(_message.Message): - __slots__ = ("expire_at", "auto_discard", "scope", "signing_key_urn") - EXPIRE_AT_FIELD_NUMBER: _ClassVar[int] - AUTO_DISCARD_FIELD_NUMBER: _ClassVar[int] - SCOPE_FIELD_NUMBER: _ClassVar[int] - SIGNING_KEY_URN_FIELD_NUMBER: _ClassVar[int] - expire_at: _timestamp_pb2.Timestamp - auto_discard: bool - scope: _containers.RepeatedCompositeFieldContainer[Scope] - signing_key_urn: str - def __init__( - self, - expire_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - auto_discard: bool = ..., - scope: _Optional[_Iterable[_Union[Scope, _Mapping]]] = ..., - signing_key_urn: _Optional[str] = ..., - ) -> None: ... - -class Scope(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__( - self, key: _Optional[str] = ..., value: _Optional[str] = ... - ) -> None: ... diff --git a/src/ring/task/v1/config_pb2_grpc.py b/src/ring/task/v1/config_pb2_grpc.py deleted file mode 100644 index 8a939394..00000000 --- a/src/ring/task/v1/config_pb2_grpc.py +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc diff --git a/src/ring/task/v1/service_pb2.py b/src/ring/task/v1/service_pb2.py deleted file mode 100644 index 48beadd9..00000000 --- a/src/ring/task/v1/service_pb2.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ring/task/v1/service.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from ring.record.v1 import record_pb2 as ring_dot_record_dot_v1_dot_record__pb2 -from ring.task.v1 import config_pb2 as ring_dot_task_dot_v1_dot_config__pb2 -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x1aring/task/v1/service.proto\x12\x0cring.task.v1\x1a\x1bring/record/v1/record.proto\x1a\x19ring/task/v1/config.proto\x1a\x19google/protobuf/any.proto"\xc2\x01\n\x0f\x43reateTaskInput\x12#\n\rcoroutine_uri\x18\x01 \x01(\tR\x0c\x63oroutineUri\x12*\n\x05input\x18\x02 \x01(\x0b\x32\x14.google.protobuf.AnyR\x05input\x12,\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\x14.ring.task.v1.ConfigR\x06\x63onfig\x12\x30\n\x08metadata\x18\x04 \x01(\x0b\x32\x14.google.protobuf.AnyR\x08metadata"d\n\x10\x43reateTaskOutput\x12,\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x14.ring.task.v1.ConfigR\x06\x63onfig\x12"\n\x02id\x18\x02 \x01(\x0b\x32\x12.ring.record.v1.IDR\x02id"I\n\x12\x43reateTasksRequest\x12\x33\n\x05tasks\x18\x01 \x03(\x0b\x32\x1d.ring.task.v1.CreateTaskInputR\x05tasks"K\n\x13\x43reateTasksResponse\x12\x34\n\x05tasks\x18\x01 \x03(\x0b\x32\x1e.ring.task.v1.CreateTaskOutputR\x05tasks2_\n\x07Service\x12T\n\x0b\x43reateTasks\x12 .ring.task.v1.CreateTasksRequest\x1a!.ring.task.v1.CreateTasksResponse"\x00\x42r\n\x10\x63om.ring.task.v1B\x0cServiceProtoP\x01\xa2\x02\x03RTX\xaa\x02\x0cRing.Task.V1\xca\x02\x0cRing\\Task\\V1\xe2\x02\x18Ring\\Task\\V1\\GPBMetadata\xea\x02\x0eRing::Task::V1b\x06proto3' -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages( - DESCRIPTOR, "ring.task.v1.service_pb2", _globals -) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\020com.ring.task.v1B\014ServiceProtoP\001\242\002\003RTX\252\002\014Ring.Task.V1\312\002\014Ring\\Task\\V1\342\002\030Ring\\Task\\V1\\GPBMetadata\352\002\016Ring::Task::V1" - ) - _globals["_CREATETASKINPUT"]._serialized_start = 128 - _globals["_CREATETASKINPUT"]._serialized_end = 322 - _globals["_CREATETASKOUTPUT"]._serialized_start = 324 - _globals["_CREATETASKOUTPUT"]._serialized_end = 424 - _globals["_CREATETASKSREQUEST"]._serialized_start = 426 - _globals["_CREATETASKSREQUEST"]._serialized_end = 499 - _globals["_CREATETASKSRESPONSE"]._serialized_start = 501 - _globals["_CREATETASKSRESPONSE"]._serialized_end = 576 - _globals["_SERVICE"]._serialized_start = 578 - _globals["_SERVICE"]._serialized_end = 673 -# @@protoc_insertion_point(module_scope) diff --git a/src/ring/task/v1/service_pb2.pyi b/src/ring/task/v1/service_pb2.pyi deleted file mode 100644 index fdaaef7e..00000000 --- a/src/ring/task/v1/service_pb2.pyi +++ /dev/null @@ -1,61 +0,0 @@ -from ring.record.v1 import record_pb2 as _record_pb2 -from ring.task.v1 import config_pb2 as _config_pb2 -from google.protobuf import any_pb2 as _any_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) - -DESCRIPTOR: _descriptor.FileDescriptor - -class CreateTaskInput(_message.Message): - __slots__ = ("coroutine_uri", "input", "config", "metadata") - COROUTINE_URI_FIELD_NUMBER: _ClassVar[int] - INPUT_FIELD_NUMBER: _ClassVar[int] - CONFIG_FIELD_NUMBER: _ClassVar[int] - METADATA_FIELD_NUMBER: _ClassVar[int] - coroutine_uri: str - input: _any_pb2.Any - config: _config_pb2.Config - metadata: _any_pb2.Any - def __init__( - self, - coroutine_uri: _Optional[str] = ..., - input: _Optional[_Union[_any_pb2.Any, _Mapping]] = ..., - config: _Optional[_Union[_config_pb2.Config, _Mapping]] = ..., - metadata: _Optional[_Union[_any_pb2.Any, _Mapping]] = ..., - ) -> None: ... - -class CreateTaskOutput(_message.Message): - __slots__ = ("config", "id") - CONFIG_FIELD_NUMBER: _ClassVar[int] - ID_FIELD_NUMBER: _ClassVar[int] - config: _config_pb2.Config - id: _record_pb2.ID - def __init__( - self, - config: _Optional[_Union[_config_pb2.Config, _Mapping]] = ..., - id: _Optional[_Union[_record_pb2.ID, _Mapping]] = ..., - ) -> None: ... - -class CreateTasksRequest(_message.Message): - __slots__ = ("tasks",) - TASKS_FIELD_NUMBER: _ClassVar[int] - tasks: _containers.RepeatedCompositeFieldContainer[CreateTaskInput] - def __init__( - self, tasks: _Optional[_Iterable[_Union[CreateTaskInput, _Mapping]]] = ... - ) -> None: ... - -class CreateTasksResponse(_message.Message): - __slots__ = ("tasks",) - TASKS_FIELD_NUMBER: _ClassVar[int] - tasks: _containers.RepeatedCompositeFieldContainer[CreateTaskOutput] - def __init__( - self, tasks: _Optional[_Iterable[_Union[CreateTaskOutput, _Mapping]]] = ... - ) -> None: ... diff --git a/src/ring/task/v1/service_pb2_grpc.py b/src/ring/task/v1/service_pb2_grpc.py deleted file mode 100644 index b576cc3c..00000000 --- a/src/ring/task/v1/service_pb2_grpc.py +++ /dev/null @@ -1,85 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from ring.task.v1 import service_pb2 as ring_dot_task_dot_v1_dot_service__pb2 - - -class ServiceStub(object): - """Service represents the set of APIs to perform the administration of tasks in - a Ring instance. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateTasks = channel.unary_unary( - "/ring.task.v1.Service/CreateTasks", - request_serializer=ring_dot_task_dot_v1_dot_service__pb2.CreateTasksRequest.SerializeToString, - response_deserializer=ring_dot_task_dot_v1_dot_service__pb2.CreateTasksResponse.FromString, - ) - - -class ServiceServicer(object): - """Service represents the set of APIs to perform the administration of tasks in - a Ring instance. - """ - - def CreateTasks(self, request, context): - """CreateTasks is invoked to create new tasks.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateTasks": grpc.unary_unary_rpc_method_handler( - servicer.CreateTasks, - request_deserializer=ring_dot_task_dot_v1_dot_service__pb2.CreateTasksRequest.FromString, - response_serializer=ring_dot_task_dot_v1_dot_service__pb2.CreateTasksResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "ring.task.v1.Service", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) - - -# This class is part of an EXPERIMENTAL API. -class Service(object): - """Service represents the set of APIs to perform the administration of tasks in - a Ring instance. - """ - - @staticmethod - def CreateTasks( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/ring.task.v1.Service/CreateTasks", - ring_dot_task_dot_v1_dot_service__pb2.CreateTasksRequest.SerializeToString, - ring_dot_task_dot_v1_dot_service__pb2.CreateTasksResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) diff --git a/src/ring/task/v1/task_pb2.py b/src/ring/task/v1/task_pb2.py deleted file mode 100644 index 3bcc6cd4..00000000 --- a/src/ring/task/v1/task_pb2.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ring/task/v1/task.proto -# Protobuf Python Version: 4.25.2 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from ring.record.v1 import record_pb2 as ring_dot_record_dot_v1_dot_record__pb2 -from ring.status.v1 import status_pb2 as ring_dot_status_dot_v1_dot_status__pb2 -from ring.task.v1 import config_pb2 as ring_dot_task_dot_v1_dot_config__pb2 -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x17ring/task/v1/task.proto\x12\x0cring.task.v1\x1a\x1bring/record/v1/record.proto\x1a\x1bring/status/v1/status.proto\x1a\x19ring/task/v1/config.proto\x1a\x19google/protobuf/any.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xa8\x03\n\nSubmission\x12#\n\rcoroutine_uri\x18\x01 \x01(\tR\x0c\x63oroutineUri\x12*\n\x05input\x18\x02 \x01(\x0b\x32\x14.google.protobuf.AnyR\x05input\x12,\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\x14.ring.task.v1.ConfigR\x06\x63onfig\x12.\n\x04time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12\x30\n\x08metadata\x18\x05 \x01(\x0b\x32\x14.google.protobuf.AnyR\x08metadata\x12+\n\x11\x63oroutine_version\x18\x06 \x01(\tR\x10\x63oroutineVersion\x12+\n\x07task_id\x18\x07 \x01(\x0b\x32\x12.ring.record.v1.IDR\x06taskId\x12\x38\n\x0eparent_task_id\x18\x08 \x01(\x0b\x32\x12.ring.record.v1.IDR\x0cparentTaskId\x12%\n\x0e\x63orrelation_id\x18\t \x01(\x04R\rcorrelationId"\x9e\x03\n\nSuspension\x12+\n\x07task_id\x18\x01 \x01(\x0b\x32\x12.ring.record.v1.IDR\x06taskId\x12\x14\n\x05state\x18\x02 \x01(\x0cR\x05state\x12,\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\x14.ring.task.v1.ConfigR\x06\x63onfig\x12.\n\x04time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12\x30\n\x08metadata\x18\x05 \x01(\x0b\x32\x14.google.protobuf.AnyR\x08metadata\x12+\n\x11\x63oroutine_version\x18\x06 \x01(\tR\x10\x63oroutineVersion\x12%\n\x0e\x63orrelation_id\x18\x07 \x01(\x04R\rcorrelationId\x12?\n\rpoll_deadline\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0cpollDeadline\x12(\n\x10poll_max_results\x18\t \x01(\x05R\x0epollMaxResults"\x9d\x03\n\nCompletion\x12+\n\x07task_id\x18\x01 \x01(\x0b\x32\x12.ring.record.v1.IDR\x06taskId\x12)\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x13.ring.task.v1.ErrorR\x05\x65rror\x12,\n\x06output\x18\x03 \x01(\x0b\x32\x14.google.protobuf.AnyR\x06output\x12.\n\x04time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12\x30\n\x08metadata\x18\x05 \x01(\x0b\x32\x14.google.protobuf.AnyR\x08metadata\x12#\n\rcoroutine_uri\x18\x06 \x01(\tR\x0c\x63oroutineUri\x12+\n\x11\x63oroutine_version\x18\x07 \x01(\tR\x10\x63oroutineVersion\x12.\n\x06status\x18\x08 \x01(\x0e\x32\x16.ring.status.v1.StatusR\x06status\x12%\n\x0e\x63orrelation_id\x18\t \x01(\x04R\rcorrelationId"6\n\x07\x44iscard\x12+\n\x07task_id\x18\x01 \x01(\x0b\x32\x12.ring.record.v1.IDR\x06taskId"\xa5\x01\n\x05\x45rror\x12\x18\n\x07message\x18\x01 \x01(\tR\x07message\x12!\n\ttemporary\x18\x02 \x01(\x08H\x00R\ttemporary\x88\x01\x01\x12\x1d\n\x07timeout\x18\x03 \x01(\x08H\x01R\x07timeout\x88\x01\x01\x12\x1b\n\x06\x63\x61ncel\x18\x04 \x01(\x08H\x02R\x06\x63\x61ncel\x88\x01\x01\x42\x0c\n\n_temporaryB\n\n\x08_timeoutB\t\n\x07_cancelBo\n\x10\x63om.ring.task.v1B\tTaskProtoP\x01\xa2\x02\x03RTX\xaa\x02\x0cRing.Task.V1\xca\x02\x0cRing\\Task\\V1\xe2\x02\x18Ring\\Task\\V1\\GPBMetadata\xea\x02\x0eRing::Task::V1b\x06proto3' -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "ring.task.v1.task_pb2", _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = ( - b"\n\020com.ring.task.v1B\tTaskProtoP\001\242\002\003RTX\252\002\014Ring.Task.V1\312\002\014Ring\\Task\\V1\342\002\030Ring\\Task\\V1\\GPBMetadata\352\002\016Ring::Task::V1" - ) - _globals["_SUBMISSION"]._serialized_start = 187 - _globals["_SUBMISSION"]._serialized_end = 611 - _globals["_SUSPENSION"]._serialized_start = 614 - _globals["_SUSPENSION"]._serialized_end = 1028 - _globals["_COMPLETION"]._serialized_start = 1031 - _globals["_COMPLETION"]._serialized_end = 1444 - _globals["_DISCARD"]._serialized_start = 1446 - _globals["_DISCARD"]._serialized_end = 1500 - _globals["_ERROR"]._serialized_start = 1503 - _globals["_ERROR"]._serialized_end = 1668 -# @@protoc_insertion_point(module_scope) diff --git a/src/ring/task/v1/task_pb2.pyi b/src/ring/task/v1/task_pb2.pyi deleted file mode 100644 index 48abe933..00000000 --- a/src/ring/task/v1/task_pb2.pyi +++ /dev/null @@ -1,170 +0,0 @@ -from ring.record.v1 import record_pb2 as _record_pb2 -from ring.status.v1 import status_pb2 as _status_pb2 -from ring.task.v1 import config_pb2 as _config_pb2 -from google.protobuf import any_pb2 as _any_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) - -DESCRIPTOR: _descriptor.FileDescriptor - -class Submission(_message.Message): - __slots__ = ( - "coroutine_uri", - "input", - "config", - "time", - "metadata", - "coroutine_version", - "task_id", - "parent_task_id", - "correlation_id", - ) - COROUTINE_URI_FIELD_NUMBER: _ClassVar[int] - INPUT_FIELD_NUMBER: _ClassVar[int] - CONFIG_FIELD_NUMBER: _ClassVar[int] - TIME_FIELD_NUMBER: _ClassVar[int] - METADATA_FIELD_NUMBER: _ClassVar[int] - COROUTINE_VERSION_FIELD_NUMBER: _ClassVar[int] - TASK_ID_FIELD_NUMBER: _ClassVar[int] - PARENT_TASK_ID_FIELD_NUMBER: _ClassVar[int] - CORRELATION_ID_FIELD_NUMBER: _ClassVar[int] - coroutine_uri: str - input: _any_pb2.Any - config: _config_pb2.Config - time: _timestamp_pb2.Timestamp - metadata: _any_pb2.Any - coroutine_version: str - task_id: _record_pb2.ID - parent_task_id: _record_pb2.ID - correlation_id: int - def __init__( - self, - coroutine_uri: _Optional[str] = ..., - input: _Optional[_Union[_any_pb2.Any, _Mapping]] = ..., - config: _Optional[_Union[_config_pb2.Config, _Mapping]] = ..., - time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - metadata: _Optional[_Union[_any_pb2.Any, _Mapping]] = ..., - coroutine_version: _Optional[str] = ..., - task_id: _Optional[_Union[_record_pb2.ID, _Mapping]] = ..., - parent_task_id: _Optional[_Union[_record_pb2.ID, _Mapping]] = ..., - correlation_id: _Optional[int] = ..., - ) -> None: ... - -class Suspension(_message.Message): - __slots__ = ( - "task_id", - "state", - "config", - "time", - "metadata", - "coroutine_version", - "correlation_id", - "poll_deadline", - "poll_max_results", - ) - TASK_ID_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - CONFIG_FIELD_NUMBER: _ClassVar[int] - TIME_FIELD_NUMBER: _ClassVar[int] - METADATA_FIELD_NUMBER: _ClassVar[int] - COROUTINE_VERSION_FIELD_NUMBER: _ClassVar[int] - CORRELATION_ID_FIELD_NUMBER: _ClassVar[int] - POLL_DEADLINE_FIELD_NUMBER: _ClassVar[int] - POLL_MAX_RESULTS_FIELD_NUMBER: _ClassVar[int] - task_id: _record_pb2.ID - state: bytes - config: _config_pb2.Config - time: _timestamp_pb2.Timestamp - metadata: _any_pb2.Any - coroutine_version: str - correlation_id: int - poll_deadline: _timestamp_pb2.Timestamp - poll_max_results: int - def __init__( - self, - task_id: _Optional[_Union[_record_pb2.ID, _Mapping]] = ..., - state: _Optional[bytes] = ..., - config: _Optional[_Union[_config_pb2.Config, _Mapping]] = ..., - time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - metadata: _Optional[_Union[_any_pb2.Any, _Mapping]] = ..., - coroutine_version: _Optional[str] = ..., - correlation_id: _Optional[int] = ..., - poll_deadline: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - poll_max_results: _Optional[int] = ..., - ) -> None: ... - -class Completion(_message.Message): - __slots__ = ( - "task_id", - "error", - "output", - "time", - "metadata", - "coroutine_uri", - "coroutine_version", - "status", - "correlation_id", - ) - TASK_ID_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - OUTPUT_FIELD_NUMBER: _ClassVar[int] - TIME_FIELD_NUMBER: _ClassVar[int] - METADATA_FIELD_NUMBER: _ClassVar[int] - COROUTINE_URI_FIELD_NUMBER: _ClassVar[int] - COROUTINE_VERSION_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - CORRELATION_ID_FIELD_NUMBER: _ClassVar[int] - task_id: _record_pb2.ID - error: Error - output: _any_pb2.Any - time: _timestamp_pb2.Timestamp - metadata: _any_pb2.Any - coroutine_uri: str - coroutine_version: str - status: _status_pb2.Status - correlation_id: int - def __init__( - self, - task_id: _Optional[_Union[_record_pb2.ID, _Mapping]] = ..., - error: _Optional[_Union[Error, _Mapping]] = ..., - output: _Optional[_Union[_any_pb2.Any, _Mapping]] = ..., - time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., - metadata: _Optional[_Union[_any_pb2.Any, _Mapping]] = ..., - coroutine_uri: _Optional[str] = ..., - coroutine_version: _Optional[str] = ..., - status: _Optional[_Union[_status_pb2.Status, str]] = ..., - correlation_id: _Optional[int] = ..., - ) -> None: ... - -class Discard(_message.Message): - __slots__ = ("task_id",) - TASK_ID_FIELD_NUMBER: _ClassVar[int] - task_id: _record_pb2.ID - def __init__( - self, task_id: _Optional[_Union[_record_pb2.ID, _Mapping]] = ... - ) -> None: ... - -class Error(_message.Message): - __slots__ = ("message", "temporary", "timeout", "cancel") - MESSAGE_FIELD_NUMBER: _ClassVar[int] - TEMPORARY_FIELD_NUMBER: _ClassVar[int] - TIMEOUT_FIELD_NUMBER: _ClassVar[int] - CANCEL_FIELD_NUMBER: _ClassVar[int] - message: str - temporary: bool - timeout: bool - cancel: bool - def __init__( - self, - message: _Optional[str] = ..., - temporary: bool = ..., - timeout: bool = ..., - cancel: bool = ..., - ) -> None: ... diff --git a/src/ring/task/v1/task_pb2_grpc.py b/src/ring/task/v1/task_pb2_grpc.py deleted file mode 100644 index 8a939394..00000000 --- a/src/ring/task/v1/task_pb2_grpc.py +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc From 57bd9ffa96fa4d8f77708748a7c45498725de3f8 Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Thu, 1 Feb 2024 15:38:47 -0500 Subject: [PATCH 3/4] Rename all the things --- src/dispatch/__init__.py | 62 ++++++------------------- src/dispatch/coroutine.py | 76 +++++++++++++++---------------- src/dispatch/fastapi.py | 6 +-- src/ring/__init__.py | 0 src/ring/admin/__init__.py | 0 src/ring/admin/v1/__init__.py | 0 src/ring/coroutine/__init__.py | 0 src/ring/coroutine/v1/__init__.py | 0 src/ring/http/__init__.py | 0 src/ring/http/v1/__init__.py | 0 src/ring/record/__init__.py | 0 src/ring/record/v1/__init__.py | 0 src/ring/snapshot/__init__.py | 0 src/ring/snapshot/v1/__init__.py | 0 src/ring/status/__init__.py | 0 src/ring/status/v1/__init__.py | 0 src/ring/task/__init__.py | 0 src/ring/task/v1/__init__.py | 0 tests/executor_service.py | 9 ++-- tests/task_service.py | 44 ++++++++++-------- tests/test_client.py | 12 ----- tests/test_fastapi.py | 26 +++++------ 22 files changed, 96 insertions(+), 139 deletions(-) delete mode 100644 src/ring/__init__.py delete mode 100644 src/ring/admin/__init__.py delete mode 100644 src/ring/admin/v1/__init__.py delete mode 100644 src/ring/coroutine/__init__.py delete mode 100644 src/ring/coroutine/v1/__init__.py delete mode 100644 src/ring/http/__init__.py delete mode 100644 src/ring/http/v1/__init__.py delete mode 100644 src/ring/record/__init__.py delete mode 100644 src/ring/record/v1/__init__.py delete mode 100644 src/ring/snapshot/__init__.py delete mode 100644 src/ring/snapshot/v1/__init__.py delete mode 100644 src/ring/status/__init__.py delete mode 100644 src/ring/status/v1/__init__.py delete mode 100644 src/ring/task/__init__.py delete mode 100644 src/ring/task/v1/__init__.py diff --git a/src/dispatch/__init__.py b/src/dispatch/__init__.py index cae6f76c..e712e773 100644 --- a/src/dispatch/__init__.py +++ b/src/dispatch/__init__.py @@ -13,55 +13,19 @@ import grpc import google.protobuf -import ring.record.v1.record_pb2 as record_pb -import ring.task.v1.service_pb2 as service -import ring.task.v1.service_pb2_grpc as service_grpc +import dispatch.sdk.v1.endpoint_pb2 as endpoint_pb +import dispatch.sdk.v1.endpoint_pb2_grpc as endpoint_grpc import dispatch.coroutine __all__ = ["Client", "TaskID", "TaskInput", "TaskDef"] -@dataclass(frozen=True, repr=False) -class TaskID: - """Unique task identifier in Dispatch. +TaskID: TypeAlias = str +"""Unique task identifier in Dispatch. - It should be treated as an opaque value. - """ - - partition_number: int - block_id: int - record_offset: int - record_size: int - - @classmethod - def _from_proto(cls, proto: record_pb.ID) -> TaskID: - return cls( - partition_number=proto.partition_number, - block_id=proto.block_id, - record_offset=proto.record_offset, - record_size=proto.record_size, - ) - - def _to_proto(self) -> record_pb.ID: - return record_pb.ID( - partition_number=self.partition_number, - block_id=self.block_id, - record_offset=self.record_offset, - record_size=self.record_size, - ) - - def __str__(self) -> str: - parts = [ - self.partition_number, - self.block_id, - self.record_offset, - self.record_size, - ] - return "".join("{:08x}".format(a) for a in parts) - - def __repr__(self) -> str: - return f"TaskID({self})" +It should be treated as an opaque value. +""" @dataclass(frozen=True) @@ -90,7 +54,7 @@ class TaskInput: """ -def _taskdef_to_proto(taskdef: TaskDef) -> service.CreateTaskInput: +def _taskdef_to_proto(taskdef: TaskDef) -> endpoint_pb.Execution: input = taskdef.input match input: case google.protobuf.any_pb2.Any(): @@ -102,7 +66,7 @@ def _taskdef_to_proto(taskdef: TaskDef) -> service.CreateTaskInput: pickled = pickle.dumps(input) input_any = google.protobuf.any_pb2.Any() input_any.Pack(google.protobuf.wrappers_pb2.BytesValue(value=pickled)) - return service.CreateTaskInput(coroutine_uri=taskdef.coroutine_uri, input=input_any) + return endpoint_pb.Execution(coroutine_uri=taskdef.coroutine_uri, input=input_any) class Client: @@ -140,7 +104,7 @@ def __init__( creds = grpc.composite_channel_credentials(creds, call_creds) channel = grpc.secure_channel(result.netloc, creds) - self._stub = service_grpc.ServiceStub(channel) + self._stub = endpoint_grpc.EndpointServiceStub(channel) def create_tasks(self, tasks: Iterable[TaskDef]) -> Iterable[TaskID]: """Create tasks on Dispatch using the provided inputs. @@ -148,8 +112,8 @@ def create_tasks(self, tasks: Iterable[TaskDef]) -> Iterable[TaskID]: Returns: The ID of the created tasks, in the same order as the inputs. """ - req = service.CreateTasksRequest() + req = endpoint_pb.CreateExecutionsRequest() for task in tasks: - req.tasks.append(_taskdef_to_proto(task)) - resp = self._stub.CreateTasks(req) - return [TaskID._from_proto(x.id) for x in resp.tasks] + req.executions.append(_taskdef_to_proto(task)) + resp = self._stub.CreateExecutions(req) + return [TaskID(x) for x in resp.ids] diff --git a/src/dispatch/coroutine.py b/src/dispatch/coroutine.py index 50d19883..2e186c69 100644 --- a/src/dispatch/coroutine.py +++ b/src/dispatch/coroutine.py @@ -18,8 +18,8 @@ import google.protobuf.message -from ring.coroutine.v1 import coroutine_pb2 -from ring.status.v1 import status_pb2 +from dispatch.sdk.v1 import executor_pb2 as executor_pb +from dispatch.sdk.v1 import status_pb2 as status_pb # Most types in this package are thin wrappers around the various protobuf @@ -33,46 +33,46 @@ class Status(int, enum.Enum): """ - UNSPECIFIED = status_pb2.STATUS_UNSPECIFIED - OK = status_pb2.STATUS_OK - TIMEOUT = status_pb2.STATUS_TIMEOUT - THROTTLED = status_pb2.STATUS_THROTTLED - INVALID_ARGUMENT = status_pb2.STATUS_INVALID_ARGUMENT - INVALID_RESPONSE = status_pb2.STATUS_INVALID_RESPONSE - TEMPORARY_ERROR = status_pb2.STATUS_TEMPORARY_ERROR - PERMANENT_ERROR = status_pb2.STATUS_PERMANENT_ERROR - INCOMPATIBLE_STATE = status_pb2.STATUS_INCOMPATIBLE_STATE + UNSPECIFIED = status_pb.STATUS_UNSPECIFIED + OK = status_pb.STATUS_OK + TIMEOUT = status_pb.STATUS_TIMEOUT + THROTTLED = status_pb.STATUS_THROTTLED + INVALID_ARGUMENT = status_pb.STATUS_INVALID_ARGUMENT + INVALID_RESPONSE = status_pb.STATUS_INVALID_RESPONSE + TEMPORARY_ERROR = status_pb.STATUS_TEMPORARY_ERROR + PERMANENT_ERROR = status_pb.STATUS_PERMANENT_ERROR + INCOMPATIBLE_STATE = status_pb.STATUS_INCOMPATIBLE_STATE - _proto: status_pb2.Status + _proto: status_pb.Status # Maybe we should find a better way to define that enum. It's that way to please # Mypy and provide documentation for the enum values. Status.UNSPECIFIED.__doc__ = "Status not specified (default)" -Status.UNSPECIFIED._proto = status_pb2.STATUS_UNSPECIFIED +Status.UNSPECIFIED._proto = status_pb.STATUS_UNSPECIFIED Status.OK.__doc__ = "Coroutine returned as expected" -Status.OK._proto = status_pb2.STATUS_OK +Status.OK._proto = status_pb.STATUS_OK Status.TIMEOUT.__doc__ = "Coroutine encountered a timeout and may be retried" -Status.TIMEOUT._proto = status_pb2.STATUS_TIMEOUT +Status.TIMEOUT._proto = status_pb.STATUS_TIMEOUT Status.THROTTLED.__doc__ = "Coroutine was throttled and may be retried later" -Status.THROTTLED._proto = status_pb2.STATUS_THROTTLED +Status.THROTTLED._proto = status_pb.STATUS_THROTTLED Status.INVALID_ARGUMENT.__doc__ = "Coroutine was provided an invalid type of input" -Status.INVALID_ARGUMENT._proto = status_pb2.STATUS_INVALID_ARGUMENT +Status.INVALID_ARGUMENT._proto = status_pb.STATUS_INVALID_ARGUMENT Status.INVALID_RESPONSE.__doc__ = "Coroutine was provided an unexpected reponse" -Status.INVALID_RESPONSE._proto = status_pb2.STATUS_INVALID_RESPONSE +Status.INVALID_RESPONSE._proto = status_pb.STATUS_INVALID_RESPONSE Status.TEMPORARY_ERROR.__doc__ = ( "Coroutine encountered a temporary error, may be retried" ) -Status.TEMPORARY_ERROR._proto = status_pb2.STATUS_TEMPORARY_ERROR +Status.TEMPORARY_ERROR._proto = status_pb.STATUS_TEMPORARY_ERROR Status.PERMANENT_ERROR.__doc__ = ( "Coroutine encountered a permanent error, should not be retried" ) -Status.PERMANENT_ERROR._proto = status_pb2.STATUS_PERMANENT_ERROR +Status.PERMANENT_ERROR._proto = status_pb.STATUS_PERMANENT_ERROR Status.INCOMPATIBLE_STATE.__doc__ = ( "Coroutine was provided an incompatible state. May be restarted from scratch" ) -Status.INCOMPATIBLE_STATE._proto = status_pb2.STATUS_INCOMPATIBLE_STATE +Status.INCOMPATIBLE_STATE._proto = status_pb.STATUS_INCOMPATIBLE_STATE class Coroutine: @@ -127,7 +127,7 @@ class Input: # TODO: first implementation with a single Input type, but we should # consider using some dynamic filling positional and keyword arguments. - def __init__(self, req: coroutine_pb2.ExecuteRequest): + def __init__(self, req: executor_pb.ExecuteRequest): self._has_input = req.HasField("input") if self._has_input: input_pb = google.protobuf.wrappers_pb2.BytesValue() @@ -184,7 +184,7 @@ class Output: """ - def __init__(self, proto: coroutine_pb2.ExecuteResponse): + def __init__(self, proto: executor_pb.ExecuteResponse): self._message = proto @classmethod @@ -192,9 +192,9 @@ def value(cls, value: Any, status: Status = Status.OK) -> Output: """Terminally exit the coroutine with the provided return value.""" output_any = _pb_any_pickle(value) return Output( - coroutine_pb2.ExecuteResponse( + executor_pb.ExecuteResponse( status=status._proto, - exit=coroutine_pb2.Exit(result=coroutine_pb2.Result(output=output_any)), + exit=executor_pb.Exit(result=executor_pb.Result(output=output_any)), ) ) @@ -202,10 +202,10 @@ def value(cls, value: Any, status: Status = Status.OK) -> Output: def error(cls, error: Error) -> Output: """Terminally exit the coroutine with the provided error.""" return Output( - coroutine_pb2.ExecuteResponse( + executor_pb.ExecuteResponse( status=error.status._proto, - exit=coroutine_pb2.Exit( - result=coroutine_pb2.Result(error=error._as_proto()) + exit=executor_pb.Exit( + result=executor_pb.Result(error=error._as_proto()) ), ) ) @@ -216,12 +216,12 @@ def callback(cls, state: Any, calls: None | list[Call] = None) -> Output: coroutine with the provided state. The state will be made available in Input.state.""" state_bytes = pickle.dumps(state) - poll = coroutine_pb2.Poll(state=state_bytes) + poll = executor_pb.Poll(state=state_bytes) if calls is not None: for c in calls: input_bytes = _pb_any_pickle(c.input) - x = coroutine_pb2.Call( + x = executor_pb.Call( coroutine_uri=c.coroutine_uri, coroutine_version=c.coroutine_version, correlation_id=c.correlation_id, @@ -229,22 +229,20 @@ def callback(cls, state: Any, calls: None | list[Call] = None) -> Output: ) poll.calls.append(x) - return Output(coroutine_pb2.ExecuteResponse(poll=poll)) + return Output(executor_pb.ExecuteResponse(poll=poll)) @classmethod def tailcall(cls, call: Call) -> Output: """Exit the coroutine instructing the orchestrator to call the provided coroutine.""" input_bytes = _pb_any_pickle(call.input) - x = coroutine_pb2.Call( + x = executor_pb.Call( coroutine_uri=call.coroutine_uri, coroutine_version=call.coroutine_version, correlation_id=call.correlation_id, input=input_bytes, ) - return Output( - coroutine_pb2.ExecuteResponse(exit=coroutine_pb2.Exit(tail_call=x)) - ) + return Output(executor_pb.ExecuteResponse(exit=executor_pb.Exit(tail_call=x))) # Note: contrary to other classes here Call is not just a wrapper around its @@ -276,7 +274,7 @@ class CallResult: This class is not meant to be instantiated directly. """ - def __init__(self, proto: coroutine_pb2.CallResult): + def __init__(self, proto: executor_pb.CallResult): self.coroutine_uri = proto.coroutine_uri self.coroutine_version = proto.coroutine_version self.correlation_id = proto.correlation_id @@ -344,11 +342,11 @@ def from_exception(cls, ex: Exception, status: Status | None = None) -> Error: return Error(status, ex.__class__.__qualname__, str(ex)) @classmethod - def _from_proto(cls, proto: coroutine_pb2.Error) -> Error: + def _from_proto(cls, proto: executor_pb.Error) -> Error: return cls(Status.UNSPECIFIED, proto.type, proto.message) - def _as_proto(self) -> coroutine_pb2.Error: - return coroutine_pb2.Error(type=self.type, message=self.message) + def _as_proto(self) -> executor_pb.Error: + return executor_pb.Error(type=self.type, message=self.message) def _any_unpickle(any: google.protobuf.any_pb2.Any) -> Any: diff --git a/src/dispatch/fastapi.py b/src/dispatch/fastapi.py index 59278257..e2799a12 100644 --- a/src/dispatch/fastapi.py +++ b/src/dispatch/fastapi.py @@ -25,7 +25,7 @@ def read_root(): import fastapi.responses from httpx import _urlparse -import ring.coroutine.v1.coroutine_pb2 +from dispatch.sdk.v1 import executor_pb2 as executor_pb import dispatch.coroutine @@ -65,7 +65,7 @@ def configure( dispatch_app = _new_app(public_url) app.__setattr__("dispatch_coroutine", dispatch_app.dispatch_coroutine) - app.mount("/ring.coroutine.v1.ExecutorService", dispatch_app) + app.mount("/dispatch.sdk.v1.ExecutorService", dispatch_app) class _DispatchAPI(fastapi.FastAPI): @@ -117,7 +117,7 @@ async def execute(request: fastapi.Request): # forcing execute() to be async. data: bytes = await request.body() - req = ring.coroutine.v1.coroutine_pb2.ExecuteRequest.FromString(data) + req = executor_pb.ExecuteRequest.FromString(data) if not req.coroutine_uri: raise fastapi.HTTPException( diff --git a/src/ring/__init__.py b/src/ring/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/admin/__init__.py b/src/ring/admin/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/admin/v1/__init__.py b/src/ring/admin/v1/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/coroutine/__init__.py b/src/ring/coroutine/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/coroutine/v1/__init__.py b/src/ring/coroutine/v1/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/http/__init__.py b/src/ring/http/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/http/v1/__init__.py b/src/ring/http/v1/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/record/__init__.py b/src/ring/record/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/record/v1/__init__.py b/src/ring/record/v1/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/snapshot/__init__.py b/src/ring/snapshot/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/snapshot/v1/__init__.py b/src/ring/snapshot/v1/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/status/__init__.py b/src/ring/status/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/status/v1/__init__.py b/src/ring/status/v1/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/task/__init__.py b/src/ring/task/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ring/task/v1/__init__.py b/src/ring/task/v1/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/executor_service.py b/tests/executor_service.py index 245426a2..57b753fa 100644 --- a/tests/executor_service.py +++ b/tests/executor_service.py @@ -1,7 +1,8 @@ import httpx import grpc -import ring.coroutine.v1.coroutine_pb2 -import ring.coroutine.v1.coroutine_pb2_grpc + +from dispatch.sdk.v1 import executor_pb2 as executor_pb +from dispatch.sdk.v1 import executor_pb2_grpc as executor_grpc # This file provides a grpc client that can talk to the ExecutorService # interface. This is achieved by implementing the bare minimum of the @@ -132,6 +133,6 @@ def __exit__(self, exc_type, exc_val, exc_tb): def client( http_client: httpx.Client, -) -> ring.coroutine.v1.coroutine_pb2_grpc.ExecutorServiceStub: +) -> executor_grpc.ExecutorServiceStub: channel = HttpxGrpcChannel(http_client) - return ring.coroutine.v1.coroutine_pb2_grpc.ExecutorServiceStub(channel) + return executor_grpc.ExecutorServiceStub(channel) diff --git a/tests/task_service.py b/tests/task_service.py index b8558b35..8411233c 100644 --- a/tests/task_service.py +++ b/tests/task_service.py @@ -2,17 +2,19 @@ import grpc -import ring.task.v1.service_pb2 as service_pb -import ring.task.v1.service_pb2_grpc as service_grpc -from ring.coroutine.v1 import coroutine_pb2_grpc as coroutine_grpc -from ring.coroutine.v1 import coroutine_pb2 as coroutine_pb +import dispatch.sdk.v1.endpoint_pb2 as endpoint_pb +import dispatch.sdk.v1.endpoint_pb2_grpc as endpoint_grpc + +import dispatch.sdk.v1.executor_pb2 as executor_pb +import dispatch.sdk.v1.executor_pb2_grpc as executor_grpc + from dispatch import Client, TaskInput, TaskID _test_auth_token = "THIS_IS_A_TEST_AUTH_TOKEN" -class FakeRing(service_grpc.ServiceServicer): +class FakeRing(endpoint_grpc.EndpointServiceServicer): def __init__(self): super().__init__() self.current_partition = 1 @@ -24,6 +26,15 @@ def __init__(self): self.pending_tasks = [] + def _make_task_id(self) -> TaskID: + parts = [ + self.current_partition, + self.current_block_id, + self.current_offset, + 1, # record_size + ] + return "".join("{:08x}".format(a) for a in parts) + def _validate_authentication(self, context: grpc.ServicerContext): expected = f"Bearer {_test_auth_token}" for key, value in context.invocation_metadata(): @@ -36,27 +47,22 @@ def _validate_authentication(self, context: grpc.ServicerContext): ) context.abort(grpc.StatusCode.UNAUTHENTICATED, "Missing authorization header") - def CreateTasks(self, request: service_pb.CreateTasksRequest, context): + def CreateExecutions(self, request: endpoint_pb.CreateExecutionsRequest, context): self._validate_authentication(context) - resp = service_pb.CreateTasksResponse() + resp = endpoint_pb.CreateExecutionsResponse() - for t in request.tasks: - id = TaskID( - partition_number=self.current_partition, - block_id=self.current_block_id, - record_offset=self.current_offset, - record_size=1, - ) + for t in request.executions: + id = self._make_task_id() self.current_offset += 1 self.created_tasks.append({"id": id, "task": t}) self.pending_tasks.append({"id": id, "task": t}) - resp.tasks.append(service_pb.CreateTaskOutput(id=id._to_proto())) + resp.ids.append(id) self.current_block_id += 1 return resp - def execute(self, client: coroutine_grpc.ExecutorServiceStub): + def execute(self, client: executor_grpc.ExecutorServiceStub): """Synchronously execute all the pending tasks until there is no pending task left. @@ -65,7 +71,7 @@ def execute(self, client: coroutine_grpc.ExecutorServiceStub): entry = self.pending_tasks.pop(0) task = entry["task"] - req = coroutine_pb.ExecuteRequest( + req = executor_pb.ExecuteRequest( coroutine_uri=task.coroutine_uri, input=task.input ) @@ -89,7 +95,7 @@ def __init__(self): self.servicer = FakeRing() - service_grpc.add_ServiceServicer_to_server(self.servicer, self.server) + endpoint_grpc.add_EndpointServiceServicer_to_server(self.servicer, self.server) self.server.start() self.client = Client( @@ -101,5 +107,5 @@ def stop(self): self.server.wait_for_termination() self.thread_pool.shutdown(wait=True, cancel_futures=True) - def execute(self, client: coroutine_grpc.ExecutorServiceStub): + def execute(self, client: executor_grpc.ExecutorServiceStub): return self.servicer.execute(client) diff --git a/tests/test_client.py b/tests/test_client.py index a27be3c8..72b6425b 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -51,8 +51,6 @@ def test_create_one_task_pickle(self): ) self.assertEqual(len(results), 1) id = results[0] - self.assertTrue(id.partition_number != 0) - self.assertTrue(id.block_id != 0) created_tasks = self.servicer.created_tasks self.assertEqual(len(created_tasks), 1) @@ -89,13 +87,3 @@ def test_create_one_task_proto_any(self): task = entry["task"] # proto any has not been modified self.assertEqual(task.input, proto_any) - - -class TestTaskID(unittest.TestCase): - def test_string(self): - t = TaskID(partition_number=1, block_id=2, record_offset=3, record_size=4) - self.assertEqual(str(t), "00000001000000020000000300000004") - - def test_repr(self): - t = TaskID(partition_number=1, block_id=2, record_offset=3, record_size=4) - self.assertEqual(repr(t), "TaskID(00000001000000020000000300000004)") diff --git a/tests/test_fastapi.py b/tests/test_fastapi.py index 65d04b14..b8b18619 100644 --- a/tests/test_fastapi.py +++ b/tests/test_fastapi.py @@ -10,7 +10,7 @@ import dispatch.fastapi import dispatch.coroutine from dispatch.coroutine import Input, Output, Error, Status -from ring.coroutine.v1 import coroutine_pb2 +from dispatch.sdk.v1 import executor_pb2 as executor_pb from . import executor_service @@ -34,7 +34,7 @@ def read_root(): self.assertEqual(resp.json(), {"Hello": "World"}) # Ensure Dispatch root is available. - resp = client.post("/ring.coroutine.v1.ExecutorService/Execute") + resp = client.post("/dispatch.sdk.v1.ExecutorService/Execute") self.assertEqual(resp.status_code, 400) def test_configure_no_app(self): @@ -80,7 +80,7 @@ def my_cool_coroutine(input: Input) -> Output: input_any = google.protobuf.any_pb2.Any() input_any.Pack(google.protobuf.wrappers_pb2.BytesValue(value=pickled)) - req = coroutine_pb2.ExecuteRequest( + req = executor_pb.ExecuteRequest( coroutine_uri=my_cool_coroutine.uri, coroutine_version="1", input=input_any, @@ -88,7 +88,7 @@ def my_cool_coroutine(input: Input) -> Output: resp = client.Execute(req) - self.assertIsInstance(resp, coroutine_pb2.ExecuteResponse) + self.assertIsInstance(resp, executor_pb.ExecuteResponse) self.assertEqual(resp.coroutine_uri, req.coroutine_uri) self.assertEqual(resp.coroutine_version, req.coroutine_version) @@ -100,7 +100,7 @@ def my_cool_coroutine(input: Input) -> Output: self.assertEqual(output, "You told me: 'Hello World!' (12 characters)") -def response_output(resp: coroutine_pb2.ExecuteResponse) -> Any: +def response_output(resp: executor_pb.ExecuteResponse) -> Any: return dispatch.coroutine._any_unpickle(resp.exit.result.output) @@ -115,9 +115,9 @@ def setUp(self): def execute( self, coroutine, input=None, state=None, calls=None - ) -> coroutine_pb2.ExecuteResponse: + ) -> executor_pb.ExecuteResponse: """Test helper to invoke coroutines on the local server.""" - req = coroutine_pb2.ExecuteRequest( + req = executor_pb.ExecuteRequest( coroutine_uri=coroutine.uri, coroutine_version="1", ) @@ -134,23 +134,23 @@ def execute( req.poll_response.results.append(c) resp = self.client.Execute(req) - self.assertIsInstance(resp, coroutine_pb2.ExecuteResponse) + self.assertIsInstance(resp, executor_pb.ExecuteResponse) return resp - def call(self, call: coroutine_pb2.Call) -> coroutine_pb2.CallResult: - req = coroutine_pb2.ExecuteRequest( + def call(self, call: executor_pb.Call) -> executor_pb.CallResult: + req = executor_pb.ExecuteRequest( coroutine_uri=call.coroutine_uri, coroutine_version=call.coroutine_version, input=call.input, ) resp = self.client.Execute(req) - self.assertIsInstance(resp, coroutine_pb2.ExecuteResponse) + self.assertIsInstance(resp, executor_pb.ExecuteResponse) # Assert the response is terminal. Good enough until the test client can # orchestrate coroutines. self.assertTrue(len(resp.poll.state) == 0) - return coroutine_pb2.CallResult( + return executor_pb.CallResult( coroutine_uri=resp.coroutine_uri, coroutine_version=resp.coroutine_version, correlation_id=call.correlation_id, @@ -168,7 +168,7 @@ def my_cool_coroutine(input: Input) -> Output: self.assertEqual(out, "Hello World!") def test_missing_coroutine(self): - req = coroutine_pb2.ExecuteRequest( + req = executor_pb.ExecuteRequest( coroutine_uri="does-not-exist", coroutine_version="1", ) From 5bd2d4799bac059fb8ef3fbc2f9a3568598dbeba Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Thu, 1 Feb 2024 15:39:29 -0500 Subject: [PATCH 4/4] Rename FakeRing to FakeEndpointService --- tests/task_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/task_service.py b/tests/task_service.py index 8411233c..ebad190d 100644 --- a/tests/task_service.py +++ b/tests/task_service.py @@ -14,7 +14,7 @@ _test_auth_token = "THIS_IS_A_TEST_AUTH_TOKEN" -class FakeRing(endpoint_grpc.EndpointServiceServicer): +class FakeEndpointService(endpoint_grpc.EndpointServiceServicer): def __init__(self): super().__init__() self.current_partition = 1 @@ -93,7 +93,7 @@ def __init__(self): self.port = self.server.add_insecure_port("127.0.0.1:0") - self.servicer = FakeRing() + self.servicer = FakeEndpointService() endpoint_grpc.add_EndpointServiceServicer_to_server(self.servicer, self.server) self.server.start()