frogml-core 0.0.73__py3-none-any.whl → 0.0.74__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_core/__init__.py +1 -1
- frogml_core/inner/model_loggers_utils.py +8 -22
- frogml_core/model_loggers/artifact_logger.py +7 -2
- frogml_core/model_loggers/data_logger.py +11 -6
- {frogml_core-0.0.73.dist-info → frogml_core-0.0.74.dist-info}/METADATA +1 -1
- {frogml_core-0.0.73.dist-info → frogml_core-0.0.74.dist-info}/RECORD +7 -7
- {frogml_core-0.0.73.dist-info → frogml_core-0.0.74.dist-info}/WHEEL +0 -0
frogml_core/__init__.py
CHANGED
@@ -4,9 +4,6 @@ from typing import Optional
|
|
4
4
|
|
5
5
|
import requests
|
6
6
|
|
7
|
-
from frogml_proto.qwak.builds.builds_orchestrator_service_pb2 import (
|
8
|
-
AuthenticationDetail,
|
9
|
-
)
|
10
7
|
from frogml_core.clients.model_management.client import ModelsManagementClient
|
11
8
|
from frogml_core.exceptions import FrogmlException
|
12
9
|
|
@@ -71,33 +68,22 @@ def fetch_build_id() -> Optional[str]:
|
|
71
68
|
def upload_data(
|
72
69
|
upload_url: str,
|
73
70
|
data: bytes,
|
74
|
-
|
71
|
+
headers: dict,
|
75
72
|
content_type: str = "text/plain",
|
76
|
-
)
|
73
|
+
):
|
77
74
|
"""
|
78
75
|
Upload data
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
content_type: Uploaded content-type
|
76
|
+
:param upload_url: the url to upload to.
|
77
|
+
:param data: the data to upload
|
78
|
+
:param headers: authentication details for upload data
|
79
|
+
:param content_type: Uploaded content-type
|
84
80
|
"""
|
85
81
|
try:
|
86
|
-
|
87
|
-
if (
|
88
|
-
authentication_details.WhichOneof("integration_type")
|
89
|
-
== "jfrog_authentication_detail"
|
90
|
-
):
|
91
|
-
auth = (
|
92
|
-
authentication_details.jfrog_authentication_detail.username,
|
93
|
-
authentication_details.jfrog_authentication_detail.token,
|
94
|
-
)
|
95
|
-
|
82
|
+
headers["Content-Type"] = content_type
|
96
83
|
http_response = requests.put( # nosec B113
|
97
84
|
upload_url,
|
98
85
|
data=data,
|
99
|
-
headers=
|
100
|
-
auth=auth,
|
86
|
+
headers=headers,
|
101
87
|
)
|
102
88
|
|
103
89
|
if http_response.status_code not in [200, 201]:
|
@@ -11,6 +11,9 @@ from frogml_core.inner.model_loggers_utils import (
|
|
11
11
|
validate_model,
|
12
12
|
validate_tag,
|
13
13
|
)
|
14
|
+
from frogml_proto.qwak.builds.builds_orchestrator_service_pb2 import (
|
15
|
+
GetBuildVersioningUploadURLResponse,
|
16
|
+
)
|
14
17
|
|
15
18
|
|
16
19
|
def log_file(
|
@@ -38,7 +41,9 @@ def log_file(
|
|
38
41
|
# Checking if called inside a model - then build id saved as environment variable or stays
|
39
42
|
build_id = fetch_build_id()
|
40
43
|
|
41
|
-
upload_url_response
|
44
|
+
upload_url_response: (
|
45
|
+
GetBuildVersioningUploadURLResponse
|
46
|
+
) = BuildOrchestratorClient().get_build_versioning_upload_url(
|
42
47
|
build_id=build_id,
|
43
48
|
model_id=model_id,
|
44
49
|
tag=tag,
|
@@ -53,7 +58,7 @@ def log_file(
|
|
53
58
|
upload_data(
|
54
59
|
upload_url_response.upload_url,
|
55
60
|
f.read(),
|
56
|
-
upload_url_response.
|
61
|
+
upload_url_response.headers,
|
57
62
|
)
|
58
63
|
|
59
64
|
|
@@ -12,6 +12,9 @@ from frogml_proto.qwak.builds.build_pb2 import (
|
|
12
12
|
DataTableDefinition,
|
13
13
|
)
|
14
14
|
from frogml_proto.qwak.builds.build_url_pb2 import BuildVersioningTagsType
|
15
|
+
from frogml_proto.qwak.builds.builds_orchestrator_service_pb2 import (
|
16
|
+
GetBuildVersioningUploadURLResponse,
|
17
|
+
)
|
15
18
|
from frogml_core.clients.build_orchestrator.client import BuildOrchestratorClient
|
16
19
|
from frogml_core.clients.data_versioning.client import DataVersioningManagementClient
|
17
20
|
from frogml_core.exceptions import FrogmlException
|
@@ -63,11 +66,13 @@ def log_data(
|
|
63
66
|
build_id = fetch_build_id()
|
64
67
|
|
65
68
|
client = BuildOrchestratorClient()
|
66
|
-
upload_url_response =
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
69
|
+
upload_url_response: GetBuildVersioningUploadURLResponse = (
|
70
|
+
client.get_build_versioning_upload_url(
|
71
|
+
build_id=build_id,
|
72
|
+
model_id=model_id,
|
73
|
+
tag=str(data_tag),
|
74
|
+
tag_type=BuildVersioningTagsType.DATA_TAG_TYPE,
|
75
|
+
)
|
71
76
|
)
|
72
77
|
|
73
78
|
string_buffer = StringIO()
|
@@ -76,7 +81,7 @@ def log_data(
|
|
76
81
|
upload_url=upload_url_response.upload_url,
|
77
82
|
data=gzip.compress(bytes(string_buffer.getvalue(), "utf-8")),
|
78
83
|
content_type="text/plain",
|
79
|
-
|
84
|
+
headers=upload_url_response.headers,
|
80
85
|
)
|
81
86
|
|
82
87
|
dataframe_definition = DataTableDefinition(
|
@@ -1,4 +1,4 @@
|
|
1
|
-
frogml_core/__init__.py,sha256=
|
1
|
+
frogml_core/__init__.py,sha256=y9MsA0PqQlAWmz9MxiMFu0w_prsUtWeqpuP2Ng_J62Q,777
|
2
2
|
frogml_core/automations/__init__.py,sha256=j2gD15MN-xVWhI5rAFsDwhL0CIyICLNT0scXsKvNBkU,1547
|
3
3
|
frogml_core/automations/automation_executions.py,sha256=xpOb9Dq8gPPGNQDJTvBBZbNz4woZDRZY0HqnLSu7pwU,3230
|
4
4
|
frogml_core/automations/automations.py,sha256=GKEQyQMi8sxX5oZn62PaxPi0zD8IaJRjBkhczRJxHNs,13070
|
@@ -275,7 +275,7 @@ frogml_core/inner/di_configuration/config.yml,sha256=GUvaZMWIDIR_d7hFcPVG_kHdCwp
|
|
275
275
|
frogml_core/inner/di_configuration/containers.py,sha256=epzNvWcHcfO07EV6aQxEaGIehqgKBUK2CGzKgk1HeEA,1148
|
276
276
|
frogml_core/inner/instance_template/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
277
277
|
frogml_core/inner/instance_template/verify_template_id.py,sha256=3rmVpZyqDs7wUyXSmfJ8YjUK15Q4_H95J8Ba5E6KuA8,1951
|
278
|
-
frogml_core/inner/model_loggers_utils.py,sha256=
|
278
|
+
frogml_core/inner/model_loggers_utils.py,sha256=NOSLcdKEoLIcK9Hx19KP1iGgzJu2NjWOGUh4yAuycTI,2465
|
279
279
|
frogml_core/inner/provider.py,sha256=3evQnyp0v0enpvGGDyaZziusO4BGi-U9j1sno8DAHo4,70
|
280
280
|
frogml_core/inner/runtime_di/__init__.py,sha256=HXqtejgH3J9TXjnEBT6cNwnTDPq6v3sTifcmfWiwyFA,312
|
281
281
|
frogml_core/inner/runtime_di/containers.py,sha256=LbapepWFjBjkELEOTK7m7AJEfj4KENVDlpD7lv7zw6o,577
|
@@ -405,8 +405,8 @@ frogml_core/model/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
405
405
|
frogml_core/model/utils/extract_wrapped_function.py,sha256=uIle1zL8vbmeS3PGAuaNFLIUQAsvpuzk3LlH-Teba94,320
|
406
406
|
frogml_core/model/utils/feature_utils.py,sha256=ObIU4jLKOMEa3DWEyrXm1m3wC2wseAVwr-zxlSiojYk,2525
|
407
407
|
frogml_core/model_loggers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
408
|
-
frogml_core/model_loggers/artifact_logger.py,sha256=
|
409
|
-
frogml_core/model_loggers/data_logger.py,sha256=
|
408
|
+
frogml_core/model_loggers/artifact_logger.py,sha256=7T06QL1keo6BTpIh76JtXRcNlZuIbqECz343kEw0Hfc,3128
|
409
|
+
frogml_core/model_loggers/data_logger.py,sha256=I3o2TkAGAnKuVWccPMlGL5-rg1e2UDHRc9cRSS8kqmc,5678
|
410
410
|
frogml_core/model_loggers/model_logger.py,sha256=xDUIwRzeFAorzzR47ovyag5ohwuYZWp9fRWpLpMzcg4,863
|
411
411
|
frogml_core/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
412
412
|
frogml_core/testing/fixtures.py,sha256=tjWIvdZ2nIfNPs6VtUeGx5coJepQVMUWemKGtqUYPzM,318
|
@@ -1087,6 +1087,6 @@ frogml_services_mock/mocks/workspace_manager_service_mock.py,sha256=WbOiWgOyr-xT
|
|
1087
1087
|
frogml_services_mock/services_mock.py,sha256=xfbYvl05gFUq2oT82cT-6K2CEJ6d9kFX_tk77QZHTFI,20787
|
1088
1088
|
frogml_services_mock/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1089
1089
|
frogml_services_mock/utils/service_utils.py,sha256=ZlB0CnB1J6oBn6_m7fQO2U8tKoboHdUa6ljjkRMYNXU,265
|
1090
|
-
frogml_core-0.0.
|
1091
|
-
frogml_core-0.0.
|
1092
|
-
frogml_core-0.0.
|
1090
|
+
frogml_core-0.0.74.dist-info/METADATA,sha256=mJKWzqEde9DndjFpgBpUBWhwkkwZqlOWV6ecRV82UFo,2004
|
1091
|
+
frogml_core-0.0.74.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
1092
|
+
frogml_core-0.0.74.dist-info/RECORD,,
|
File without changes
|