isolate 0.22.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. isolate/__init__.py +3 -0
  2. isolate/_isolate_version.py +34 -0
  3. isolate/_version.py +6 -0
  4. isolate/backends/__init__.py +2 -0
  5. isolate/backends/_base.py +132 -0
  6. isolate/backends/common.py +259 -0
  7. isolate/backends/conda.py +215 -0
  8. isolate/backends/container.py +64 -0
  9. isolate/backends/local.py +46 -0
  10. isolate/backends/pyenv.py +143 -0
  11. isolate/backends/remote.py +141 -0
  12. isolate/backends/settings.py +121 -0
  13. isolate/backends/virtualenv.py +204 -0
  14. isolate/common/__init__.py +0 -0
  15. isolate/common/timestamp.py +15 -0
  16. isolate/connections/__init__.py +21 -0
  17. isolate/connections/_local/__init__.py +2 -0
  18. isolate/connections/_local/_base.py +190 -0
  19. isolate/connections/_local/agent_startup.py +53 -0
  20. isolate/connections/common.py +121 -0
  21. isolate/connections/grpc/__init__.py +1 -0
  22. isolate/connections/grpc/_base.py +175 -0
  23. isolate/connections/grpc/agent.py +284 -0
  24. isolate/connections/grpc/configuration.py +23 -0
  25. isolate/connections/grpc/definitions/__init__.py +11 -0
  26. isolate/connections/grpc/definitions/agent.proto +18 -0
  27. isolate/connections/grpc/definitions/agent_pb2.py +29 -0
  28. isolate/connections/grpc/definitions/agent_pb2.pyi +44 -0
  29. isolate/connections/grpc/definitions/agent_pb2_grpc.py +68 -0
  30. isolate/connections/grpc/definitions/common.proto +49 -0
  31. isolate/connections/grpc/definitions/common_pb2.py +35 -0
  32. isolate/connections/grpc/definitions/common_pb2.pyi +152 -0
  33. isolate/connections/grpc/definitions/common_pb2_grpc.py +4 -0
  34. isolate/connections/grpc/interface.py +71 -0
  35. isolate/connections/ipc/__init__.py +5 -0
  36. isolate/connections/ipc/_base.py +225 -0
  37. isolate/connections/ipc/agent.py +205 -0
  38. isolate/logger.py +53 -0
  39. isolate/logs.py +76 -0
  40. isolate/py.typed +0 -0
  41. isolate/registry.py +53 -0
  42. isolate/server/__init__.py +1 -0
  43. isolate/server/definitions/__init__.py +13 -0
  44. isolate/server/definitions/server.proto +80 -0
  45. isolate/server/definitions/server_pb2.py +56 -0
  46. isolate/server/definitions/server_pb2.pyi +241 -0
  47. isolate/server/definitions/server_pb2_grpc.py +205 -0
  48. isolate/server/health/__init__.py +11 -0
  49. isolate/server/health/health.proto +23 -0
  50. isolate/server/health/health_pb2.py +32 -0
  51. isolate/server/health/health_pb2.pyi +66 -0
  52. isolate/server/health/health_pb2_grpc.py +99 -0
  53. isolate/server/health_server.py +40 -0
  54. isolate/server/interface.py +27 -0
  55. isolate/server/server.py +735 -0
  56. isolate-0.22.0.dist-info/METADATA +88 -0
  57. isolate-0.22.0.dist-info/RECORD +61 -0
  58. isolate-0.22.0.dist-info/WHEEL +5 -0
  59. isolate-0.22.0.dist-info/entry_points.txt +7 -0
  60. isolate-0.22.0.dist-info/licenses/LICENSE +201 -0
  61. isolate-0.22.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,241 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ """
5
+ import builtins
6
+ import collections.abc
7
+ from isolate.connections.grpc.definitions import common_pb2
8
+ import google.protobuf.descriptor
9
+ import google.protobuf.internal.containers
10
+ import google.protobuf.message
11
+ import google.protobuf.struct_pb2
12
+ import sys
13
+
14
+ if sys.version_info >= (3, 8):
15
+ import typing as typing_extensions
16
+ else:
17
+ import typing_extensions
18
+
19
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
20
+
21
+ @typing_extensions.final
22
+ class BoundFunction(google.protobuf.message.Message):
23
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
24
+
25
+ ENVIRONMENTS_FIELD_NUMBER: builtins.int
26
+ FUNCTION_FIELD_NUMBER: builtins.int
27
+ SETUP_FUNC_FIELD_NUMBER: builtins.int
28
+ STREAM_LOGS_FIELD_NUMBER: builtins.int
29
+ @property
30
+ def environments(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnvironmentDefinition]: ...
31
+ @property
32
+ def function(self) -> common_pb2.SerializedObject: ...
33
+ @property
34
+ def setup_func(self) -> common_pb2.SerializedObject: ...
35
+ stream_logs: builtins.bool
36
+ def __init__(
37
+ self,
38
+ *,
39
+ environments: collections.abc.Iterable[global___EnvironmentDefinition] | None = ...,
40
+ function: common_pb2.SerializedObject | None = ...,
41
+ setup_func: common_pb2.SerializedObject | None = ...,
42
+ stream_logs: builtins.bool = ...,
43
+ ) -> None: ...
44
+ def HasField(self, field_name: typing_extensions.Literal["_setup_func", b"_setup_func", "function", b"function", "setup_func", b"setup_func"]) -> builtins.bool: ...
45
+ def ClearField(self, field_name: typing_extensions.Literal["_setup_func", b"_setup_func", "environments", b"environments", "function", b"function", "setup_func", b"setup_func", "stream_logs", b"stream_logs"]) -> None: ...
46
+ def WhichOneof(self, oneof_group: typing_extensions.Literal["_setup_func", b"_setup_func"]) -> typing_extensions.Literal["setup_func"] | None: ...
47
+
48
+ global___BoundFunction = BoundFunction
49
+
50
+ @typing_extensions.final
51
+ class EnvironmentDefinition(google.protobuf.message.Message):
52
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
53
+
54
+ KIND_FIELD_NUMBER: builtins.int
55
+ CONFIGURATION_FIELD_NUMBER: builtins.int
56
+ FORCE_FIELD_NUMBER: builtins.int
57
+ kind: builtins.str
58
+ """Kind of the isolate environment."""
59
+ @property
60
+ def configuration(self) -> google.protobuf.struct_pb2.Struct:
61
+ """A free-form definition of environment properties."""
62
+ force: builtins.bool
63
+ """Whether to force-create this environment or not."""
64
+ def __init__(
65
+ self,
66
+ *,
67
+ kind: builtins.str = ...,
68
+ configuration: google.protobuf.struct_pb2.Struct | None = ...,
69
+ force: builtins.bool = ...,
70
+ ) -> None: ...
71
+ def HasField(self, field_name: typing_extensions.Literal["configuration", b"configuration"]) -> builtins.bool: ...
72
+ def ClearField(self, field_name: typing_extensions.Literal["configuration", b"configuration", "force", b"force", "kind", b"kind"]) -> None: ...
73
+
74
+ global___EnvironmentDefinition = EnvironmentDefinition
75
+
76
+ @typing_extensions.final
77
+ class SubmitRequest(google.protobuf.message.Message):
78
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
79
+
80
+ FUNCTION_FIELD_NUMBER: builtins.int
81
+ METADATA_FIELD_NUMBER: builtins.int
82
+ @property
83
+ def function(self) -> global___BoundFunction:
84
+ """The function to run."""
85
+ @property
86
+ def metadata(self) -> global___TaskMetadata:
87
+ """Task metadata."""
88
+ def __init__(
89
+ self,
90
+ *,
91
+ function: global___BoundFunction | None = ...,
92
+ metadata: global___TaskMetadata | None = ...,
93
+ ) -> None: ...
94
+ def HasField(self, field_name: typing_extensions.Literal["function", b"function", "metadata", b"metadata"]) -> builtins.bool: ...
95
+ def ClearField(self, field_name: typing_extensions.Literal["function", b"function", "metadata", b"metadata"]) -> None: ...
96
+
97
+ global___SubmitRequest = SubmitRequest
98
+
99
+ @typing_extensions.final
100
+ class TaskMetadata(google.protobuf.message.Message):
101
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
102
+
103
+ @typing_extensions.final
104
+ class LoggerLabelsEntry(google.protobuf.message.Message):
105
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
106
+
107
+ KEY_FIELD_NUMBER: builtins.int
108
+ VALUE_FIELD_NUMBER: builtins.int
109
+ key: builtins.str
110
+ value: builtins.str
111
+ def __init__(
112
+ self,
113
+ *,
114
+ key: builtins.str = ...,
115
+ value: builtins.str = ...,
116
+ ) -> None: ...
117
+ def ClearField(self, field_name: typing_extensions.Literal["key", b"key", "value", b"value"]) -> None: ...
118
+
119
+ LOGGER_LABELS_FIELD_NUMBER: builtins.int
120
+ @property
121
+ def logger_labels(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]:
122
+ """Labels to attach to the logs."""
123
+ def __init__(
124
+ self,
125
+ *,
126
+ logger_labels: collections.abc.Mapping[builtins.str, builtins.str] | None = ...,
127
+ ) -> None: ...
128
+ def ClearField(self, field_name: typing_extensions.Literal["logger_labels", b"logger_labels"]) -> None: ...
129
+
130
+ global___TaskMetadata = TaskMetadata
131
+
132
+ @typing_extensions.final
133
+ class SubmitResponse(google.protobuf.message.Message):
134
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
135
+
136
+ TASK_ID_FIELD_NUMBER: builtins.int
137
+ task_id: builtins.str
138
+ def __init__(
139
+ self,
140
+ *,
141
+ task_id: builtins.str = ...,
142
+ ) -> None: ...
143
+ def ClearField(self, field_name: typing_extensions.Literal["task_id", b"task_id"]) -> None: ...
144
+
145
+ global___SubmitResponse = SubmitResponse
146
+
147
+ @typing_extensions.final
148
+ class SetMetadataRequest(google.protobuf.message.Message):
149
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
150
+
151
+ TASK_ID_FIELD_NUMBER: builtins.int
152
+ METADATA_FIELD_NUMBER: builtins.int
153
+ task_id: builtins.str
154
+ @property
155
+ def metadata(self) -> global___TaskMetadata: ...
156
+ def __init__(
157
+ self,
158
+ *,
159
+ task_id: builtins.str = ...,
160
+ metadata: global___TaskMetadata | None = ...,
161
+ ) -> None: ...
162
+ def HasField(self, field_name: typing_extensions.Literal["metadata", b"metadata"]) -> builtins.bool: ...
163
+ def ClearField(self, field_name: typing_extensions.Literal["metadata", b"metadata", "task_id", b"task_id"]) -> None: ...
164
+
165
+ global___SetMetadataRequest = SetMetadataRequest
166
+
167
+ @typing_extensions.final
168
+ class SetMetadataResponse(google.protobuf.message.Message):
169
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
170
+
171
+ def __init__(
172
+ self,
173
+ ) -> None: ...
174
+
175
+ global___SetMetadataResponse = SetMetadataResponse
176
+
177
+ @typing_extensions.final
178
+ class ListRequest(google.protobuf.message.Message):
179
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
180
+
181
+ def __init__(
182
+ self,
183
+ ) -> None: ...
184
+
185
+ global___ListRequest = ListRequest
186
+
187
+ @typing_extensions.final
188
+ class TaskInfo(google.protobuf.message.Message):
189
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
190
+
191
+ TASK_ID_FIELD_NUMBER: builtins.int
192
+ task_id: builtins.str
193
+ def __init__(
194
+ self,
195
+ *,
196
+ task_id: builtins.str = ...,
197
+ ) -> None: ...
198
+ def ClearField(self, field_name: typing_extensions.Literal["task_id", b"task_id"]) -> None: ...
199
+
200
+ global___TaskInfo = TaskInfo
201
+
202
+ @typing_extensions.final
203
+ class ListResponse(google.protobuf.message.Message):
204
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
205
+
206
+ TASKS_FIELD_NUMBER: builtins.int
207
+ @property
208
+ def tasks(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___TaskInfo]: ...
209
+ def __init__(
210
+ self,
211
+ *,
212
+ tasks: collections.abc.Iterable[global___TaskInfo] | None = ...,
213
+ ) -> None: ...
214
+ def ClearField(self, field_name: typing_extensions.Literal["tasks", b"tasks"]) -> None: ...
215
+
216
+ global___ListResponse = ListResponse
217
+
218
+ @typing_extensions.final
219
+ class CancelRequest(google.protobuf.message.Message):
220
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
221
+
222
+ TASK_ID_FIELD_NUMBER: builtins.int
223
+ task_id: builtins.str
224
+ def __init__(
225
+ self,
226
+ *,
227
+ task_id: builtins.str = ...,
228
+ ) -> None: ...
229
+ def ClearField(self, field_name: typing_extensions.Literal["task_id", b"task_id"]) -> None: ...
230
+
231
+ global___CancelRequest = CancelRequest
232
+
233
+ @typing_extensions.final
234
+ class CancelResponse(google.protobuf.message.Message):
235
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
236
+
237
+ def __init__(
238
+ self,
239
+ ) -> None: ...
240
+
241
+ global___CancelResponse = CancelResponse
@@ -0,0 +1,205 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+
5
+ from isolate.connections.grpc.definitions import common_pb2 as common__pb2
6
+ from isolate.server.definitions import server_pb2 as server__pb2
7
+
8
+
9
+ class IsolateStub(object):
10
+ """Missing associated documentation comment in .proto file."""
11
+
12
+ def __init__(self, channel):
13
+ """Constructor.
14
+
15
+ Args:
16
+ channel: A grpc.Channel.
17
+ """
18
+ self.Run = channel.unary_stream(
19
+ '/Isolate/Run',
20
+ request_serializer=server__pb2.BoundFunction.SerializeToString,
21
+ response_deserializer=common__pb2.PartialRunResult.FromString,
22
+ )
23
+ self.Submit = channel.unary_unary(
24
+ '/Isolate/Submit',
25
+ request_serializer=server__pb2.SubmitRequest.SerializeToString,
26
+ response_deserializer=server__pb2.SubmitResponse.FromString,
27
+ )
28
+ self.SetMetadata = channel.unary_unary(
29
+ '/Isolate/SetMetadata',
30
+ request_serializer=server__pb2.SetMetadataRequest.SerializeToString,
31
+ response_deserializer=server__pb2.SetMetadataResponse.FromString,
32
+ )
33
+ self.List = channel.unary_unary(
34
+ '/Isolate/List',
35
+ request_serializer=server__pb2.ListRequest.SerializeToString,
36
+ response_deserializer=server__pb2.ListResponse.FromString,
37
+ )
38
+ self.Cancel = channel.unary_unary(
39
+ '/Isolate/Cancel',
40
+ request_serializer=server__pb2.CancelRequest.SerializeToString,
41
+ response_deserializer=server__pb2.CancelResponse.FromString,
42
+ )
43
+
44
+
45
+ class IsolateServicer(object):
46
+ """Missing associated documentation comment in .proto file."""
47
+
48
+ def Run(self, request, context):
49
+ """Run the given function on the specified environment. Streams logs
50
+ and the result originating from that function.
51
+ """
52
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
53
+ context.set_details('Method not implemented!')
54
+ raise NotImplementedError('Method not implemented!')
55
+
56
+ def Submit(self, request, context):
57
+ """Submit a function to be run without waiting for results.
58
+ """
59
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
60
+ context.set_details('Method not implemented!')
61
+ raise NotImplementedError('Method not implemented!')
62
+
63
+ def SetMetadata(self, request, context):
64
+ """Set the metadata for a task.
65
+ """
66
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
67
+ context.set_details('Method not implemented!')
68
+ raise NotImplementedError('Method not implemented!')
69
+
70
+ def List(self, request, context):
71
+ """List running tasks
72
+ """
73
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
74
+ context.set_details('Method not implemented!')
75
+ raise NotImplementedError('Method not implemented!')
76
+
77
+ def Cancel(self, request, context):
78
+ """Cancel a running task
79
+ """
80
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
81
+ context.set_details('Method not implemented!')
82
+ raise NotImplementedError('Method not implemented!')
83
+
84
+
85
+ def add_IsolateServicer_to_server(servicer, server):
86
+ rpc_method_handlers = {
87
+ 'Run': grpc.unary_stream_rpc_method_handler(
88
+ servicer.Run,
89
+ request_deserializer=server__pb2.BoundFunction.FromString,
90
+ response_serializer=common__pb2.PartialRunResult.SerializeToString,
91
+ ),
92
+ 'Submit': grpc.unary_unary_rpc_method_handler(
93
+ servicer.Submit,
94
+ request_deserializer=server__pb2.SubmitRequest.FromString,
95
+ response_serializer=server__pb2.SubmitResponse.SerializeToString,
96
+ ),
97
+ 'SetMetadata': grpc.unary_unary_rpc_method_handler(
98
+ servicer.SetMetadata,
99
+ request_deserializer=server__pb2.SetMetadataRequest.FromString,
100
+ response_serializer=server__pb2.SetMetadataResponse.SerializeToString,
101
+ ),
102
+ 'List': grpc.unary_unary_rpc_method_handler(
103
+ servicer.List,
104
+ request_deserializer=server__pb2.ListRequest.FromString,
105
+ response_serializer=server__pb2.ListResponse.SerializeToString,
106
+ ),
107
+ 'Cancel': grpc.unary_unary_rpc_method_handler(
108
+ servicer.Cancel,
109
+ request_deserializer=server__pb2.CancelRequest.FromString,
110
+ response_serializer=server__pb2.CancelResponse.SerializeToString,
111
+ ),
112
+ }
113
+ generic_handler = grpc.method_handlers_generic_handler(
114
+ 'Isolate', rpc_method_handlers)
115
+ server.add_generic_rpc_handlers((generic_handler,))
116
+
117
+
118
+ # This class is part of an EXPERIMENTAL API.
119
+ class Isolate(object):
120
+ """Missing associated documentation comment in .proto file."""
121
+
122
+ @staticmethod
123
+ def Run(request,
124
+ target,
125
+ options=(),
126
+ channel_credentials=None,
127
+ call_credentials=None,
128
+ insecure=False,
129
+ compression=None,
130
+ wait_for_ready=None,
131
+ timeout=None,
132
+ metadata=None):
133
+ return grpc.experimental.unary_stream(request, target, '/Isolate/Run',
134
+ server__pb2.BoundFunction.SerializeToString,
135
+ common__pb2.PartialRunResult.FromString,
136
+ options, channel_credentials,
137
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
138
+
139
+ @staticmethod
140
+ def Submit(request,
141
+ target,
142
+ options=(),
143
+ channel_credentials=None,
144
+ call_credentials=None,
145
+ insecure=False,
146
+ compression=None,
147
+ wait_for_ready=None,
148
+ timeout=None,
149
+ metadata=None):
150
+ return grpc.experimental.unary_unary(request, target, '/Isolate/Submit',
151
+ server__pb2.SubmitRequest.SerializeToString,
152
+ server__pb2.SubmitResponse.FromString,
153
+ options, channel_credentials,
154
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
155
+
156
+ @staticmethod
157
+ def SetMetadata(request,
158
+ target,
159
+ options=(),
160
+ channel_credentials=None,
161
+ call_credentials=None,
162
+ insecure=False,
163
+ compression=None,
164
+ wait_for_ready=None,
165
+ timeout=None,
166
+ metadata=None):
167
+ return grpc.experimental.unary_unary(request, target, '/Isolate/SetMetadata',
168
+ server__pb2.SetMetadataRequest.SerializeToString,
169
+ server__pb2.SetMetadataResponse.FromString,
170
+ options, channel_credentials,
171
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
172
+
173
+ @staticmethod
174
+ def List(request,
175
+ target,
176
+ options=(),
177
+ channel_credentials=None,
178
+ call_credentials=None,
179
+ insecure=False,
180
+ compression=None,
181
+ wait_for_ready=None,
182
+ timeout=None,
183
+ metadata=None):
184
+ return grpc.experimental.unary_unary(request, target, '/Isolate/List',
185
+ server__pb2.ListRequest.SerializeToString,
186
+ server__pb2.ListResponse.FromString,
187
+ options, channel_credentials,
188
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
189
+
190
+ @staticmethod
191
+ def Cancel(request,
192
+ target,
193
+ options=(),
194
+ channel_credentials=None,
195
+ call_credentials=None,
196
+ insecure=False,
197
+ compression=None,
198
+ wait_for_ready=None,
199
+ timeout=None,
200
+ metadata=None):
201
+ return grpc.experimental.unary_unary(request, target, '/Isolate/Cancel',
202
+ server__pb2.CancelRequest.SerializeToString,
203
+ server__pb2.CancelResponse.FromString,
204
+ options, channel_credentials,
205
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@@ -0,0 +1,11 @@
1
+ from isolate.server.health.health_pb2 import ( # noqa: F401
2
+ HealthCheckRequest,
3
+ HealthCheckResponse,
4
+ )
5
+ from isolate.server.health.health_pb2_grpc import ( # noqa: F401
6
+ HealthServicer,
7
+ HealthStub,
8
+ )
9
+ from isolate.server.health.health_pb2_grpc import ( # noqa: F401
10
+ add_HealthServicer_to_server as register_health,
11
+ )
@@ -0,0 +1,23 @@
1
+ syntax = "proto3";
2
+
3
+ package grpc.health.v1;
4
+
5
+ message HealthCheckRequest {
6
+ string service = 1;
7
+ }
8
+
9
+ message HealthCheckResponse {
10
+ enum ServingStatus {
11
+ UNKNOWN = 0;
12
+ SERVING = 1;
13
+ NOT_SERVING = 2;
14
+ SERVICE_UNKNOWN = 3; // Used only by the Watch method.
15
+ }
16
+ ServingStatus status = 1;
17
+ }
18
+
19
+ service Health {
20
+ rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
21
+
22
+ rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse);
23
+ }
@@ -0,0 +1,32 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: health.proto
4
+ # Protobuf Python Version: 4.25.1
5
+ """Generated protocol buffer code."""
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ from google.protobuf.internal import builder as _builder
10
+ # @@protoc_insertion_point(imports)
11
+
12
+ _sym_db = _symbol_database.Default()
13
+
14
+
15
+
16
+
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0chealth.proto\x12\x0egrpc.health.v1\"%\n\x12HealthCheckRequest\x12\x0f\n\x07service\x18\x01 \x01(\t\"\xa9\x01\n\x13HealthCheckResponse\x12\x41\n\x06status\x18\x01 \x01(\x0e\x32\x31.grpc.health.v1.HealthCheckResponse.ServingStatus\"O\n\rServingStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07SERVING\x10\x01\x12\x0f\n\x0bNOT_SERVING\x10\x02\x12\x13\n\x0fSERVICE_UNKNOWN\x10\x03\x32\xae\x01\n\x06Health\x12P\n\x05\x43heck\x12\".grpc.health.v1.HealthCheckRequest\x1a#.grpc.health.v1.HealthCheckResponse\x12R\n\x05Watch\x12\".grpc.health.v1.HealthCheckRequest\x1a#.grpc.health.v1.HealthCheckResponse0\x01\x62\x06proto3')
18
+
19
+ _globals = globals()
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'health_pb2', _globals)
22
+ if _descriptor._USE_C_DESCRIPTORS == False:
23
+ DESCRIPTOR._options = None
24
+ _globals['_HEALTHCHECKREQUEST']._serialized_start=32
25
+ _globals['_HEALTHCHECKREQUEST']._serialized_end=69
26
+ _globals['_HEALTHCHECKRESPONSE']._serialized_start=72
27
+ _globals['_HEALTHCHECKRESPONSE']._serialized_end=241
28
+ _globals['_HEALTHCHECKRESPONSE_SERVINGSTATUS']._serialized_start=162
29
+ _globals['_HEALTHCHECKRESPONSE_SERVINGSTATUS']._serialized_end=241
30
+ _globals['_HEALTH']._serialized_start=244
31
+ _globals['_HEALTH']._serialized_end=418
32
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,66 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ """
5
+ import builtins
6
+ import google.protobuf.descriptor
7
+ import google.protobuf.internal.enum_type_wrapper
8
+ import google.protobuf.message
9
+ import sys
10
+ import typing
11
+
12
+ if sys.version_info >= (3, 10):
13
+ import typing as typing_extensions
14
+ else:
15
+ import typing_extensions
16
+
17
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
18
+
19
+ @typing_extensions.final
20
+ class HealthCheckRequest(google.protobuf.message.Message):
21
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
22
+
23
+ SERVICE_FIELD_NUMBER: builtins.int
24
+ service: builtins.str
25
+ def __init__(
26
+ self,
27
+ *,
28
+ service: builtins.str = ...,
29
+ ) -> None: ...
30
+ def ClearField(self, field_name: typing_extensions.Literal["service", b"service"]) -> None: ...
31
+
32
+ global___HealthCheckRequest = HealthCheckRequest
33
+
34
+ @typing_extensions.final
35
+ class HealthCheckResponse(google.protobuf.message.Message):
36
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
37
+
38
+ class _ServingStatus:
39
+ ValueType = typing.NewType("ValueType", builtins.int)
40
+ V: typing_extensions.TypeAlias = ValueType
41
+
42
+ class _ServingStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[HealthCheckResponse._ServingStatus.ValueType], builtins.type):
43
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
44
+ UNKNOWN: HealthCheckResponse._ServingStatus.ValueType # 0
45
+ SERVING: HealthCheckResponse._ServingStatus.ValueType # 1
46
+ NOT_SERVING: HealthCheckResponse._ServingStatus.ValueType # 2
47
+ SERVICE_UNKNOWN: HealthCheckResponse._ServingStatus.ValueType # 3
48
+ """Used only by the Watch method."""
49
+
50
+ class ServingStatus(_ServingStatus, metaclass=_ServingStatusEnumTypeWrapper): ...
51
+ UNKNOWN: HealthCheckResponse.ServingStatus.ValueType # 0
52
+ SERVING: HealthCheckResponse.ServingStatus.ValueType # 1
53
+ NOT_SERVING: HealthCheckResponse.ServingStatus.ValueType # 2
54
+ SERVICE_UNKNOWN: HealthCheckResponse.ServingStatus.ValueType # 3
55
+ """Used only by the Watch method."""
56
+
57
+ STATUS_FIELD_NUMBER: builtins.int
58
+ status: global___HealthCheckResponse.ServingStatus.ValueType
59
+ def __init__(
60
+ self,
61
+ *,
62
+ status: global___HealthCheckResponse.ServingStatus.ValueType = ...,
63
+ ) -> None: ...
64
+ def ClearField(self, field_name: typing_extensions.Literal["status", b"status"]) -> None: ...
65
+
66
+ global___HealthCheckResponse = HealthCheckResponse
@@ -0,0 +1,99 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+
5
+ from isolate.server.health import health_pb2 as health__pb2
6
+
7
+
8
+ class HealthStub(object):
9
+ """Missing associated documentation comment in .proto file."""
10
+
11
+ def __init__(self, channel):
12
+ """Constructor.
13
+
14
+ Args:
15
+ channel: A grpc.Channel.
16
+ """
17
+ self.Check = channel.unary_unary(
18
+ '/grpc.health.v1.Health/Check',
19
+ request_serializer=health__pb2.HealthCheckRequest.SerializeToString,
20
+ response_deserializer=health__pb2.HealthCheckResponse.FromString,
21
+ )
22
+ self.Watch = channel.unary_stream(
23
+ '/grpc.health.v1.Health/Watch',
24
+ request_serializer=health__pb2.HealthCheckRequest.SerializeToString,
25
+ response_deserializer=health__pb2.HealthCheckResponse.FromString,
26
+ )
27
+
28
+
29
+ class HealthServicer(object):
30
+ """Missing associated documentation comment in .proto file."""
31
+
32
+ def Check(self, request, context):
33
+ """Missing associated documentation comment in .proto file."""
34
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
35
+ context.set_details('Method not implemented!')
36
+ raise NotImplementedError('Method not implemented!')
37
+
38
+ def Watch(self, request, context):
39
+ """Missing associated documentation comment in .proto file."""
40
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
41
+ context.set_details('Method not implemented!')
42
+ raise NotImplementedError('Method not implemented!')
43
+
44
+
45
+ def add_HealthServicer_to_server(servicer, server):
46
+ rpc_method_handlers = {
47
+ 'Check': grpc.unary_unary_rpc_method_handler(
48
+ servicer.Check,
49
+ request_deserializer=health__pb2.HealthCheckRequest.FromString,
50
+ response_serializer=health__pb2.HealthCheckResponse.SerializeToString,
51
+ ),
52
+ 'Watch': grpc.unary_stream_rpc_method_handler(
53
+ servicer.Watch,
54
+ request_deserializer=health__pb2.HealthCheckRequest.FromString,
55
+ response_serializer=health__pb2.HealthCheckResponse.SerializeToString,
56
+ ),
57
+ }
58
+ generic_handler = grpc.method_handlers_generic_handler(
59
+ 'grpc.health.v1.Health', rpc_method_handlers)
60
+ server.add_generic_rpc_handlers((generic_handler,))
61
+
62
+
63
+ # This class is part of an EXPERIMENTAL API.
64
+ class Health(object):
65
+ """Missing associated documentation comment in .proto file."""
66
+
67
+ @staticmethod
68
+ def Check(request,
69
+ target,
70
+ options=(),
71
+ channel_credentials=None,
72
+ call_credentials=None,
73
+ insecure=False,
74
+ compression=None,
75
+ wait_for_ready=None,
76
+ timeout=None,
77
+ metadata=None):
78
+ return grpc.experimental.unary_unary(request, target, '/grpc.health.v1.Health/Check',
79
+ health__pb2.HealthCheckRequest.SerializeToString,
80
+ health__pb2.HealthCheckResponse.FromString,
81
+ options, channel_credentials,
82
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
83
+
84
+ @staticmethod
85
+ def Watch(request,
86
+ target,
87
+ options=(),
88
+ channel_credentials=None,
89
+ call_credentials=None,
90
+ insecure=False,
91
+ compression=None,
92
+ wait_for_ready=None,
93
+ timeout=None,
94
+ metadata=None):
95
+ return grpc.experimental.unary_stream(request, target, '/grpc.health.v1.Health/Watch',
96
+ health__pb2.HealthCheckRequest.SerializeToString,
97
+ health__pb2.HealthCheckResponse.FromString,
98
+ options, channel_credentials,
99
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)