qwak-core 0.4.366__py3-none-any.whl → 0.4.392__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.

Potentially problematic release.


This version of qwak-core might be problematic. Click here for more details.

Files changed (66) hide show
  1. _qwak_proto/qwak/administration/runtime_configuration/v0/external/databricks/auth_pb2.py +6 -4
  2. _qwak_proto/qwak/administration/runtime_configuration/v0/external/databricks/auth_pb2.pyi +27 -4
  3. _qwak_proto/qwak/administration/runtime_configuration/v0/hosting/azure/auth_pb2.py +5 -3
  4. _qwak_proto/qwak/administration/runtime_configuration/v0/hosting/azure/auth_pb2.pyi +21 -1
  5. _qwak_proto/qwak/batch_job/v1/batch_job_service_pb2.pyi +1 -1
  6. _qwak_proto/qwak/builds/build_pb2.py +42 -41
  7. _qwak_proto/qwak/builds/build_pb2.pyi +8 -1
  8. _qwak_proto/qwak/builds/build_values_pb2.py +76 -0
  9. _qwak_proto/qwak/builds/build_values_pb2.pyi +533 -0
  10. _qwak_proto/qwak/builds/build_values_pb2_grpc.py +4 -0
  11. _qwak_proto/qwak/kube_deployment_captain/batch_job_pb2.pyi +1 -1
  12. _qwak_proto/qwak/projects/projects_pb2.py +17 -15
  13. qwak/__init__.py +1 -1
  14. qwak/clients/model_management/client.py +0 -5
  15. qwak/clients/project/client.py +0 -7
  16. qwak/feature_store/_common/packaging.py +11 -5
  17. qwak/inner/const.py +0 -2
  18. qwak/inner/di_configuration/account.py +6 -66
  19. qwak/inner/tool/auth.py +0 -86
  20. qwak/inner/tool/grpc/grpc_auth.py +0 -32
  21. qwak/inner/tool/grpc/grpc_tools.py +2 -8
  22. qwak/inner/tool/grpc/grpc_try_wrapping.py +3 -1
  23. qwak/qwak_client/client.py +2 -8
  24. qwak/vector_store/rest_helpers.py +4 -16
  25. qwak_core-0.4.392.dist-info/METADATA +50 -0
  26. {qwak_core-0.4.366.dist-info → qwak_core-0.4.392.dist-info}/RECORD +27 -62
  27. frogml_storage/__init__.py +0 -1
  28. frogml_storage/artifactory/__init__.py +0 -1
  29. frogml_storage/artifactory/_artifactory_api.py +0 -315
  30. frogml_storage/authentication/login/__init__.py +0 -1
  31. frogml_storage/authentication/login/_login_cli.py +0 -239
  32. frogml_storage/authentication/login/_login_command.py +0 -74
  33. frogml_storage/authentication/models/__init__.py +0 -3
  34. frogml_storage/authentication/models/_auth.py +0 -24
  35. frogml_storage/authentication/models/_auth_config.py +0 -70
  36. frogml_storage/authentication/models/_login.py +0 -22
  37. frogml_storage/authentication/utils/__init__.py +0 -17
  38. frogml_storage/authentication/utils/_authentication_utils.py +0 -281
  39. frogml_storage/authentication/utils/_login_checks_utils.py +0 -114
  40. frogml_storage/base_storage.py +0 -140
  41. frogml_storage/constants.py +0 -56
  42. frogml_storage/exceptions/checksum_verification_error.py +0 -3
  43. frogml_storage/exceptions/validation_error.py +0 -4
  44. frogml_storage/frog_ml.py +0 -668
  45. frogml_storage/http/__init__.py +0 -1
  46. frogml_storage/http/http_client.py +0 -83
  47. frogml_storage/logging/__init__.py +0 -1
  48. frogml_storage/logging/_log_config.py +0 -45
  49. frogml_storage/logging/log_utils.py +0 -21
  50. frogml_storage/models/__init__.py +0 -1
  51. frogml_storage/models/_download_context.py +0 -54
  52. frogml_storage/models/dataset_manifest.py +0 -13
  53. frogml_storage/models/entity_manifest.py +0 -93
  54. frogml_storage/models/frogml_dataset_version.py +0 -21
  55. frogml_storage/models/frogml_entity_type_info.py +0 -50
  56. frogml_storage/models/frogml_entity_version.py +0 -34
  57. frogml_storage/models/frogml_model_version.py +0 -21
  58. frogml_storage/models/model_manifest.py +0 -60
  59. frogml_storage/models/serialization_metadata.py +0 -15
  60. frogml_storage/utils/__init__.py +0 -12
  61. frogml_storage/utils/_environment.py +0 -21
  62. frogml_storage/utils/_input_checks_utility.py +0 -104
  63. frogml_storage/utils/_storage_utils.py +0 -15
  64. frogml_storage/utils/_url_utils.py +0 -27
  65. qwak_core-0.4.366.dist-info/METADATA +0 -414
  66. {qwak_core-0.4.366.dist-info → qwak_core-0.4.392.dist-info}/WHEEL +0 -0
