frogml-core 0.0.120__py3-none-any.whl → 0.0.121__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.
- core/clients/logging_client/client.py +14 -20
- core/inner/build_logic/interface/context_interface.py +5 -0
- core/inner/di_configuration/account.py +8 -0
- core/inner/tool/auth.py +12 -6
- {frogml_core-0.0.120.dist-info → frogml_core-0.0.121.dist-info}/METADATA +1 -1
- {frogml_core-0.0.120.dist-info → frogml_core-0.0.121.dist-info}/RECORD +7 -7
- {frogml_core-0.0.120.dist-info → frogml_core-0.0.121.dist-info}/WHEEL +0 -0
@@ -1,7 +1,5 @@
|
|
1
1
|
from typing import Optional
|
2
2
|
|
3
|
-
from grpc import RpcError
|
4
|
-
|
5
3
|
from frogml._proto.qwak.logging.log_filter_pb2 import LogText, SearchFilter
|
6
4
|
from frogml._proto.qwak.logging.log_reader_service_pb2 import (
|
7
5
|
ReadLogsRequest,
|
@@ -17,6 +15,7 @@ from frogml._proto.qwak.logging.log_source_pb2 import (
|
|
17
15
|
from frogml.core.clients.administration.eco_system.client import EcosystemClient
|
18
16
|
from frogml.core.exceptions import FrogmlException
|
19
17
|
from frogml.core.inner.tool.grpc.grpc_tools import create_grpc_channel
|
18
|
+
from frogml.core.inner.tool.grpc.grpc_try_wrapping import grpc_try_catch_wrapper
|
20
19
|
|
21
20
|
|
22
21
|
class LoggingClient:
|
@@ -120,6 +119,7 @@ class LoggingClient:
|
|
120
119
|
except FrogmlException as e:
|
121
120
|
raise FrogmlException(f"Failed to fetch execution logs, error is [{e}]")
|
122
121
|
|
122
|
+
@grpc_try_catch_wrapper("Failed to read logs request")
|
123
123
|
def read_logs(
|
124
124
|
self,
|
125
125
|
source,
|
@@ -127,22 +127,16 @@ class LoggingClient:
|
|
127
127
|
after_offset,
|
128
128
|
max_number_of_results,
|
129
129
|
log_text_filter,
|
130
|
-
):
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
max_number_of_results=max_number_of_results,
|
141
|
-
)
|
142
|
-
)
|
143
|
-
return response
|
144
|
-
except RpcError as e:
|
145
|
-
raise FrogmlException(
|
146
|
-
f"Failed grpc read logs request, grpc error is "
|
147
|
-
f"[{e.details() if e.details() else e.code()}]"
|
130
|
+
) -> ReadLogsResponse:
|
131
|
+
response: ReadLogsResponse = self._logging_service.ReadLogs(
|
132
|
+
ReadLogsRequest(
|
133
|
+
source=source,
|
134
|
+
before_offset=before_offset,
|
135
|
+
after_offset=after_offset,
|
136
|
+
search_filter=SearchFilter(
|
137
|
+
log_text_filter=LogText(contains=log_text_filter)
|
138
|
+
),
|
139
|
+
max_number_of_results=max_number_of_results,
|
148
140
|
)
|
141
|
+
)
|
142
|
+
return response
|
@@ -10,6 +10,7 @@ from frogml.core.clients.instance_template.client import (
|
|
10
10
|
)
|
11
11
|
from frogml.core.clients.model_management import ModelsManagementClient
|
12
12
|
from frogml.core.inner.build_logic.dependency_manager_type import DependencyManagerType
|
13
|
+
from frogml.core.inner.di_configuration import UserAccountConfiguration
|
13
14
|
|
14
15
|
|
15
16
|
@dataclass
|
@@ -56,3 +57,7 @@ class Context(metaclass=ABCMeta):
|
|
56
57
|
# Upload Custom Wheels
|
57
58
|
custom_runtime_wheel: Optional[Path] = field(default=None)
|
58
59
|
custom_core_wheel: Optional[Path] = field(default=None)
|
60
|
+
|
61
|
+
platform_url: str = field(
|
62
|
+
default_factory=UserAccountConfiguration().retrieve_platform_url
|
63
|
+
)
|
@@ -104,3 +104,11 @@ class UserAccountConfiguration:
|
|
104
104
|
return getattr(auth, "token")
|
105
105
|
except AttributeError as e:
|
106
106
|
raise FrogmlLoginException("Token is not configured") from e
|
107
|
+
|
108
|
+
@staticmethod
|
109
|
+
def retrieve_platform_url() -> str:
|
110
|
+
"""Returns the platform URL with the '/ui/ml' suffix based on the authentication client configuration."""
|
111
|
+
try:
|
112
|
+
return f"{FrogMLAuthClient().get_base_url()}/ui/ml"
|
113
|
+
except ValueError:
|
114
|
+
return ""
|
core/inner/tool/auth.py
CHANGED
@@ -23,6 +23,10 @@ class FrogMLAuthClient:
|
|
23
23
|
|
24
24
|
return cast(str, self._token)
|
25
25
|
|
26
|
+
def get_base_url(self) -> str:
|
27
|
+
artifactory_url, _ = get_credentials(self.auth_config)
|
28
|
+
return self.__format_artifactory_url(artifactory_url)
|
29
|
+
|
26
30
|
def get_tenant_id(self: Self) -> str:
|
27
31
|
if not self._tenant_id:
|
28
32
|
self.login()
|
@@ -46,12 +50,7 @@ class FrogMLAuthClient:
|
|
46
50
|
"Failed to authenticate with JFrog. Please check your credentials"
|
47
51
|
)
|
48
52
|
|
49
|
-
|
50
|
-
if "/artifactory" in artifactory_url:
|
51
|
-
base_url = artifactory_url.replace("/artifactory", "/ui")
|
52
|
-
else:
|
53
|
-
# Remove trailing slash if it exists and append /ui
|
54
|
-
base_url = artifactory_url.rstrip("/") + "/ui"
|
53
|
+
base_url: str = self.__format_artifactory_url(artifactory_url)
|
55
54
|
|
56
55
|
url = f"{base_url}/api/v1/system/auth/screen/footer"
|
57
56
|
|
@@ -73,3 +72,10 @@ class FrogMLAuthClient:
|
|
73
72
|
"Authentication with JFrog failed: Only JWT Access Tokens are supported. "
|
74
73
|
"Please ensure you are using a valid JWT Access Token."
|
75
74
|
)
|
75
|
+
|
76
|
+
@staticmethod
|
77
|
+
def __format_artifactory_url(artifactory_url: str) -> str:
|
78
|
+
# Remove '/artifactory' from the URL
|
79
|
+
base_url: str = artifactory_url.replace("/artifactory", "")
|
80
|
+
# Remove trailing slash if exists
|
81
|
+
return base_url.rstrip("/")
|
@@ -674,7 +674,7 @@ core/clients/kube_deployment_captain/client.py,sha256=la4V7WsVL1z4zuLQtPZET1kjvG
|
|
674
674
|
core/clients/location_discovery/__init__.py,sha256=sqGQ75YHFE6nvOcir38fykUUmAa6cFEIze8PJYgYWRc,44
|
675
675
|
core/clients/location_discovery/client.py,sha256=ZcBbbLqzZ9E7oLyamBTLTpp611LldhfFOSkzWroyIQg,2895
|
676
676
|
core/clients/logging_client/__init__.py,sha256=1OCHnigQBYThBwGbxCreYA0BgP0HcuLFzNEWd3Yxh-c,34
|
677
|
-
core/clients/logging_client/client.py,sha256=
|
677
|
+
core/clients/logging_client/client.py,sha256=vq2Fv7UAEnrG910Npp1COxxWQ2_NWofbAStPkLhiz1w,4836
|
678
678
|
core/clients/model_management/__init__.py,sha256=vjWVP8MjmK4_A70WOgJqa6x24AeLK-ABjGJtogGzw9w,43
|
679
679
|
core/clients/model_management/client.py,sha256=bDBHrK4rssA67-cPPHCe4wA6jkphIjaxaMwxBYPfyIU,4918
|
680
680
|
core/clients/model_version_manager/__init__.py,sha256=4Pnfzj4Egps48__dProdbSKQl5pNip0hGJd75w67BfY,46
|
@@ -765,7 +765,7 @@ core/inner/build_logic/execute_build_pipeline.py,sha256=n607h5ozBFcFexJ6E9FHwgrl
|
|
765
765
|
core/inner/build_logic/interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
766
766
|
core/inner/build_logic/interface/build_logger_interface.py,sha256=JUxldJuhMVHoXk9nZc9tz7-LPOMC99Z32oQYHSHpffY,528
|
767
767
|
core/inner/build_logic/interface/build_phase.py,sha256=DNOcg11RVCSPpnGcAk2xDYEXwQ6UNWFoiGMpjgSFPt8,675
|
768
|
-
core/inner/build_logic/interface/context_interface.py,sha256=
|
768
|
+
core/inner/build_logic/interface/context_interface.py,sha256=97RU5gucN6CSSXud4rqKdlGhF73eroPup4OlIWAWgh4,2303
|
769
769
|
core/inner/build_logic/interface/phase_run_handler.py,sha256=bTeKMgbG85SuL7MfDJpzsO8HlN_H6F8Q6Wnt8wJYXGM,1744
|
770
770
|
core/inner/build_logic/interface/step_inteface.py,sha256=vRQRk5Z5n7JuA3GNgVJOIc62i8iG7WSvsG1f2nOOVDQ,746
|
771
771
|
core/inner/build_logic/interface/time_source.py,sha256=njwil9A1sxP4SoB8LxtNhWhlV2-w1XOpoF4_wccNVYU,585
|
@@ -801,7 +801,7 @@ core/inner/build_logic/tools/text.py,sha256=tH-v19Mt8l90sMVxku5XRtrderT0qdRqJ-jL
|
|
801
801
|
core/inner/build_logic/trigger_build_context.py,sha256=eWR35HQQKKNaPOfl64IB8xvCzl2vU6hgSR55qf9l7Lw,207
|
802
802
|
core/inner/const.py,sha256=eP8Naruk3EnRWDdS9gwpozUYA9Nxznybw7Eiv4k5l38,126
|
803
803
|
core/inner/di_configuration/__init__.py,sha256=7TE1MMfkFvBzHIzhAZ1L-vRgbScCIIMd-aXU9IFcs98,2130
|
804
|
-
core/inner/di_configuration/account.py,sha256=
|
804
|
+
core/inner/di_configuration/account.py,sha256=oREHMbzSEgRSR6V9cQRjDYefygq9wu5_Q_nEC1ws4X4,3121
|
805
805
|
core/inner/di_configuration/config.yml,sha256=GUvaZMWIDIR_d7hFcPVG_kHdCwpERKH1AFDakG3vqI4,242
|
806
806
|
core/inner/di_configuration/containers.py,sha256=E8ebGj0d1_8iMOn_fbcfKXwbXgSbLBQCKgA9_JV38E4,1148
|
807
807
|
core/inner/instance_template/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -810,7 +810,7 @@ core/inner/model_loggers_utils.py,sha256=mGBZQ1CbiEePaoftFEH_yfLlsxP8fcPcu83Cb8U
|
|
810
810
|
core/inner/provider.py,sha256=3evQnyp0v0enpvGGDyaZziusO4BGi-U9j1sno8DAHo4,70
|
811
811
|
core/inner/singleton_meta.py,sha256=1cU99I0f9tjuMQLMJyLsK1oK3fZJMsO5-TbRHAMXqds,627
|
812
812
|
core/inner/tool/__init__.py,sha256=rmOSE-ejnzDG_H7kbikPQxEO4TFIkhBWjOXhTIrldiU,35
|
813
|
-
core/inner/tool/auth.py,sha256=
|
813
|
+
core/inner/tool/auth.py,sha256=Ya55AgSY_feZLtaIje91z1rSG5JsLC-Jh6NdomsOTcs,2858
|
814
814
|
core/inner/tool/grpc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
815
815
|
core/inner/tool/grpc/grpc_auth.py,sha256=8lGC1B3IgLuVzY1X6aEozGI3gnzLlA5WDZ7VWn4qNY0,1421
|
816
816
|
core/inner/tool/grpc/grpc_tools.py,sha256=g49mtjSblXdSrFBSNPmsgCgDXHEzliqQ4uYDWRs527Q,7247
|
@@ -1011,6 +1011,6 @@ storage/utils/__init__.py,sha256=HQUWfuGUIPZY7kfS795TRW8BQ4WmNqrNjS7lUrbxCdk,299
|
|
1011
1011
|
storage/utils/_input_checks_utility.py,sha256=TgQ7Ycdkdu8bdDPX-jOvzo2QazccsRqPv4Qm3c_U4HU,3221
|
1012
1012
|
storage/utils/_storage_utils.py,sha256=HB2g7uY5A3b33yIcAUM1OjHb5jWsnpESsiDrEviQwrI,366
|
1013
1013
|
storage/utils/_url_utils.py,sha256=NUEfz9Fp1iE8b676-A5wrMlSTsJVRKrUhcUItOFAJD8,821
|
1014
|
-
frogml_core-0.0.
|
1015
|
-
frogml_core-0.0.
|
1016
|
-
frogml_core-0.0.
|
1014
|
+
frogml_core-0.0.121.dist-info/METADATA,sha256=S8rJjrsTtvUqacp-lOam7MnxtxQClofCVISy2785iHo,14893
|
1015
|
+
frogml_core-0.0.121.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
1016
|
+
frogml_core-0.0.121.dist-info/RECORD,,
|
File without changes
|