gimlet-api 0.0.11__py3-none-any.whl → 0.0.13__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.
- {gimlet_api-0.0.11.dist-info → gimlet_api-0.0.13.dist-info}/METADATA +2 -1
- {gimlet_api-0.0.11.dist-info → gimlet_api-0.0.13.dist-info}/RECORD +18 -17
- gml/client.py +2 -2
- gml/compile.py +16 -1
- gml/pipelines.py +14 -6
- gml/proto/src/api/corepb/v1/controlplane_pb2.py +48 -39
- gml/proto/src/api/corepb/v1/cp_edge_pb2.py +107 -69
- gml/proto/src/api/corepb/v1/deployed_pipeline_pb2.py +31 -7
- gml/proto/src/api/corepb/v1/device_info_pb2.py +6 -6
- gml/proto/src/api/corepb/v1/mediastream_pb2.py +15 -3
- gml/proto/src/api/corepb/v1/model_exec_pb2.py +49 -45
- gml/proto/src/controlplane/directory/directorypb/v1/directory_pb2.py +50 -50
- gml/proto/src/controlplane/logicalpipeline/lppb/v1/lppb_pb2.py +31 -24
- gml/proto/src/controlplane/logicalpipeline/lppb/v1/lppb_pb2_grpc.py +33 -0
- gml/proto/src/controlplane/model/mpb/v1/mpb_pb2.py +17 -11
- gml/proto/src/controlplane/model/mpb/v1/mpb_pb2_grpc.py +33 -0
- gml/version_utils.py +43 -0
- {gimlet_api-0.0.11.dist-info → gimlet_api-0.0.13.dist-info}/WHEEL +0 -0
@@ -34,6 +34,11 @@ class LogicalPipelineServiceStub(object):
|
|
34
34
|
request_serializer=src_dot_controlplane_dot_logicalpipeline_dot_lppb_dot_v1_dot_lppb__pb2.ParseLogicalPipelineYAMLRequest.SerializeToString,
|
35
35
|
response_deserializer=src_dot_controlplane_dot_logicalpipeline_dot_lppb_dot_v1_dot_lppb__pb2.ParseLogicalPipelineYAMLResponse.FromString,
|
36
36
|
)
|
37
|
+
self.ShareLogicalPipeline = channel.unary_unary(
|
38
|
+
'/gml.internal.controlplane.logicalpipeline.v1.LogicalPipelineService/ShareLogicalPipeline',
|
39
|
+
request_serializer=src_dot_controlplane_dot_logicalpipeline_dot_lppb_dot_v1_dot_lppb__pb2.ShareLogicalPipelineRequest.SerializeToString,
|
40
|
+
response_deserializer=src_dot_controlplane_dot_logicalpipeline_dot_lppb_dot_v1_dot_lppb__pb2.ShareLogicalPipelineResponse.FromString,
|
41
|
+
)
|
37
42
|
|
38
43
|
|
39
44
|
class LogicalPipelineServiceServicer(object):
|
@@ -63,6 +68,12 @@ class LogicalPipelineServiceServicer(object):
|
|
63
68
|
context.set_details('Method not implemented!')
|
64
69
|
raise NotImplementedError('Method not implemented!')
|
65
70
|
|
71
|
+
def ShareLogicalPipeline(self, request, context):
|
72
|
+
"""Missing associated documentation comment in .proto file."""
|
73
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
74
|
+
context.set_details('Method not implemented!')
|
75
|
+
raise NotImplementedError('Method not implemented!')
|
76
|
+
|
66
77
|
|
67
78
|
def add_LogicalPipelineServiceServicer_to_server(servicer, server):
|
68
79
|
rpc_method_handlers = {
|
@@ -86,6 +97,11 @@ def add_LogicalPipelineServiceServicer_to_server(servicer, server):
|
|
86
97
|
request_deserializer=src_dot_controlplane_dot_logicalpipeline_dot_lppb_dot_v1_dot_lppb__pb2.ParseLogicalPipelineYAMLRequest.FromString,
|
87
98
|
response_serializer=src_dot_controlplane_dot_logicalpipeline_dot_lppb_dot_v1_dot_lppb__pb2.ParseLogicalPipelineYAMLResponse.SerializeToString,
|
88
99
|
),
|
100
|
+
'ShareLogicalPipeline': grpc.unary_unary_rpc_method_handler(
|
101
|
+
servicer.ShareLogicalPipeline,
|
102
|
+
request_deserializer=src_dot_controlplane_dot_logicalpipeline_dot_lppb_dot_v1_dot_lppb__pb2.ShareLogicalPipelineRequest.FromString,
|
103
|
+
response_serializer=src_dot_controlplane_dot_logicalpipeline_dot_lppb_dot_v1_dot_lppb__pb2.ShareLogicalPipelineResponse.SerializeToString,
|
104
|
+
),
|
89
105
|
}
|
90
106
|
generic_handler = grpc.method_handlers_generic_handler(
|
91
107
|
'gml.internal.controlplane.logicalpipeline.v1.LogicalPipelineService', rpc_method_handlers)
|
@@ -163,3 +179,20 @@ class LogicalPipelineService(object):
|
|
163
179
|
src_dot_controlplane_dot_logicalpipeline_dot_lppb_dot_v1_dot_lppb__pb2.ParseLogicalPipelineYAMLResponse.FromString,
|
164
180
|
options, channel_credentials,
|
165
181
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
182
|
+
|
183
|
+
@staticmethod
|
184
|
+
def ShareLogicalPipeline(request,
|
185
|
+
target,
|
186
|
+
options=(),
|
187
|
+
channel_credentials=None,
|
188
|
+
call_credentials=None,
|
189
|
+
insecure=False,
|
190
|
+
compression=None,
|
191
|
+
wait_for_ready=None,
|
192
|
+
timeout=None,
|
193
|
+
metadata=None):
|
194
|
+
return grpc.experimental.unary_unary(request, target, '/gml.internal.controlplane.logicalpipeline.v1.LogicalPipelineService/ShareLogicalPipeline',
|
195
|
+
src_dot_controlplane_dot_logicalpipeline_dot_lppb_dot_v1_dot_lppb__pb2.ShareLogicalPipelineRequest.SerializeToString,
|
196
|
+
src_dot_controlplane_dot_logicalpipeline_dot_lppb_dot_v1_dot_lppb__pb2.ShareLogicalPipelineResponse.FromString,
|
197
|
+
options, channel_credentials,
|
198
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
@@ -16,7 +16,7 @@ from gml.proto.src.common.typespb import uuid_pb2 as src_dot_common_dot_typespb_
|
|
16
16
|
from gml.proto.src.api.corepb.v1 import model_exec_pb2 as src_dot_api_dot_corepb_dot_v1_dot_model__exec__pb2
|
17
17
|
|
18
18
|
|
19
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'src/controlplane/model/mpb/v1/mpb.proto\x12\"gml.internal.controlplane.model.v1\x1a\x14gogoproto/gogo.proto\x1a\x1dsrc/common/typespb/uuid.proto\x1a\"src/api/corepb/v1/model_exec.proto\"\
|
19
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'src/controlplane/model/mpb/v1/mpb.proto\x12\"gml.internal.controlplane.model.v1\x1a\x14gogoproto/gogo.proto\x1a\x1dsrc/common/typespb/uuid.proto\x1a\"src/api/corepb/v1/model_exec.proto\"\x9e\x01\n\x0fGetModelRequest\x12\'\n\x02id\x18\x01 \x01(\x0b\x32\x0f.gml.types.UUIDB\x06\xe2\xde\x1f\x02IDR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12\x33\n\x06org_id\x18\x03 \x01(\x0b\x32\x0f.gml.types.UUIDB\x0b\x18\x01\xe2\xde\x1f\x05OrgIDR\x05orgId\x12\x19\n\x08org_name\x18\x04 \x01(\tR\x07orgName\"\x7f\n\x10GetModelResponse\x12\x42\n\nmodel_info\x18\x01 \x01(\x0b\x32#.gml.internal.api.core.v1.ModelInfoR\tmodelInfo\x12\'\n\x02id\x18\x02 \x01(\x0b\x32\x0f.gml.types.UUIDB\x06\xe2\xde\x1f\x02IDR\x02id\"\x9f\x01\n\x12\x43reateModelRequest\x12\x31\n\x06org_id\x18\x01 \x01(\x0b\x32\x0f.gml.types.UUIDB\t\xe2\xde\x1f\x05OrgIDR\x05orgId\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12\x42\n\nmodel_info\x18\x03 \x01(\x0b\x32#.gml.internal.api.core.v1.ModelInfoR\tmodelInfo\">\n\x13\x43reateModelResponse\x12\'\n\x02id\x18\x01 \x01(\x0b\x32\x0f.gml.types.UUIDB\x06\xe2\xde\x1f\x02IDR\x02id\"\x94\x01\n\x11ShareModelRequest\x12\'\n\x02id\x18\x01 \x01(\x0b\x32\x0f.gml.types.UUIDB\x06\xe2\xde\x1f\x02IDR\x02id\x12\x1a\n\x08relation\x18\x02 \x01(\tR\x08relation\x12\x1b\n\tall_users\x18\x03 \x01(\x08R\x08\x61llUsers\x12\x1d\n\nuser_email\x18\x04 \x01(\tR\tuserEmail\"\x14\n\x12ShareModelResponse2\x82\x03\n\x0cModelService\x12u\n\x08GetModel\x12\x33.gml.internal.controlplane.model.v1.GetModelRequest\x1a\x34.gml.internal.controlplane.model.v1.GetModelResponse\x12~\n\x0b\x43reateModel\x12\x36.gml.internal.controlplane.model.v1.CreateModelRequest\x1a\x37.gml.internal.controlplane.model.v1.CreateModelResponse\x12{\n\nShareModel\x12\x35.gml.internal.controlplane.model.v1.ShareModelRequest\x1a\x36.gml.internal.controlplane.model.v1.ShareModelResponseB8Z6gimletlabs.ai/gimlet/src/controlplane/model/mpb/v1;mpbb\x06proto3')
|
20
20
|
|
21
21
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
22
22
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'src.controlplane.model.mpb.v1.mpb_pb2', globals())
|
@@ -27,21 +27,27 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
27
27
|
_GETMODELREQUEST.fields_by_name['id']._options = None
|
28
28
|
_GETMODELREQUEST.fields_by_name['id']._serialized_options = b'\342\336\037\002ID'
|
29
29
|
_GETMODELREQUEST.fields_by_name['org_id']._options = None
|
30
|
-
_GETMODELREQUEST.fields_by_name['org_id']._serialized_options = b'\342\336\037\005OrgID'
|
30
|
+
_GETMODELREQUEST.fields_by_name['org_id']._serialized_options = b'\030\001\342\336\037\005OrgID'
|
31
31
|
_GETMODELRESPONSE.fields_by_name['id']._options = None
|
32
32
|
_GETMODELRESPONSE.fields_by_name['id']._serialized_options = b'\342\336\037\002ID'
|
33
33
|
_CREATEMODELREQUEST.fields_by_name['org_id']._options = None
|
34
34
|
_CREATEMODELREQUEST.fields_by_name['org_id']._serialized_options = b'\342\336\037\005OrgID'
|
35
35
|
_CREATEMODELRESPONSE.fields_by_name['id']._options = None
|
36
36
|
_CREATEMODELRESPONSE.fields_by_name['id']._serialized_options = b'\342\336\037\002ID'
|
37
|
+
_SHAREMODELREQUEST.fields_by_name['id']._options = None
|
38
|
+
_SHAREMODELREQUEST.fields_by_name['id']._serialized_options = b'\342\336\037\002ID'
|
37
39
|
_GETMODELREQUEST._serialized_start=169
|
38
|
-
_GETMODELREQUEST._serialized_end=
|
39
|
-
_GETMODELRESPONSE._serialized_start=
|
40
|
-
_GETMODELRESPONSE._serialized_end=
|
41
|
-
_CREATEMODELREQUEST._serialized_start=
|
42
|
-
_CREATEMODELREQUEST._serialized_end=
|
43
|
-
_CREATEMODELRESPONSE._serialized_start=
|
44
|
-
_CREATEMODELRESPONSE._serialized_end=
|
45
|
-
|
46
|
-
|
40
|
+
_GETMODELREQUEST._serialized_end=327
|
41
|
+
_GETMODELRESPONSE._serialized_start=329
|
42
|
+
_GETMODELRESPONSE._serialized_end=456
|
43
|
+
_CREATEMODELREQUEST._serialized_start=459
|
44
|
+
_CREATEMODELREQUEST._serialized_end=618
|
45
|
+
_CREATEMODELRESPONSE._serialized_start=620
|
46
|
+
_CREATEMODELRESPONSE._serialized_end=682
|
47
|
+
_SHAREMODELREQUEST._serialized_start=685
|
48
|
+
_SHAREMODELREQUEST._serialized_end=833
|
49
|
+
_SHAREMODELRESPONSE._serialized_start=835
|
50
|
+
_SHAREMODELRESPONSE._serialized_end=855
|
51
|
+
_MODELSERVICE._serialized_start=858
|
52
|
+
_MODELSERVICE._serialized_end=1244
|
47
53
|
# @@protoc_insertion_point(module_scope)
|
@@ -24,6 +24,11 @@ class ModelServiceStub(object):
|
|
24
24
|
request_serializer=src_dot_controlplane_dot_model_dot_mpb_dot_v1_dot_mpb__pb2.CreateModelRequest.SerializeToString,
|
25
25
|
response_deserializer=src_dot_controlplane_dot_model_dot_mpb_dot_v1_dot_mpb__pb2.CreateModelResponse.FromString,
|
26
26
|
)
|
27
|
+
self.ShareModel = channel.unary_unary(
|
28
|
+
'/gml.internal.controlplane.model.v1.ModelService/ShareModel',
|
29
|
+
request_serializer=src_dot_controlplane_dot_model_dot_mpb_dot_v1_dot_mpb__pb2.ShareModelRequest.SerializeToString,
|
30
|
+
response_deserializer=src_dot_controlplane_dot_model_dot_mpb_dot_v1_dot_mpb__pb2.ShareModelResponse.FromString,
|
31
|
+
)
|
27
32
|
|
28
33
|
|
29
34
|
class ModelServiceServicer(object):
|
@@ -41,6 +46,12 @@ class ModelServiceServicer(object):
|
|
41
46
|
context.set_details('Method not implemented!')
|
42
47
|
raise NotImplementedError('Method not implemented!')
|
43
48
|
|
49
|
+
def ShareModel(self, request, context):
|
50
|
+
"""Missing associated documentation comment in .proto file."""
|
51
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
52
|
+
context.set_details('Method not implemented!')
|
53
|
+
raise NotImplementedError('Method not implemented!')
|
54
|
+
|
44
55
|
|
45
56
|
def add_ModelServiceServicer_to_server(servicer, server):
|
46
57
|
rpc_method_handlers = {
|
@@ -54,6 +65,11 @@ def add_ModelServiceServicer_to_server(servicer, server):
|
|
54
65
|
request_deserializer=src_dot_controlplane_dot_model_dot_mpb_dot_v1_dot_mpb__pb2.CreateModelRequest.FromString,
|
55
66
|
response_serializer=src_dot_controlplane_dot_model_dot_mpb_dot_v1_dot_mpb__pb2.CreateModelResponse.SerializeToString,
|
56
67
|
),
|
68
|
+
'ShareModel': grpc.unary_unary_rpc_method_handler(
|
69
|
+
servicer.ShareModel,
|
70
|
+
request_deserializer=src_dot_controlplane_dot_model_dot_mpb_dot_v1_dot_mpb__pb2.ShareModelRequest.FromString,
|
71
|
+
response_serializer=src_dot_controlplane_dot_model_dot_mpb_dot_v1_dot_mpb__pb2.ShareModelResponse.SerializeToString,
|
72
|
+
),
|
57
73
|
}
|
58
74
|
generic_handler = grpc.method_handlers_generic_handler(
|
59
75
|
'gml.internal.controlplane.model.v1.ModelService', rpc_method_handlers)
|
@@ -97,3 +113,20 @@ class ModelService(object):
|
|
97
113
|
src_dot_controlplane_dot_model_dot_mpb_dot_v1_dot_mpb__pb2.CreateModelResponse.FromString,
|
98
114
|
options, channel_credentials,
|
99
115
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
116
|
+
|
117
|
+
@staticmethod
|
118
|
+
def ShareModel(request,
|
119
|
+
target,
|
120
|
+
options=(),
|
121
|
+
channel_credentials=None,
|
122
|
+
call_credentials=None,
|
123
|
+
insecure=False,
|
124
|
+
compression=None,
|
125
|
+
wait_for_ready=None,
|
126
|
+
timeout=None,
|
127
|
+
metadata=None):
|
128
|
+
return grpc.experimental.unary_unary(request, target, '/gml.internal.controlplane.model.v1.ModelService/ShareModel',
|
129
|
+
src_dot_controlplane_dot_model_dot_mpb_dot_v1_dot_mpb__pb2.ShareModelRequest.SerializeToString,
|
130
|
+
src_dot_controlplane_dot_model_dot_mpb_dot_v1_dot_mpb__pb2.ShareModelResponse.FromString,
|
131
|
+
options, channel_credentials,
|
132
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
gml/version_utils.py
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Copyright 2023- Gimlet Labs, Inc.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
#
|
15
|
+
# SPDX-License-Identifier: Apache-2.0
|
16
|
+
|
17
|
+
import functools
|
18
|
+
import importlib.metadata
|
19
|
+
|
20
|
+
from packaging import version
|
21
|
+
|
22
|
+
|
23
|
+
def _is_version_greater_or_equal(pkg: str, target_version: str) -> bool:
|
24
|
+
"""
|
25
|
+
Check if the installed package version is greater than or equal to the specified version.
|
26
|
+
Args:
|
27
|
+
pkg (str): The package name to check, e.g., 'torch', 'transformers'.
|
28
|
+
target_version (str): The version to compare against, in the format 'major.minor.patch'.
|
29
|
+
Returns:
|
30
|
+
bool: True if the installed package version is greater than or equal to `target_version`, False otherwise.
|
31
|
+
"""
|
32
|
+
pkg_version_w_dev = importlib.metadata.version(pkg)
|
33
|
+
# ignore dev suffixes.
|
34
|
+
pkg_version = version.parse(version.parse(pkg_version_w_dev).base_version)
|
35
|
+
return pkg_version >= version.parse(target_version)
|
36
|
+
|
37
|
+
|
38
|
+
is_torch_version_greater_or_equal = functools.partial(
|
39
|
+
_is_version_greater_or_equal, "torch"
|
40
|
+
)
|
41
|
+
is_transformers_version_greater_or_equal = functools.partial(
|
42
|
+
_is_version_greater_or_equal, "transformers"
|
43
|
+
)
|
File without changes
|