@@ -1,27 +0,0 @@
1
- from typing import Optional, List
2
- from urllib.parse import urlparse
3
-
4
-
5
- def join_url(base_uri: str, *parts: str) -> str:
6
- base_uri = base_uri.rstrip("/")
7
-
8
- cleaned_parts: List[str] = [
9
- part.strip("/") for part in parts if part is not None and part.strip("/")
10
- ]
11
- uri_parts: List[str] = [base_uri, *cleaned_parts]
12
-
13
- return "/".join(uri_parts)
14
-
15
-
16
- def assemble_artifact_url(uri: Optional[str]) -> str:
17
- if uri is None:
18
- raise Exception("Artifactory URI is required")
19
-
20
- parsed_url = urlparse(uri)
21
- if parsed_url.scheme not in ["http", "https"]:
22
- raise Exception(
23
- f"Not a valid Artifactory URI: {uri}. "
24
- f"Artifactory URI example: `https://frogger.jfrog.io/artifactory/ml-local`"
25
- )
26
-
27
- return f"{parsed_url.scheme}://{parsed_url.netloc}/artifactory"
@@ -1,414 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: qwak-core
3
- Version: 0.4.366
4
- Summary: Qwak Core contains the necessary objects and communication tools for using the Qwak Platform
5
- License: Apache-2.0
6
- Keywords: mlops,ml,deployment,serving,model
7
- Author: Qwak
8
- Author-email: info@qwak.com
9
- Requires-Python: >=3.9,<3.12
10
- Classifier: License :: OSI Approved :: Apache Software License
11
- Classifier: Operating System :: OS Independent
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.9
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.7
17
- Classifier: Programming Language :: Python :: 3.8
18
- Classifier: Programming Language :: Python :: Implementation :: CPython
19
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
- Provides-Extra: feature-store
21
- Requires-Dist: PyYAML (>=6.0.2)
22
- Requires-Dist: cachetools
23
- Requires-Dist: chevron (==0.14.0)
24
- Requires-Dist: cloudpickle (==2.2.1) ; extra == "feature-store"
25
- Requires-Dist: dacite (==1.8.1)
26
- Requires-Dist: dependency-injector (>=4.0)
27
- Requires-Dist: filelock
28
- Requires-Dist: grpcio (>=1.71.2)
29
- Requires-Dist: joblib (>=1.3.2,<2.0.0)
30
- Requires-Dist: marshmallow-dataclass (>=8.5.8,<9.0.0)
31
- Requires-Dist: protobuf (>=4.25.8,<5)
32
- Requires-Dist: pyarrow (>=20.0.0) ; extra == "feature-store"
33
- Requires-Dist: pyathena (>=2.2.0,!=2.18.0) ; extra == "feature-store"
34
- Requires-Dist: pydantic
35
- Requires-Dist: pyspark (==3.4.2) ; extra == "feature-store"
36
- Requires-Dist: python-jose[cryptography] (>=3.4.0)
37
- Requires-Dist: python-json-logger (>=2.0.2)
38
- Requires-Dist: requests
39
- Requires-Dist: retrying (==1.3.4)
40
- Requires-Dist: tqdm
41
- Requires-Dist: typeguard (>=2,<3)
42
- Requires-Dist: typer
43
- Project-URL: Home page, https://www.qwak.com/
44
- Description-Content-Type: text/markdown
45
-
46
- # Qwak Core
47
-
48
- Qwak is an end-to-end production ML platform designed to allow data scientists to build, deploy, and monitor their models in production with minimal engineering friction.
49
- Qwak Core contains all the objects and tools necessary to use the Qwak Platform
50
-
51
- # Frog ML Storage
52
-
53
- ## Table of contents:
54
-
55
- - [Overview](#overview)
56
- - [Working with Artifactory](#Working-with-Artifactory)
57
- - [Login by adding authentication details to your python code](#Login-by-adding-authentication-details-to-your-python-code)
58
- - [Login via environment variables](#Login-via-environment-variables)
59
- - [Login via cli](#Login-via-cli)
60
- - [Login by a single command line with options](#Login-by-a-single-command-line-with-options)
61
- - [Login by interactive flow in Cli](#Login-by-interactive-flow-in-Cli)
62
- - [Upload ML model to Artifactory](#Upload-ML-model-to-Artifactory)
63
- - [Download ML model from Artifactory](#Download-ML-model-from-Artifactory)
64
- - [Upload ML dataset to Artifactory](#Upload-ML-dataset-to-Artifactory)
65
- - [Download ML dataset from Artifactory](#Download-ML-dataset-from-Artifactory)
66
- - [Testing](#Testing)
67
- - [Locally run integration tests using local artifactory](#Locally-run-integration-tests-using-artifactory)
68
- - [Locally run tests using existing Artifactory](#Locally-run-tests-using-existing-Artifactory)
69
- - [Packaging](#Packaging)
70
- - [Linters](#Linters)
71
-
72
- ## Overview
73
-
74
- JFrog ML Storage is a smart python client library providing a simple and efficient method of storing and downloading models, model data and datasets from the JFrog platform, utilizing the advanced capabilities of the JFrog platform.
75
-
76
- ## Working with Artifactory
77
-
78
- FrogML Storage Library support is available from Artifactory version 7.84.x.
79
-
80
- To be able to use FrogML Storage with Artifactory, you should authenticate the frogml storage client against Artifactory.
81
- JFrog implements a credentials provider chain. It sequentially checks each place where you can set the credentials to authenticate with FrogML, and then selects the first one you set.
82
-
83
- The credentials retrieval order is as follows:
84
-
85
- 1. [Login by adding authentication details to your python code](#Login-by-adding-authentication-details-to-your-python-code)
86
- 2. [Login via environment variables](#Login-via-environment-variables)
87
- 3. [Login via cli](#login-via-cli)
88
-
89
-
90
- #### Login by adding authentication details to your python code
91
-
92
- ---
93
- **NOTE**
94
-
95
- It is strongly discouraged to use credentials in clear text. Use this method for testing purposes only.
96
-
97
- ---
98
-
99
- You can authenticate the FrogML client directly via your Python code, using any of the following credentials (overriding env vars and the credentials in the configuration file):
100
- - Username and Password
101
- - Access Token
102
-
103
- To log in as an anonymous user, log in first via CLI, and then you will be able to log in via Python using only your JFrog Platform domain.
104
-
105
- Authentication by username and password:
106
-
107
- ```
108
- from frogml_storage.frog_ml import FrogMLStorage
109
- from frogml_storage.authentication.models._auth_config import AuthConfig
110
-
111
- arti = FrogMLStorage(AuthConfig.by_basic_auth("http://myorg.jfrog.io", <username>, <password>))
112
- ```
113
-
114
- Authentication by access token:
115
-
116
- ```
117
- from frogml_storage.frog_ml import FrogMLStorage
118
- from frogml_storage.authentication.models._auth_config import AuthConfig
119
-
120
- arti = FrogMLStorage(AuthConfig.by_access_token("http://myorg.jfrog.io", <token>))
121
- ```
122
-
123
- #### Login via environment variables
124
-
125
- You can also authenticate the frogml client using the following environment variables:
126
-
127
- - JF_URL - your JFrog platform domain, for example 'http://myorg.jfrog.io'
128
- - JF_ACCESS_TOKEN - your artifactory token for this domain. To generate a token, log in to your artifactory, navigate to your FrogML repository and click on "Set Me Up".
129
-
130
- After setting the environment variables, you can log in to the frogml client without specifying credentials.
131
-
132
-
133
- ```
134
- from frogml_storage.frog_ml import FrogMLStorage
135
- from frogml_storage.authentication.models._auth_config import AuthConfig
136
-
137
- arti = FrogMLStorage()
138
- ```
139
-
140
-
141
- ### Login via cli
142
-
143
- It is possible to authenticate the frogml client using any of the following methods:
144
-
145
- 1. Login by a single CLI command
146
- 2. Interactive flow
147
-
148
- After each login attempt, the authentication result (success or failure) is printed on the screen.
149
- If the login attempt succeeded, the authentication details will be saved as frogml configuration file under the path: ~/.frogml/config.json and from that point you can login again without specifying credentials.
150
-
151
- In both interactive flow and the single command flow, it is possible to authenticate the frogml client by:
152
-
153
- 1. Username and password
154
- 2. Access token
155
- 3. Anonymous authentication
156
-
157
-
158
-
159
- #### Login by a single command line with options
160
-
161
- The below examples show the frogml login options using the cli:
162
-
163
- Login using existing jfrog-cli of frogml configuration files (~/.jfrog/jfrog-cli.conf.v6 or ~/.frogml/config.json, respectively):
164
-
165
- ```
166
- frogml login
167
- ```
168
- If no configuration file is found, interactive mode will be triggered.
169
-
170
- Login by username and password:
171
-
172
- ```
173
- frogml login --url <artifactory_url> --username <username> --password <password>
174
- ```
175
-
176
- Where:
177
- - artifactory_url is your JFrog platform domain, for example 'http://myorg.jfrog.io'
178
- - username and password are your artifactory credentials for this domain
179
-
180
- Login by access token:
181
-
182
- ```
183
- frogml login --url <artifactory_url> --token <access_token>
184
- ```
185
-
186
- Where:
187
- - artifactory_url is your JFrog platform domain, for example 'http://myorg.jfrog.io'
188
- - token - your artifactory token for this domain. To generate a token, log in to your artifactory and navigate to Administration -> User Management -> Access Tokens.
189
-
190
- Login by anonymous access:
191
-
192
- ```
193
- frogml login --url <artifactory_url> --anonymous
194
- ```
195
-
196
- #### Login by interactive flow in cli:
197
-
198
- To start an interactive flow in the cli, run the command:
199
-
200
- ```
201
- frogml login --interactive
202
- ```
203
-
204
- After executing the command above, the cli prompts two options as follows:
205
-
206
- ```
207
- frogml login --interactive
208
- Please select from the following options:
209
- 1.Login by jfrog-cli configuration file: ~/.jfrog/jfrog-cli.conf.v6
210
- 2.Connecting to a new server
211
- ```
212
-
213
- On choosing the first option, the cli attempts to retrieve your authentication credentials from your JFrog CLI configuration file and sends them to Artifactory.
214
-
215
- On choosing the second option, the cli prompts you to input your JFrog platform domain URL. Afterwards, you can select the method you wish to use for authenticating the FrogML library.
216
-
217
- ```
218
- Enter artifactory base url: http://myorg.jfrog.io
219
- Choose your preferred authentication option:
220
- 0: Username and Password
221
- 1: Access Token
222
- 2: Anonymous Access
223
- ```
224
-
225
-
226
- ### Upload ML model to Artifactory
227
-
228
- You can upload a model to a FrogML repository using the upload_model_version() function.
229
- You can upload a single file or an entire folder.
230
- This function uses checksum upload, assigning a SHA2 value to each model for retrieval from storage. If the binary content cannot be reused, the smart upload mechanism performs regular upload instead.
231
- After uploading the model, FrogML generates a file named model-info.json which contains the model name and its related files and dependencies.
232
-
233
- The version parameter is optional. If not specified, Artifactory will set the version as the timestamp of the time you uploaded the model in your time zone, in UTC format: yyyy-MM-dd-HH-mm-ss.
234
- Additionally, you can add properties to the model in Artifactory to categorize and label it.
235
- The function upload_model_version returns an instance of FrogMlModelVersion, which includes the model's name, version, and namespace.
236
-
237
- The below examples show how to upload a model to Artifactory:
238
-
239
- ---
240
- **NOTE**
241
-
242
- namespace, version, properties, dependencies_files_paths and code_archive_file_path are optional.
243
- model_path can point to a single file or a directory, in which case the whole directory is uploaded.
244
- model_type can be written as JSON or as SerializationMetadata object imported from jfrog_ml.serialization_metadata.
245
- All of SerializationMetadata fields must be populated.
246
-
247
- ---
248
-
249
-
250
- Upload an entire folder as model:
251
-
252
- ```
253
- from frogml_storage.frog_ml import FrogMLStorage
254
-
255
- arti = FrogMLStorage()
256
- arti.upload_model_version(repository=<repository_key>,
257
- namespace=<namespce>,
258
- model_name=<model_name>,
259
- model_path="~/model_to_upload/",
260
- model_type={"framework": "tensorflow", "framework_version": "2.3.0", "serialization_format": "H5", "runtime": "python", "runtime_version": "3.7"},
261
- properties={"model_type": "keras", "experiment": "my-exp"},
262
- dependencies_files_paths=["path/to/req/file1", "path/to/req/file2"],
263
- code_archive_file_path="path/to/code/archieve/file"
264
- )
265
- ```
266
-
267
- Upload a model with a specified version, and no dependencies and code archive:
268
-
269
- ```
270
- from frogml_storage.frog_ml import FrogMLStorage
271
-
272
- arti = FrogMLStorage()
273
- arti.upload_model_version(repository=<repository_key>,
274
- namespace=<namespce>,
275
- model_name=<model_name>,
276
- version=<version>,
277
- model_path="~/model_to_upload/",
278
- model_type={"framework": "tensorflow", "framework_version": "2.3.0", "serialization_format": "H5", "runtime": "python", "runtime_version": "3.7"}
279
- )
280
- ```
281
-
282
- ---
283
-
284
- #### Download ML model from Artifactory
285
-
286
- The below example shows how to download a model from Artifactory:
287
-
288
- ```
289
- from frogml_storage.frog_ml import FrogMLStorage
290
-
291
- arti = FrogMLStorage()
292
-
293
- arti.download_model_version(repository=<repository_key>,
294
- namespace=<namespace>,
295
- model_name=<model_name>,
296
- target_path="~/models",
297
- version=<version>)
298
- ```
299
-
300
- ---
301
- **NOTE**
302
-
303
- The dependencies and code archive cannot be downloaded.
304
-
305
- ---
306
-
307
- ### Upload ML dataset to Artifactory
308
-
309
- Upload an entire folder as dataset:
310
-
311
-
312
- ```
313
- from frogml_storage.frog_ml import FrogMLStorage
314
-
315
- arti = FrogMLStorage()
316
- arti.upload_dataset_version(repository=<repository_key>,
317
- namespace=<namespce>,
318
- dataset_name=<dataset_name>,
319
- source_path="~/dataset_to_upload/",
320
- properties={"dataset_type": "kerras", "experiment": "my-exp"})
321
- ```
322
-
323
- Upload a dataset with specified version:
324
-
325
- ```
326
- from frogml_storage.frog_ml import FrogMLStorage
327
-
328
- arti = FrogMLStorage()
329
- arti.upload_dataset_version(repository=<repository_key>,
330
- namespace=<namespce>,
331
- dataset_name=<dataset_name>,
332
- version=<version>,
333
- source_path="~/dataset_to_upload/")
334
- ```
335
-
336
- Upload a single file as a dataset:
337
-
338
- ```
339
- from frogml_storage.frog_ml import FrogMLStorage
340
-
341
- arti = FrogMLStorage()
342
- arti.upload_dataset_version(repository=<repository_key>,
343
- namespace=<namespce>,
344
- dataset_name=<dataset_name>,
345
- version=<version>,
346
- source_path="~/dataset_to_upload/config.json")
347
- ```
348
-
349
- #### Download ML dataset from Artifactory
350
-
351
- The below example shows how to download a dataset from Artifactory:
352
-
353
- ```
354
- from frogml_storage.frog_ml import FrogMLStorage
355
-
356
- arti = FrogMLStorage()
357
-
358
- arti.download_dataset_version(repository=<repository_key>,
359
- namespace=<namespace>,
360
- dataset_name=<dataset_name>,
361
- target_path="~/datasets",
362
- version=<version>)
363
- ```
364
-
365
- ## Testing
366
-
367
- ### Locally run integration tests using artifactory
368
-
369
- Prerequisites:
370
- - A user credentials (username, password)
371
-
372
- To run the integration tests, use the ```poetry run pytest tests/integrations/test_artifactory_integration.py``` command.
373
- In addition, you will need to supply your
374
- ARTIFACTORY_URL in a `http(s)://` format (if not supplied, default will be as defined [here](tests/integrations/conftest.py)), ARTIFACTORY_USERNAME, ARTIFACTORY_PASSWORD.
375
- the test will create a local repository in RT, will upload and download model and datasets using the provided details,
376
- and will delete the repository after the test.
377
-
378
- example:
379
- ```
380
- export ARTIFACTORY_URL=<artifactory_url>
381
- export ARTIFACTORY_USERNAME=<username>
382
- export ARTIFACTORY_PASSWORD=<password>
383
-
384
- poetry run pytest tests/integrations/test_artifactory_integration.py
385
- ```
386
-
387
- ### Locally run tests using existing Artifactory
388
-
389
- To run the tests, use the ```pytest``` command pointing it to an existing Artifactory host.
390
- Prerequisites:
391
- - A generic local repository in the Artifactory instance
392
- - A user token or user credentials (username, password)
393
-
394
- To run the test:
395
-
396
- ```
397
- python3 -m pytest tests/integrations/test_artifactory_integration.py --rt_url "<artifactory_url>" --rt_access_token <token> --repo_name <generic-repo-name> -s
398
- ```
399
-
400
- ## Packaging
401
-
402
- ```
403
- poetry build
404
- ```
405
-
406
- ## Linters
407
- Fix spaces and linebreaks with:
408
- ```
409
- make format
410
- ```
411
- Run linter check:
412
- ```
413
- make format
414
- ```