qwak-core 0.4.245__py3-none-any.whl → 0.4.246__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/build_logic/phases/phase_020_remote_register_qwak_build/upload_step.py +20 -20
- {qwak_core-0.4.245.dist-info → qwak_core-0.4.246.dist-info}/METADATA +1 -1
- {qwak_core-0.4.245.dist-info → qwak_core-0.4.246.dist-info}/RECORD +5 -5
- {qwak_core-0.4.245.dist-info → qwak_core-0.4.246.dist-info}/WHEEL +0 -0
qwak/__init__.py
CHANGED
@@ -3,15 +3,14 @@ from __future__ import annotations
|
|
3
3
|
import re
|
4
4
|
from pathlib import Path
|
5
5
|
from typing import Any, List, Tuple, Union, Optional
|
6
|
-
from retrying import retry
|
7
6
|
|
8
7
|
import joblib
|
9
8
|
import requests
|
9
|
+
from retrying import retry
|
10
10
|
|
11
11
|
from _qwak_proto.qwak.builds.build_url_pb2 import BuildVersioningTagsType
|
12
12
|
from _qwak_proto.qwak.builds.builds_orchestrator_service_pb2 import (
|
13
13
|
GetBuildVersioningUploadURLResponse,
|
14
|
-
AuthenticationDetail,
|
15
14
|
)
|
16
15
|
from qwak.exceptions import QwakException
|
17
16
|
from qwak.exceptions import QwakGeneralBuildException
|
@@ -158,15 +157,17 @@ class UploadStep(Step):
|
|
158
157
|
):
|
159
158
|
self.build_logger.debug(f"Upload file {file}")
|
160
159
|
|
161
|
-
pre_signed_url_response =
|
162
|
-
|
160
|
+
pre_signed_url_response: GetBuildVersioningUploadURLResponse = (
|
161
|
+
self.get_pre_signed_upload_url(
|
162
|
+
tag=tag, tag_type=BuildVersioningTagsType.FILE_TAG_TYPE
|
163
|
+
)
|
163
164
|
)
|
164
165
|
self.upload_file_to_remote_storge(
|
165
166
|
upload_url=pre_signed_url_response.upload_url,
|
166
167
|
file=file,
|
167
168
|
all_files_size_to_upload=all_files_size_to_upload,
|
168
169
|
read_so_far=read_so_far,
|
169
|
-
|
170
|
+
headers=pre_signed_url_response.headers,
|
170
171
|
)
|
171
172
|
|
172
173
|
self.build_logger.debug(f"Upload file {file} completed")
|
@@ -179,7 +180,7 @@ class UploadStep(Step):
|
|
179
180
|
try:
|
180
181
|
self.build_logger.debug(f"Getting pre-signed url for upload - tag {tag}")
|
181
182
|
|
182
|
-
pre_signed_url_response = (
|
183
|
+
pre_signed_url_response: GetBuildVersioningUploadURLResponse = (
|
183
184
|
self.context.client_builds_orchestrator.get_build_versioning_upload_url(
|
184
185
|
build_id=self.context.build_id,
|
185
186
|
model_id=self.context.model_id,
|
@@ -203,22 +204,16 @@ class UploadStep(Step):
|
|
203
204
|
file: Path,
|
204
205
|
all_files_size_to_upload: int,
|
205
206
|
read_so_far: int,
|
206
|
-
|
207
|
+
headers: Optional[dict] = None,
|
207
208
|
):
|
209
|
+
if not headers:
|
210
|
+
headers = {}
|
211
|
+
|
208
212
|
try:
|
209
213
|
self.build_logger.debug(f"Upload file {file} to Qwak storage")
|
210
|
-
auth: Optional[Tuple[str, str]] = None
|
211
|
-
if (
|
212
|
-
authentication_details.WhichOneof("integration_type")
|
213
|
-
== "jfrog_authentication_detail"
|
214
|
-
):
|
215
|
-
auth = (
|
216
|
-
authentication_details.jfrog_authentication_detail.username,
|
217
|
-
authentication_details.jfrog_authentication_detail.token,
|
218
|
-
)
|
219
214
|
|
220
215
|
self.send_request(
|
221
|
-
upload_url, file, all_files_size_to_upload, read_so_far,
|
216
|
+
upload_url, file, all_files_size_to_upload, read_so_far, headers
|
222
217
|
)
|
223
218
|
self.build_logger.debug(
|
224
219
|
f"File {file} uploaded to Qwak storage successfully"
|
@@ -236,8 +231,14 @@ class UploadStep(Step):
|
|
236
231
|
file: Path,
|
237
232
|
all_files_size_to_upload: int,
|
238
233
|
read_so_far: int,
|
239
|
-
|
234
|
+
headers: Optional[dict],
|
240
235
|
):
|
236
|
+
if not headers:
|
237
|
+
headers = {}
|
238
|
+
|
239
|
+
# Adding to the current headers the content-type
|
240
|
+
headers["content-type"] = "text/plain"
|
241
|
+
|
241
242
|
http_response = requests.put( # nosec B113
|
242
243
|
url=upload_url,
|
243
244
|
data=UploadInChunks(
|
@@ -247,8 +248,7 @@ class UploadStep(Step):
|
|
247
248
|
all_files_size_to_upload=all_files_size_to_upload,
|
248
249
|
read_so_far=read_so_far,
|
249
250
|
),
|
250
|
-
|
251
|
-
headers={"content-type": "text/plain"},
|
251
|
+
headers=headers,
|
252
252
|
)
|
253
253
|
|
254
254
|
if http_response.status_code not in [200, 201]:
|
@@ -576,7 +576,7 @@ _qwak_proto/qwak/workspace/workspace_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXH
|
|
576
576
|
_qwak_proto/qwak/workspace/workspace_service_pb2.py,sha256=AB3C9S_AbOD7Nx1Ni4j1rW6PNtYTV1zjiqFQk-goQ74,21429
|
577
577
|
_qwak_proto/qwak/workspace/workspace_service_pb2.pyi,sha256=nKKCHwnovZhsy8TSVmdz-Vtl0nviOOoX56HD-41Xo08,13726
|
578
578
|
_qwak_proto/qwak/workspace/workspace_service_pb2_grpc.py,sha256=yKGuexxTBza99Ihe0DSTniV2ZSd_AG47inHenqfi890,27193
|
579
|
-
qwak/__init__.py,sha256=
|
579
|
+
qwak/__init__.py,sha256=NI8Z0miVc9RaYzA7QH7AlrhoEjQOmUcaFlF7EcOmxO0,587
|
580
580
|
qwak/automations/__init__.py,sha256=qFZRvCxUUn8gcxkJR0v19ulHW2oJ0x6-Rif7HiheDP4,1522
|
581
581
|
qwak/automations/automation_executions.py,sha256=5MeH_epYYWb8NKXgAozwT_jPyyUDednBHG7izloi7RY,3228
|
582
582
|
qwak/automations/automations.py,sha256=3yx8e2v0uSKDnXbqyknasyEoQ5vxGni6K40Hbi1_zkk,12599
|
@@ -810,7 +810,7 @@ qwak/inner/build_logic/phases/phase_010_fetch_model/set_version_step.py,sha256=M
|
|
810
810
|
qwak/inner/build_logic/phases/phase_020_remote_register_qwak_build/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
811
811
|
qwak/inner/build_logic/phases/phase_020_remote_register_qwak_build/cleanup_step.py,sha256=Nxv3wAbuCocvsC1V7-gGSTRLOEKdrlViME4_BUTedCY,618
|
812
812
|
qwak/inner/build_logic/phases/phase_020_remote_register_qwak_build/start_remote_build_step.py,sha256=3k8wLGh-tANo0AYJstPHIACpSul-h7gYbxGgFQZzRZQ,1673
|
813
|
-
qwak/inner/build_logic/phases/phase_020_remote_register_qwak_build/upload_step.py,sha256=
|
813
|
+
qwak/inner/build_logic/phases/phase_020_remote_register_qwak_build/upload_step.py,sha256=tj42f3h1uFl4FYiwp0uBxfRVqFyiGQLEIJ4iz1M_IJc,9323
|
814
814
|
qwak/inner/build_logic/phases/phases_pipeline.py,sha256=KveRNEYji1FbzP1tswJWReMqoCnuHfDLmYFeS4YBJpE,1244
|
815
815
|
qwak/inner/build_logic/run_handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
816
816
|
qwak/inner/build_logic/run_handlers/programmatic_phase_run_handler.py,sha256=nDR0e357sc-Lr-36uCUzxCK3LORzqYyoutHQ3rmXo1w,3484
|
@@ -1052,6 +1052,6 @@ qwak_services_mock/mocks/workspace_manager_service_mock.py,sha256=O9ZSwln4T4kHVk
|
|
1052
1052
|
qwak_services_mock/services_mock.py,sha256=CABZ2teXoSJ-X7CD3iRo5ht-w3jhW-Cvpb47APUHXEA,19089
|
1053
1053
|
qwak_services_mock/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1054
1054
|
qwak_services_mock/utils/service_utils.py,sha256=ZlB0CnB1J6oBn6_m7fQO2U8tKoboHdUa6ljjkRMYNXU,265
|
1055
|
-
qwak_core-0.4.
|
1056
|
-
qwak_core-0.4.
|
1057
|
-
qwak_core-0.4.
|
1055
|
+
qwak_core-0.4.246.dist-info/METADATA,sha256=HOEV8pRohcWvk7huZnH3R9NpzwIT5pLppjfhfr2bc2I,2150
|
1056
|
+
qwak_core-0.4.246.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
1057
|
+
qwak_core-0.4.246.dist-info/RECORD,,
|
File without changes
|