frogml-core 0.0.71__py3-none-any.whl → 0.0.72__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 CHANGED
@@ -1,7 +1,7 @@
1
1
  """Top-level package for frogml."""
2
2
 
3
3
  __author__ = "jfrog"
4
- __version__ = "0.0.71"
4
+ __version__ = "0.0.72"
5
5
 
6
6
  from frogml_core.inner.di_configuration import wire_dependencies
7
7
  from frogml_core.model.model_version_tracking import ( # noqa: F401,E501
@@ -10,7 +10,6 @@ from retrying import retry
10
10
 
11
11
  from frogml_proto.qwak.builds.build_url_pb2 import BuildVersioningTagsType
12
12
  from frogml_proto.qwak.builds.builds_orchestrator_service_pb2 import (
13
- AuthenticationDetail,
14
13
  GetBuildVersioningUploadURLResponse,
15
14
  )
16
15
  from frogml_core.exceptions import FrogmlException, FrogmlGeneralBuildException
@@ -159,15 +158,17 @@ class UploadStep(Step):
159
158
  ):
160
159
  self.build_logger.debug(f"Upload file {file}")
161
160
 
162
- pre_signed_url_response = self.get_pre_signed_upload_url(
163
- tag=tag, tag_type=BuildVersioningTagsType.FILE_TAG_TYPE
161
+ pre_signed_url_response: GetBuildVersioningUploadURLResponse = (
162
+ self.get_pre_signed_upload_url(
163
+ tag=tag, tag_type=BuildVersioningTagsType.FILE_TAG_TYPE
164
+ )
164
165
  )
165
166
  self.upload_file_to_remote_storge(
166
167
  upload_url=pre_signed_url_response.upload_url,
167
168
  file=file,
168
169
  all_files_size_to_upload=all_files_size_to_upload,
169
170
  read_so_far=read_so_far,
170
- authentication_details=pre_signed_url_response.authentication_detail,
171
+ headers=pre_signed_url_response.headers,
171
172
  )
172
173
 
173
174
  self.build_logger.debug(f"Upload file {file} completed")
@@ -204,22 +205,16 @@ class UploadStep(Step):
204
205
  file: Path,
205
206
  all_files_size_to_upload: int,
206
207
  read_so_far: int,
207
- authentication_details: Optional[AuthenticationDetail] = None,
208
+ headers: Optional[dict] = None,
208
209
  ):
210
+ if not headers:
211
+ headers = {}
212
+
209
213
  try:
210
214
  self.build_logger.debug(f"Upload file {file} to Qwak storage")
211
- auth: Optional[Tuple[str, str]] = None
212
- if (
213
- authentication_details.WhichOneof("integration_type")
214
- == "jfrog_authentication_detail"
215
- ):
216
- auth = (
217
- authentication_details.jfrog_authentication_detail.username,
218
- authentication_details.jfrog_authentication_detail.token,
219
- )
220
215
 
221
216
  self.send_request(
222
- upload_url, file, all_files_size_to_upload, read_so_far, auth
217
+ upload_url, file, all_files_size_to_upload, read_so_far, headers
223
218
  )
224
219
  self.build_logger.debug(
225
220
  f"File {file} uploaded to Qwak storage successfully"
@@ -237,8 +232,14 @@ class UploadStep(Step):
237
232
  file: Path,
238
233
  all_files_size_to_upload: int,
239
234
  read_so_far: int,
240
- auth: Optional[Tuple[str, str]],
235
+ headers: Optional[dict],
241
236
  ):
237
+ if not headers:
238
+ headers = {}
239
+
240
+ # Adding to the current headers the content-type
241
+ headers["content-type"] = "text/plain"
242
+
242
243
  http_response = requests.put( # nosec B113
243
244
  url=upload_url,
244
245
  data=UploadInChunks(
@@ -248,8 +249,7 @@ class UploadStep(Step):
248
249
  all_files_size_to_upload=all_files_size_to_upload,
249
250
  read_so_far=read_so_far,
250
251
  ),
251
- auth=auth,
252
- headers={"content-type": "text/plain"},
252
+ headers=headers,
253
253
  )
254
254
 
255
255
  if http_response.status_code not in [200, 201]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: frogml-core
3
- Version: 0.0.71
3
+ Version: 0.0.72
4
4
  Summary: frogml Core contains the necessary objects and communication tools for using the Jfrog ml Platform
5
5
  License: Apache-2.0
6
6
  Keywords: mlops,ml,deployment,serving,model
@@ -1,4 +1,4 @@
1
- frogml_core/__init__.py,sha256=ulzYRqlreb83b240lIjMo6hT8Vweg-Pr8UncNGR-d_4,777
1
+ frogml_core/__init__.py,sha256=3K96265rqyrsUYDxxsCrsjPeUs7MIy5XlgMXY9_BO5A,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
@@ -260,7 +260,7 @@ frogml_core/inner/build_logic/phases/phase_010_fetch_model/set_version_step.py,s
260
260
  frogml_core/inner/build_logic/phases/phase_020_remote_register_frogml_build/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
261
261
  frogml_core/inner/build_logic/phases/phase_020_remote_register_frogml_build/cleanup_step.py,sha256=HmQ0iQ9pJxLZTDzUvwVwwWO2CG-4fHtxwmye-xL0Q9U,632
262
262
  frogml_core/inner/build_logic/phases/phase_020_remote_register_frogml_build/start_remote_build_step.py,sha256=UQWLfJpj9lm0fJfKj0Kc2N99x6ioUVfKPXrf1u70rJY,1691
263
- frogml_core/inner/build_logic/phases/phase_020_remote_register_frogml_build/upload_step.py,sha256=TbNonL_FR0yycEiPqAGYldPD5hY_ooXDXo3JgvMdWC8,9617
263
+ frogml_core/inner/build_logic/phases/phase_020_remote_register_frogml_build/upload_step.py,sha256=bbNSttwy2vEZv9yfE1Ndxf_rv03KP7QuM4Q9rM9BEUI,9350
264
264
  frogml_core/inner/build_logic/phases/phases_pipeline.py,sha256=Ei70zbiiT6Be2aFLV7Z5zcVykm2peOsd-UFLG47AR_c,1258
265
265
  frogml_core/inner/build_logic/run_handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
266
266
  frogml_core/inner/build_logic/run_handlers/programmatic_phase_run_handler.py,sha256=XE1afXZfA1AQOa9bV2CtmK--gcX0YKRhLwGdkfb3cto,3547
@@ -1082,6 +1082,6 @@ frogml_services_mock/mocks/workspace_manager_service_mock.py,sha256=WbOiWgOyr-xT
1082
1082
  frogml_services_mock/services_mock.py,sha256=_34z6rFCHFwcSni-9eyJlrH264xsL_QDNmG-EBv0zMc,20281
1083
1083
  frogml_services_mock/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1084
1084
  frogml_services_mock/utils/service_utils.py,sha256=ZlB0CnB1J6oBn6_m7fQO2U8tKoboHdUa6ljjkRMYNXU,265
1085
- frogml_core-0.0.71.dist-info/METADATA,sha256=OMEQfxHj-4aK09h3A6A-1ak4g6BkW3H_1-GGyOZXkmE,2004
1086
- frogml_core-0.0.71.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
1087
- frogml_core-0.0.71.dist-info/RECORD,,
1085
+ frogml_core-0.0.72.dist-info/METADATA,sha256=F0pOBIedX8mbtzKDvMg0xLciGRTXE-mjzhMMrQAjb3I,2004
1086
+ frogml_core-0.0.72.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
1087
+ frogml_core-0.0.72.dist-info/RECORD,,