qwak-core 0.4.247__py3-none-any.whl → 0.4.249__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/inner/tool/auth.py +7 -10
- 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.249.dist-info}/METADATA +2 -2
- {qwak_core-0.4.247.dist-info → qwak_core-0.4.249.dist-info}/RECORD +9 -9
- {qwak_core-0.4.247.dist-info → qwak_core-0.4.249.dist-info}/WHEEL +1 -1
- qwak_services_mock/mocks/authentication_service.py +3 -2
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]:
|
qwak/inner/tool/auth.py
CHANGED
@@ -1,20 +1,17 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
from qwak.inner.di_configuration.session import Session
|
1
|
+
import configparser # noqa E402
|
2
|
+
import json # noqa E402
|
4
3
|
from abc import ABC, abstractmethod
|
5
4
|
from typing import Optional
|
5
|
+
|
6
|
+
import jwt
|
7
|
+
import requests # noqa E402
|
8
|
+
from filelock import FileLock
|
6
9
|
from frogml_storage.authentication._authentication_utils import get_credentials
|
7
10
|
from frogml_storage.authentication.models._auth_config import AuthConfig
|
8
11
|
|
9
|
-
warnings.filterwarnings(action="ignore", module=".*jose.*")
|
10
|
-
|
11
|
-
import configparser # noqa E402
|
12
|
-
import json # noqa E402
|
13
|
-
|
14
|
-
import requests # noqa E402
|
15
|
-
from jose import jwt # noqa E402
|
16
12
|
from qwak.exceptions import QwakLoginException # noqa E402
|
17
13
|
from qwak.inner.const import QwakConstants # noqa E402
|
14
|
+
from qwak.inner.di_configuration.session import Session
|
18
15
|
|
19
16
|
|
20
17
|
class BaseAuthClient(ABC):
|
@@ -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(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: qwak-core
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.249
|
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
|
@@ -33,8 +33,8 @@ Requires-Dist: protobuf (>=3.10,<4) ; python_full_version >= "3.7.1" and python_
|
|
33
33
|
Requires-Dist: protobuf (>=4.21.6) ; python_version >= "3.10"
|
34
34
|
Requires-Dist: pyarrow (>=6.0.0) ; extra == "feature-store"
|
35
35
|
Requires-Dist: pyathena (>=2.2.0,!=2.18.0) ; extra == "feature-store"
|
36
|
+
Requires-Dist: pyjwt
|
36
37
|
Requires-Dist: pyspark (==3.4.2) ; extra == "feature-store"
|
37
|
-
Requires-Dist: python-jose
|
38
38
|
Requires-Dist: python-json-logger (>=2.0.2)
|
39
39
|
Requires-Dist: requests
|
40
40
|
Requires-Dist: retrying (==1.3.4)
|
@@ -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=3a-SBWVj7mewpO7vIuqjIomXkbNiBf2CbHM4o6av-_8,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,13 +831,13 @@ 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
|
838
838
|
qwak/inner/singleton_meta.py,sha256=1cU99I0f9tjuMQLMJyLsK1oK3fZJMsO5-TbRHAMXqds,627
|
839
839
|
qwak/inner/tool/__init__.py,sha256=DDoMZk7LIZNfu63Ft0mLE5wflwlQoghAJ1ZmMAcAeVE,74
|
840
|
-
qwak/inner/tool/auth.py,sha256=
|
840
|
+
qwak/inner/tool/auth.py,sha256=qlVakViyHDW3yzB90GTwLMSq5fc4ez0hryZuQM1JOV8,6339
|
841
841
|
qwak/inner/tool/grpc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
842
842
|
qwak/inner/tool/grpc/grpc_auth.py,sha256=nHfIk2R5ljCvU8hsgk_X6grfNhVrbTvQe6uJffe5W5o,2291
|
843
843
|
qwak/inner/tool/grpc/grpc_tools.py,sha256=ArtsEZz5V-YxOVE6vH_UHJwOn6gAJVIolda8hF6qwMs,7256
|
@@ -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
|
@@ -1012,7 +1012,7 @@ qwak_services_mock/mocks/alert_manager_service_api.py,sha256=X9VF5-zroUqo9SpeaG_
|
|
1012
1012
|
qwak_services_mock/mocks/alert_registry_service_api.py,sha256=SZIOzQ-L9p7TIhziXUhpio8b4xtqTvAhR7c2JlMQXvc,2263
|
1013
1013
|
qwak_services_mock/mocks/analytics_api.py,sha256=uzfObcytu9y_CYDT7ogilXJUOGLExQquJVL2kkATYE0,2129
|
1014
1014
|
qwak_services_mock/mocks/audience_service_api.py,sha256=2PvXpzKBR-Dnu9Fmb70UJn-hNAlTCYQggpdiiBMM8Ik,2647
|
1015
|
-
qwak_services_mock/mocks/authentication_service.py,sha256=
|
1015
|
+
qwak_services_mock/mocks/authentication_service.py,sha256=LLCO45fMHqsKBWdgat384n_P5dgNdCywjxNkQUJ1m98,1161
|
1016
1016
|
qwak_services_mock/mocks/automation_management_service.py,sha256=C9rYKMy0hzOTaKTCrTkE5jTnPSenVkLV8DCptBKr02U,8211
|
1017
1017
|
qwak_services_mock/mocks/autoscaling_service_api.py,sha256=YgucRD3ZjhxqttNVSF_HL7u3aDo55LdRSEE7q0fxp3M,1019
|
1018
1018
|
qwak_services_mock/mocks/batch_job_manager_service.py,sha256=HeUZulDtfIlSm2h4cLdByR0voJjOy97m4_YWldg7pqQ,13129
|
@@ -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.249.dist-info/METADATA,sha256=c-sR09h4sXZ90eCBRwY2NRnO1xyxJEbDaa5gXPt3axs,2144
|
1060
|
+
qwak_core-0.4.249.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
1061
|
+
qwak_core-0.4.249.dist-info/RECORD,,
|
@@ -1,5 +1,7 @@
|
|
1
1
|
from datetime import datetime, timedelta
|
2
2
|
|
3
|
+
import jwt
|
4
|
+
|
3
5
|
from _qwak_proto.qwak.administration.v0.authentication.authentication_service_pb2 import (
|
4
6
|
AuthenticateRequest,
|
5
7
|
AuthenticateResponse,
|
@@ -7,7 +9,6 @@ from _qwak_proto.qwak.administration.v0.authentication.authentication_service_pb
|
|
7
9
|
from _qwak_proto.qwak.administration.v0.authentication.authentication_service_pb2_grpc import (
|
8
10
|
AuthenticationServiceServicer,
|
9
11
|
)
|
10
|
-
from jose import jwt
|
11
12
|
|
12
13
|
epoch = datetime.timestamp(datetime.utcnow() + timedelta(days=1))
|
13
14
|
|
@@ -22,7 +23,7 @@ _payload = {
|
|
22
23
|
"exp": epoch,
|
23
24
|
}
|
24
25
|
|
25
|
-
mock_jwt_token = jwt.encode(_payload, "secret", algorithm="HS256")
|
26
|
+
mock_jwt_token = jwt.encode(_payload, key="secret", algorithm="HS256")
|
26
27
|
|
27
28
|
|
28
29
|
class AuthenticationServiceMock(AuthenticationServiceServicer):
|