qwak-core 0.4.247__py3-none-any.whl → 0.4.248__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.
- qwak/__init__.py +1 -1
- qwak/inner/model_loggers_utils.py +8 -20
- qwak/model_loggers/artifact_logger.py +7 -2
- qwak/model_loggers/data_logger.py +11 -6
- {qwak_core-0.4.247.dist-info → qwak_core-0.4.248.dist-info}/METADATA +1 -1
- {qwak_core-0.4.247.dist-info → qwak_core-0.4.248.dist-info}/RECORD +7 -7
- {qwak_core-0.4.247.dist-info → qwak_core-0.4.248.dist-info}/WHEEL +0 -0
qwak/__init__.py
CHANGED
@@ -4,7 +4,6 @@ from typing import Optional
|
|
4
4
|
|
5
5
|
import requests
|
6
6
|
|
7
|
-
from _qwak_proto.qwak.builds.builds_orchestrator_service_pb2 import AuthenticationDetail
|
8
7
|
from qwak.clients.model_management.client import ModelsManagementClient
|
9
8
|
from qwak.exceptions import QwakException
|
10
9
|
|
@@ -69,33 +68,22 @@ def fetch_build_id() -> Optional[str]:
|
|
69
68
|
def upload_data(
|
70
69
|
upload_url: str,
|
71
70
|
data: bytes,
|
72
|
-
|
71
|
+
headers: dict,
|
73
72
|
content_type: str = "text/plain",
|
74
|
-
)
|
73
|
+
):
|
75
74
|
"""
|
76
75
|
Upload data
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
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
|
82
80
|
"""
|
83
81
|
try:
|
84
|
-
|
85
|
-
if (
|
86
|
-
authentication_details.WhichOneof("integration_type")
|
87
|
-
== "jfrog_authentication_detail"
|
88
|
-
):
|
89
|
-
auth = (
|
90
|
-
authentication_details.jfrog_authentication_detail.username,
|
91
|
-
authentication_details.jfrog_authentication_detail.token,
|
92
|
-
)
|
93
|
-
|
82
|
+
headers["Content-Type"] = content_type
|
94
83
|
http_response = requests.put( # nosec B113
|
95
84
|
upload_url,
|
96
85
|
data=data,
|
97
|
-
headers=
|
98
|
-
auth=auth,
|
86
|
+
headers=headers,
|
99
87
|
)
|
100
88
|
|
101
89
|
if http_response.status_code not in [200, 201]:
|
@@ -2,6 +2,9 @@ import urllib.request
|
|
2
2
|
from typing import Optional
|
3
3
|
|
4
4
|
from _qwak_proto.qwak.builds.build_url_pb2 import BuildVersioningTagsType
|
5
|
+
from _qwak_proto.qwak.builds.builds_orchestrator_service_pb2 import (
|
6
|
+
GetBuildVersioningUploadURLResponse,
|
7
|
+
)
|
5
8
|
from qwak.clients.build_orchestrator.client import BuildOrchestratorClient
|
6
9
|
from qwak.clients.file_versioning.client import FileVersioningManagementClient
|
7
10
|
from qwak.exceptions import QwakException
|
@@ -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 _qwak_proto.qwak.builds.build_pb2 import (
|
|
12
12
|
DataTableDefinition,
|
13
13
|
)
|
14
14
|
from _qwak_proto.qwak.builds.build_url_pb2 import BuildVersioningTagsType
|
15
|
+
from _qwak_proto.qwak.builds.builds_orchestrator_service_pb2 import (
|
16
|
+
GetBuildVersioningUploadURLResponse,
|
17
|
+
)
|
15
18
|
from qwak.clients.build_orchestrator.client import BuildOrchestratorClient
|
16
19
|
from qwak.clients.data_versioning.client import DataVersioningManagementClient
|
17
20
|
from qwak.exceptions import QwakException
|
@@ -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(
|
@@ -582,7 +582,7 @@ _qwak_proto/qwak/workspace/workspace_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXH
|
|
582
582
|
_qwak_proto/qwak/workspace/workspace_service_pb2.py,sha256=AB3C9S_AbOD7Nx1Ni4j1rW6PNtYTV1zjiqFQk-goQ74,21429
|
583
583
|
_qwak_proto/qwak/workspace/workspace_service_pb2.pyi,sha256=nKKCHwnovZhsy8TSVmdz-Vtl0nviOOoX56HD-41Xo08,13726
|
584
584
|
_qwak_proto/qwak/workspace/workspace_service_pb2_grpc.py,sha256=yKGuexxTBza99Ihe0DSTniV2ZSd_AG47inHenqfi890,27193
|
585
|
-
qwak/__init__.py,sha256=
|
585
|
+
qwak/__init__.py,sha256=5N6mBzO1DFCpFv6gezURZqEuGMsOSAcu57c6E9MIo7g,587
|
586
586
|
qwak/automations/__init__.py,sha256=qFZRvCxUUn8gcxkJR0v19ulHW2oJ0x6-Rif7HiheDP4,1522
|
587
587
|
qwak/automations/automation_executions.py,sha256=5MeH_epYYWb8NKXgAozwT_jPyyUDednBHG7izloi7RY,3228
|
588
588
|
qwak/automations/automations.py,sha256=3yx8e2v0uSKDnXbqyknasyEoQ5vxGni6K40Hbi1_zkk,12599
|
@@ -831,7 +831,7 @@ qwak/inner/di_configuration/containers.py,sha256=1Vvs_p5laNcduDWH47dZpJJa2xu3v5P
|
|
831
831
|
qwak/inner/di_configuration/session.py,sha256=Pwqapcu-0dsbb5dDn7ZGewVk4bYRN9sWk6ity72IDqY,452
|
832
832
|
qwak/inner/instance_template/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
833
833
|
qwak/inner/instance_template/verify_template_id.py,sha256=-c0Fh89XAfphKCpkurYaD-YyX3M3NkkpSLH4QsNPyko,1916
|
834
|
-
qwak/inner/model_loggers_utils.py,sha256=
|
834
|
+
qwak/inner/model_loggers_utils.py,sha256=irVEuNYlMefINR8N5UiD9IcO8fzdcuc8jBbBzNzKC7M,2441
|
835
835
|
qwak/inner/provider.py,sha256=3evQnyp0v0enpvGGDyaZziusO4BGi-U9j1sno8DAHo4,70
|
836
836
|
qwak/inner/runtime_di/__init__.py,sha256=ylaHwo2Hlq3pmeziA0Ip87DMnkcuBffKKi0tTH7gYVI,281
|
837
837
|
qwak/inner/runtime_di/containers.py,sha256=-AREM-IUAd9JhrhQablqixxpj4L9Tk1iQkK1fA5YbrA,545
|
@@ -961,8 +961,8 @@ qwak/model/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
|
|
961
961
|
qwak/model/utils/extract_wrapped_function.py,sha256=uIle1zL8vbmeS3PGAuaNFLIUQAsvpuzk3LlH-Teba94,320
|
962
962
|
qwak/model/utils/feature_utils.py,sha256=jB4pfmhqN2_B4THR7YADlCWbymU3cm_8u2RzTegrv_w,2389
|
963
963
|
qwak/model_loggers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
964
|
-
qwak/model_loggers/artifact_logger.py,sha256=
|
965
|
-
qwak/model_loggers/data_logger.py,sha256=
|
964
|
+
qwak/model_loggers/artifact_logger.py,sha256=E5A9MaGD4bDAWlj7cuc5f9Pzet9_p5jgkGuoZiVn1B0,3090
|
965
|
+
qwak/model_loggers/data_logger.py,sha256=aTRnRwKmKUFZq9SRg4sY-b1yGDY2XB-pExlQ0WlcH0k,5629
|
966
966
|
qwak/model_loggers/model_logger.py,sha256=WxKLEpfzDaRn3kanrI0kj4zqqKQrwT2sin1IS1WNEA8,852
|
967
967
|
qwak/qwak_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
968
968
|
qwak/qwak_client/batch_jobs/execution.py,sha256=L0CjS6BuEsPGJbQ4_yV75FsIx-jvdUg8DirYdH6ddFQ,1757
|
@@ -1056,6 +1056,6 @@ qwak_services_mock/mocks/workspace_manager_service_mock.py,sha256=O9ZSwln4T4kHVk
|
|
1056
1056
|
qwak_services_mock/services_mock.py,sha256=zXtHcX8a_acz7ynxuCBxxVpHpde7aAGjIn6Uw52LY1s,19593
|
1057
1057
|
qwak_services_mock/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1058
1058
|
qwak_services_mock/utils/service_utils.py,sha256=ZlB0CnB1J6oBn6_m7fQO2U8tKoboHdUa6ljjkRMYNXU,265
|
1059
|
-
qwak_core-0.4.
|
1060
|
-
qwak_core-0.4.
|
1061
|
-
qwak_core-0.4.
|
1059
|
+
qwak_core-0.4.248.dist-info/METADATA,sha256=V-53JLVMprm3wnTnnPBpn2DWt5N4PpJ33JR0muYz4Sc,2150
|
1060
|
+
qwak_core-0.4.248.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
1061
|
+
qwak_core-0.4.248.dist-info/RECORD,,
|
File without changes
|