frogml 1.2.41__py3-none-any.whl → 1.2.44__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.
- frogml/__init__.py +1 -1
- frogml/_proto/qwak/administration/cluster/v2/cluster_service_pb2.py +52 -0
- frogml/_proto/qwak/administration/cluster/v2/cluster_service_pb2.pyi +208 -0
- frogml/_proto/qwak/administration/cluster/v2/cluster_service_pb2_grpc.py +237 -0
- frogml/_proto/qwak/administration/v1/environments/environment_pb2.py +29 -0
- frogml/_proto/qwak/administration/v1/environments/environment_pb2.pyi +35 -0
- frogml/_proto/qwak/administration/v1/environments/environment_pb2_grpc.py +4 -0
- frogml/_proto/qwak/administration/v1/environments/environment_service_pb2.py +33 -0
- frogml/_proto/qwak/administration/v1/environments/environment_service_pb2.pyi +59 -0
- frogml/_proto/qwak/administration/v1/environments/environment_service_pb2_grpc.py +67 -0
- frogml/core/clients/administration/cluster_v2/__init__.py +1 -0
- frogml/core/clients/administration/cluster_v2/client.py +122 -0
- frogml/core/clients/administration/environment/client.py +28 -0
- frogml/core/clients/administration/environment_v1/__init__.py +1 -0
- frogml/core/clients/administration/environment_v1/client.py +53 -0
- {frogml-1.2.41.dist-info → frogml-1.2.44.dist-info}/METADATA +1 -1
- {frogml-1.2.41.dist-info → frogml-1.2.44.dist-info}/RECORD +23 -7
- frogml_services_mock/mocks/cluster_v2_service.py +146 -0
- frogml_services_mock/mocks/environment_v0_service.py +175 -0
- frogml_services_mock/mocks/environment_v1_service.py +37 -0
- frogml_services_mock/mocks/frogml_mocks.py +6 -0
- frogml_services_mock/services_mock.py +33 -0
- {frogml-1.2.41.dist-info → frogml-1.2.44.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
import grpc
|
|
4
|
+
|
|
5
|
+
from frogml._proto.qwak.administration.v0.environments.environment_pb2 import (
|
|
6
|
+
QwakEnvironment,
|
|
7
|
+
)
|
|
8
|
+
from frogml._proto.qwak.administration.v0.environments.environment_service_pb2 import (
|
|
9
|
+
CreateEnvironmentResponse,
|
|
10
|
+
GetEnvironmentApplicationUserCredentialsResponse,
|
|
11
|
+
GetEnvironmentResponse,
|
|
12
|
+
ListEnvironmentsResponse,
|
|
13
|
+
SetEnvironmentApplicationUserCredentialsResponse,
|
|
14
|
+
UpdateEnvironmentConfigurationResponse,
|
|
15
|
+
UpdateEnvironmentPersonalizationResponse,
|
|
16
|
+
)
|
|
17
|
+
from frogml._proto.qwak.administration.v0.environments.environment_service_pb2_grpc import (
|
|
18
|
+
EnvironmentServiceServicer,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class EnvironmentV0ServiceMock(EnvironmentServiceServicer):
|
|
23
|
+
def __init__(self):
|
|
24
|
+
super().__init__()
|
|
25
|
+
self.__create_environment_response: Optional[CreateEnvironmentResponse] = None
|
|
26
|
+
self.__create_environment_error: Optional[grpc.StatusCode] = None
|
|
27
|
+
|
|
28
|
+
self.__get_environment_response: Optional[GetEnvironmentResponse] = None
|
|
29
|
+
self.__get_environment_error: Optional[grpc.StatusCode] = None
|
|
30
|
+
|
|
31
|
+
self.__update_environment_configuration_response: Optional[
|
|
32
|
+
UpdateEnvironmentConfigurationResponse
|
|
33
|
+
] = None
|
|
34
|
+
self.__update_environment_configuration_error: Optional[grpc.StatusCode] = None
|
|
35
|
+
|
|
36
|
+
self.__update_environment_personalization_response: Optional[
|
|
37
|
+
UpdateEnvironmentPersonalizationResponse
|
|
38
|
+
] = None
|
|
39
|
+
self.__update_environment_personalization_error: Optional[grpc.StatusCode] = (
|
|
40
|
+
None
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
self.__list_environments_response: Optional[ListEnvironmentsResponse] = None
|
|
44
|
+
self.__list_environments_error: Optional[grpc.StatusCode] = None
|
|
45
|
+
|
|
46
|
+
self.__get_credentials_response: Optional[
|
|
47
|
+
GetEnvironmentApplicationUserCredentialsResponse
|
|
48
|
+
] = None
|
|
49
|
+
self.__get_credentials_error: Optional[grpc.StatusCode] = None
|
|
50
|
+
|
|
51
|
+
self.__set_credentials_response: Optional[
|
|
52
|
+
SetEnvironmentApplicationUserCredentialsResponse
|
|
53
|
+
] = None
|
|
54
|
+
self.__set_credentials_error: Optional[grpc.StatusCode] = None
|
|
55
|
+
|
|
56
|
+
def given_create_environment(
|
|
57
|
+
self,
|
|
58
|
+
response: Optional[CreateEnvironmentResponse] = None,
|
|
59
|
+
error_code: Optional[grpc.StatusCode] = None,
|
|
60
|
+
):
|
|
61
|
+
self.__create_environment_response = response
|
|
62
|
+
self.__create_environment_error = error_code
|
|
63
|
+
|
|
64
|
+
def given_get_environment(
|
|
65
|
+
self,
|
|
66
|
+
response: Optional[GetEnvironmentResponse] = None,
|
|
67
|
+
error_code: Optional[grpc.StatusCode] = None,
|
|
68
|
+
):
|
|
69
|
+
self.__get_environment_response = response
|
|
70
|
+
self.__get_environment_error = error_code
|
|
71
|
+
|
|
72
|
+
def given_update_environment_configuration(
|
|
73
|
+
self,
|
|
74
|
+
response: Optional[UpdateEnvironmentConfigurationResponse] = None,
|
|
75
|
+
error_code: Optional[grpc.StatusCode] = None,
|
|
76
|
+
):
|
|
77
|
+
self.__update_environment_configuration_response = response
|
|
78
|
+
self.__update_environment_configuration_error = error_code
|
|
79
|
+
|
|
80
|
+
def given_update_environment_personalization(
|
|
81
|
+
self,
|
|
82
|
+
response: Optional[UpdateEnvironmentPersonalizationResponse] = None,
|
|
83
|
+
error_code: Optional[grpc.StatusCode] = None,
|
|
84
|
+
):
|
|
85
|
+
self.__update_environment_personalization_response = response
|
|
86
|
+
self.__update_environment_personalization_error = error_code
|
|
87
|
+
|
|
88
|
+
def given_list_environments(
|
|
89
|
+
self,
|
|
90
|
+
response: Optional[ListEnvironmentsResponse] = None,
|
|
91
|
+
error_code: Optional[grpc.StatusCode] = None,
|
|
92
|
+
):
|
|
93
|
+
self.__list_environments_response = response
|
|
94
|
+
self.__list_environments_error = error_code
|
|
95
|
+
|
|
96
|
+
def given_get_credentials(
|
|
97
|
+
self,
|
|
98
|
+
response: Optional[GetEnvironmentApplicationUserCredentialsResponse] = None,
|
|
99
|
+
error_code: Optional[grpc.StatusCode] = None,
|
|
100
|
+
):
|
|
101
|
+
self.__get_credentials_response = response
|
|
102
|
+
self.__get_credentials_error = error_code
|
|
103
|
+
|
|
104
|
+
def given_set_credentials(
|
|
105
|
+
self,
|
|
106
|
+
response: Optional[SetEnvironmentApplicationUserCredentialsResponse] = None,
|
|
107
|
+
error_code: Optional[grpc.StatusCode] = None,
|
|
108
|
+
):
|
|
109
|
+
self.__set_credentials_response = response
|
|
110
|
+
self.__set_credentials_error = error_code
|
|
111
|
+
|
|
112
|
+
def CreateEnvironment(self, request, context):
|
|
113
|
+
if self.__create_environment_error:
|
|
114
|
+
context.set_code(self.__create_environment_error)
|
|
115
|
+
context.set_details("Failed to create environment")
|
|
116
|
+
return CreateEnvironmentResponse()
|
|
117
|
+
if self.__create_environment_response:
|
|
118
|
+
return self.__create_environment_response
|
|
119
|
+
return CreateEnvironmentResponse(environment=QwakEnvironment(id="mock-env-id"))
|
|
120
|
+
|
|
121
|
+
def GetEnvironment(self, request, context):
|
|
122
|
+
if self.__get_environment_error:
|
|
123
|
+
context.set_code(self.__get_environment_error)
|
|
124
|
+
context.set_details("Failed to get environment")
|
|
125
|
+
return GetEnvironmentResponse()
|
|
126
|
+
if self.__get_environment_response:
|
|
127
|
+
return self.__get_environment_response
|
|
128
|
+
return GetEnvironmentResponse(
|
|
129
|
+
environment=QwakEnvironment(id=request.environment_id)
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
def UpdateEnvironmentConfiguration(self, request, context):
|
|
133
|
+
if self.__update_environment_configuration_error:
|
|
134
|
+
context.set_code(self.__update_environment_configuration_error)
|
|
135
|
+
context.set_details("Failed to update environment configuration")
|
|
136
|
+
return UpdateEnvironmentConfigurationResponse()
|
|
137
|
+
if self.__update_environment_configuration_response:
|
|
138
|
+
return self.__update_environment_configuration_response
|
|
139
|
+
return UpdateEnvironmentConfigurationResponse()
|
|
140
|
+
|
|
141
|
+
def UpdateEnvironmentPersonalization(self, request, context):
|
|
142
|
+
if self.__update_environment_personalization_error:
|
|
143
|
+
context.set_code(self.__update_environment_personalization_error)
|
|
144
|
+
context.set_details("Failed to update environment personalization")
|
|
145
|
+
return UpdateEnvironmentPersonalizationResponse()
|
|
146
|
+
if self.__update_environment_personalization_response:
|
|
147
|
+
return self.__update_environment_personalization_response
|
|
148
|
+
return UpdateEnvironmentPersonalizationResponse()
|
|
149
|
+
|
|
150
|
+
def ListEnvironments(self, request, context):
|
|
151
|
+
if self.__list_environments_error:
|
|
152
|
+
context.set_code(self.__list_environments_error)
|
|
153
|
+
context.set_details("Failed to list environments")
|
|
154
|
+
return ListEnvironmentsResponse()
|
|
155
|
+
if self.__list_environments_response:
|
|
156
|
+
return self.__list_environments_response
|
|
157
|
+
return ListEnvironmentsResponse()
|
|
158
|
+
|
|
159
|
+
def GetEnvironmentApplicationUserCredentials(self, request, context):
|
|
160
|
+
if self.__get_credentials_error:
|
|
161
|
+
context.set_code(self.__get_credentials_error)
|
|
162
|
+
context.set_details("Failed to get credentials")
|
|
163
|
+
return GetEnvironmentApplicationUserCredentialsResponse()
|
|
164
|
+
if self.__get_credentials_response:
|
|
165
|
+
return self.__get_credentials_response
|
|
166
|
+
return GetEnvironmentApplicationUserCredentialsResponse()
|
|
167
|
+
|
|
168
|
+
def SetEnvironmentApplicationUserCredentials(self, request, context):
|
|
169
|
+
if self.__set_credentials_error:
|
|
170
|
+
context.set_code(self.__set_credentials_error)
|
|
171
|
+
context.set_details("Failed to set credentials")
|
|
172
|
+
return SetEnvironmentApplicationUserCredentialsResponse()
|
|
173
|
+
if self.__set_credentials_response:
|
|
174
|
+
return self.__set_credentials_response
|
|
175
|
+
return SetEnvironmentApplicationUserCredentialsResponse()
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
import grpc
|
|
4
|
+
|
|
5
|
+
from frogml._proto.qwak.administration.v0.environments.environment_pb2 import (
|
|
6
|
+
QwakEnvironment,
|
|
7
|
+
)
|
|
8
|
+
from frogml._proto.qwak.administration.v1.environments.environment_service_pb2 import (
|
|
9
|
+
CreateEnvironmentResponse,
|
|
10
|
+
)
|
|
11
|
+
from frogml._proto.qwak.administration.v1.environments.environment_service_pb2_grpc import (
|
|
12
|
+
EnvironmentServiceServicer,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class EnvironmentV1ServiceMock(EnvironmentServiceServicer):
|
|
17
|
+
def __init__(self):
|
|
18
|
+
super().__init__()
|
|
19
|
+
self.__create_environment_response: Optional[CreateEnvironmentResponse] = None
|
|
20
|
+
self.__create_environment_error: Optional[grpc.StatusCode] = None
|
|
21
|
+
|
|
22
|
+
def given_create_environment(
|
|
23
|
+
self,
|
|
24
|
+
response: Optional[CreateEnvironmentResponse] = None,
|
|
25
|
+
error_code: Optional[grpc.StatusCode] = None,
|
|
26
|
+
):
|
|
27
|
+
self.__create_environment_response = response
|
|
28
|
+
self.__create_environment_error = error_code
|
|
29
|
+
|
|
30
|
+
def CreateEnvironment(self, request, context):
|
|
31
|
+
if self.__create_environment_error:
|
|
32
|
+
context.set_code(self.__create_environment_error)
|
|
33
|
+
context.set_details("Failed to create environment")
|
|
34
|
+
return CreateEnvironmentResponse()
|
|
35
|
+
if self.__create_environment_response:
|
|
36
|
+
return self.__create_environment_response
|
|
37
|
+
return CreateEnvironmentResponse(environment=QwakEnvironment(id="mock-env-id"))
|
|
@@ -23,11 +23,14 @@ from frogml_services_mock.mocks.build_orchestrator_build_settings_api import (
|
|
|
23
23
|
from frogml_services_mock.mocks.build_orchestrator_service_api import (
|
|
24
24
|
BuildOrchestratorServiceApiMock,
|
|
25
25
|
)
|
|
26
|
+
from frogml_services_mock.mocks.cluster_v2_service import ClusterV2ServiceMock
|
|
26
27
|
from frogml_services_mock.mocks.data_versioning_service import DataVersioningServiceMock
|
|
27
28
|
from frogml_services_mock.mocks.deployment_management_service import (
|
|
28
29
|
DeploymentManagementServiceMock,
|
|
29
30
|
)
|
|
30
31
|
from frogml_services_mock.mocks.ecosystem_service_api import EcoSystemServiceMock
|
|
32
|
+
from frogml_services_mock.mocks.environment_v0_service import EnvironmentV0ServiceMock
|
|
33
|
+
from frogml_services_mock.mocks.environment_v1_service import EnvironmentV1ServiceMock
|
|
31
34
|
from frogml_services_mock.mocks.execution_management_service import (
|
|
32
35
|
ExecutionManagementServiceMock,
|
|
33
36
|
)
|
|
@@ -135,3 +138,6 @@ class FrogmlMocks:
|
|
|
135
138
|
location_discovery_service: LocationDiscoveryServiceApiMock
|
|
136
139
|
jfrog_tenant_info_service: JFrogTenantInfoServiceMock
|
|
137
140
|
model_deployment_manager_mock: ModelDeploymentManagerMock
|
|
141
|
+
cluster_v2_service_mock: ClusterV2ServiceMock
|
|
142
|
+
environment_v0_service_mock: EnvironmentV0ServiceMock
|
|
143
|
+
environment_v1_service_mock: EnvironmentV1ServiceMock
|
|
@@ -12,6 +12,15 @@ from frogml._proto.jfml.model_version.v1.model_version_manager_service_pb2_grpc
|
|
|
12
12
|
from frogml._proto.qwak.administration.v0.authentication.authentication_service_pb2_grpc import (
|
|
13
13
|
add_AuthenticationServiceServicer_to_server,
|
|
14
14
|
)
|
|
15
|
+
from frogml._proto.qwak.administration.cluster.v2.cluster_service_pb2_grpc import (
|
|
16
|
+
add_ClusterServiceServicer_to_server,
|
|
17
|
+
)
|
|
18
|
+
from frogml._proto.qwak.administration.v0.environments.environment_service_pb2_grpc import (
|
|
19
|
+
add_EnvironmentServiceServicer_to_server as add_EnvironmentV0ServiceServicer_to_server,
|
|
20
|
+
)
|
|
21
|
+
from frogml._proto.qwak.administration.v1.environments.environment_service_pb2_grpc import (
|
|
22
|
+
add_EnvironmentServiceServicer_to_server as add_EnvironmentV1ServiceServicer_to_server,
|
|
23
|
+
)
|
|
15
24
|
from frogml._proto.qwak.admiral.secret.v0.system_secret_service_pb2_grpc import (
|
|
16
25
|
add_SystemSecretServiceServicer_to_server,
|
|
17
26
|
)
|
|
@@ -144,11 +153,14 @@ from frogml_services_mock.mocks.build_orchestrator_build_settings_api import (
|
|
|
144
153
|
from frogml_services_mock.mocks.build_orchestrator_service_api import (
|
|
145
154
|
BuildOrchestratorServiceApiMock,
|
|
146
155
|
)
|
|
156
|
+
from frogml_services_mock.mocks.cluster_v2_service import ClusterV2ServiceMock
|
|
147
157
|
from frogml_services_mock.mocks.data_versioning_service import DataVersioningServiceMock
|
|
148
158
|
from frogml_services_mock.mocks.deployment_management_service import (
|
|
149
159
|
DeploymentManagementServiceMock,
|
|
150
160
|
)
|
|
151
161
|
from frogml_services_mock.mocks.ecosystem_service_api import EcoSystemServiceMock
|
|
162
|
+
from frogml_services_mock.mocks.environment_v0_service import EnvironmentV0ServiceMock
|
|
163
|
+
from frogml_services_mock.mocks.environment_v1_service import EnvironmentV1ServiceMock
|
|
152
164
|
from frogml_services_mock.mocks.execution_management_service import (
|
|
153
165
|
ExecutionManagementServiceMock,
|
|
154
166
|
)
|
|
@@ -262,7 +274,10 @@ def frogml_container():
|
|
|
262
274
|
)
|
|
263
275
|
from frogml.core.clients.administration import (
|
|
264
276
|
authentication,
|
|
277
|
+
cluster_v2,
|
|
265
278
|
eco_system,
|
|
279
|
+
environment,
|
|
280
|
+
environment_v1,
|
|
266
281
|
self_service,
|
|
267
282
|
)
|
|
268
283
|
from frogml.core.clients.integration_management import integration_manager_client
|
|
@@ -278,8 +293,11 @@ def frogml_container():
|
|
|
278
293
|
analytics,
|
|
279
294
|
batch_job_management,
|
|
280
295
|
build_orchestrator,
|
|
296
|
+
cluster_v2,
|
|
281
297
|
data_versioning,
|
|
282
298
|
deployment,
|
|
299
|
+
environment,
|
|
300
|
+
environment_v1,
|
|
283
301
|
instance_template,
|
|
284
302
|
feature_store,
|
|
285
303
|
file_versioning,
|
|
@@ -517,6 +535,21 @@ def attach_servicers(free_port, server):
|
|
|
517
535
|
ModelDeploymentManagerMock,
|
|
518
536
|
add_ModelDeploymentServiceServicer_to_server,
|
|
519
537
|
),
|
|
538
|
+
(
|
|
539
|
+
"cluster_v2_service_mock",
|
|
540
|
+
ClusterV2ServiceMock,
|
|
541
|
+
add_ClusterServiceServicer_to_server,
|
|
542
|
+
),
|
|
543
|
+
(
|
|
544
|
+
"environment_v0_service_mock",
|
|
545
|
+
EnvironmentV0ServiceMock,
|
|
546
|
+
add_EnvironmentV0ServiceServicer_to_server,
|
|
547
|
+
),
|
|
548
|
+
(
|
|
549
|
+
"environment_v1_service_mock",
|
|
550
|
+
EnvironmentV1ServiceMock,
|
|
551
|
+
add_EnvironmentV1ServiceServicer_to_server,
|
|
552
|
+
),
|
|
520
553
|
("port", free_port, None),
|
|
521
554
|
],
|
|
522
555
|
)
|
|
File without changes
|