qwak-core 0.4.252__py3-none-any.whl → 0.4.253__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
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
-
import
|
1
|
+
from datetime import timedelta
|
2
2
|
from typing import Optional
|
3
|
+
import requests
|
4
|
+
from requests import Response
|
3
5
|
|
4
6
|
from _qwak_proto.qwak.builds.build_url_pb2 import BuildVersioningTagsType
|
5
7
|
from _qwak_proto.qwak.builds.builds_orchestrator_service_pb2 import (
|
6
8
|
GetBuildVersioningUploadURLResponse,
|
9
|
+
GetBuildVersioningDownloadURLResponse,
|
7
10
|
)
|
8
11
|
from qwak.clients.build_orchestrator.client import BuildOrchestratorClient
|
9
12
|
from qwak.clients.file_versioning.client import FileVersioningManagementClient
|
@@ -15,6 +18,8 @@ from qwak.inner.model_loggers_utils import (
|
|
15
18
|
validate_tag,
|
16
19
|
)
|
17
20
|
|
21
|
+
MAX_CHUNK_SIZE = 8 * 1024
|
22
|
+
|
18
23
|
|
19
24
|
def log_file(
|
20
25
|
from_path: str,
|
@@ -80,21 +85,40 @@ def load_file(
|
|
80
85
|
Returns:
|
81
86
|
the path to the newly created data file
|
82
87
|
"""
|
88
|
+
print(f"Loading file to {to_path}")
|
83
89
|
if not validate_tag(tag):
|
84
90
|
raise QwakException(
|
85
91
|
"Tag should contain only letters, numbers, underscore or hyphen"
|
86
92
|
)
|
87
93
|
|
88
94
|
model_id = validate_model(model_id)
|
89
|
-
download_url_response =
|
90
|
-
|
95
|
+
download_url_response: GetBuildVersioningDownloadURLResponse = (
|
96
|
+
BuildOrchestratorClient().get_build_versioning_download_url(
|
97
|
+
build_id=build_id,
|
98
|
+
model_id=model_id,
|
99
|
+
tag=tag,
|
100
|
+
tag_type=BuildVersioningTagsType.FILE_TAG_TYPE,
|
101
|
+
)
|
91
102
|
)
|
92
103
|
|
93
104
|
try:
|
94
|
-
|
95
|
-
|
105
|
+
response: Response = requests.get(
|
106
|
+
download_url_response.download_url,
|
107
|
+
headers=download_url_response.headers,
|
108
|
+
stream=True,
|
109
|
+
timeout=(
|
110
|
+
timedelta(seconds=10).total_seconds(), # timeout to connect
|
111
|
+
timedelta(minutes=20).total_seconds(), # timeout to read
|
112
|
+
),
|
96
113
|
)
|
114
|
+
print(f"Downloading file finished with status {response.status_code}")
|
115
|
+
response.raise_for_status()
|
116
|
+
|
117
|
+
with open(to_path, "wb") as f:
|
118
|
+
for chunk in response.iter_content(chunk_size=MAX_CHUNK_SIZE):
|
119
|
+
if chunk:
|
120
|
+
f.write(chunk)
|
97
121
|
|
98
|
-
return
|
122
|
+
return to_path
|
99
123
|
except Exception as error:
|
100
124
|
raise QwakException(f"Unable to load save artifact locally: {str(error)}")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: qwak-core
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.253
|
4
4
|
Summary: Qwak Core contains the necessary objects and communication tools for using the Qwak Platform
|
5
5
|
License: Apache-2.0
|
6
6
|
Keywords: mlops,ml,deployment,serving,model
|
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.8
|
|
18
18
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
19
19
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
20
20
|
Provides-Extra: feature-store
|
21
|
+
Provides-Extra: local-core-dependencies
|
21
22
|
Requires-Dist: PyYAML
|
22
23
|
Requires-Dist: cachetools
|
23
24
|
Requires-Dist: chevron (==0.14.0)
|
@@ -27,8 +28,11 @@ Requires-Dist: dependency-injector (>=4.0)
|
|
27
28
|
Requires-Dist: filelock
|
28
29
|
Requires-Dist: frogml-storage (>=0.11.2)
|
29
30
|
Requires-Dist: grpcio (>=1.57.0)
|
31
|
+
Requires-Dist: grpcio-tools (>=1.47.0) ; (python_full_version >= "3.7.1" and python_version < "3.10") and (extra == "local-core-dependencies")
|
32
|
+
Requires-Dist: grpcio-tools (>=1.56.2) ; (python_version >= "3.10") and (extra == "local-core-dependencies")
|
30
33
|
Requires-Dist: joblib (>=1.3.2,<2.0.0)
|
31
34
|
Requires-Dist: marshmallow-dataclass (>=8.5.8,<9.0.0)
|
35
|
+
Requires-Dist: mypy-protobuf (>=3.0.0,<4.0.0) ; extra == "local-core-dependencies"
|
32
36
|
Requires-Dist: protobuf (>=3.10,<4) ; python_full_version >= "3.7.1" and python_version < "3.10"
|
33
37
|
Requires-Dist: protobuf (>=4.21.6) ; python_version >= "3.10"
|
34
38
|
Requires-Dist: pyarrow (>=6.0.0) ; extra == "feature-store"
|
@@ -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=h1h_J8C7TMOXTantCGO5DqTlP3H6fb0xw0z8optQEUw,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
|
@@ -961,7 +961,7 @@ 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=
|
964
|
+
qwak/model_loggers/artifact_logger.py,sha256=Emv8eSpgxJ_5_uCiNLUloTNdXPCtWC0pJDcWMcc6A78,3909
|
965
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
|
@@ -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.253.dist-info/METADATA,sha256=MvUHjty_FOLEHMbX845cc0gPFneR3LxXdK0UOwKCLqA,2549
|
1060
|
+
qwak_core-0.4.253.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
1061
|
+
qwak_core-0.4.253.dist-info/RECORD,,
|
File without changes
|