qwak-core 0.4.266__py3-none-any.whl → 0.4.267__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.
Files changed (52) hide show
  1. qwak/__init__.py +1 -1
  2. qwak/clients/instance_template/client.py +4 -6
  3. qwak/clients/prompt_manager/model_descriptor_mapper.py +19 -21
  4. qwak/feature_store/_common/artifact_utils.py +3 -3
  5. qwak/feature_store/data_sources/base.py +4 -4
  6. qwak/feature_store/data_sources/batch/athena.py +3 -3
  7. qwak/feature_store/feature_sets/streaming.py +3 -3
  8. qwak/feature_store/feature_sets/streaming_backfill.py +1 -1
  9. qwak/feature_store/online/client.py +6 -6
  10. qwak/feature_store/sinks/streaming/factory.py +1 -1
  11. qwak/inner/build_logic/phases/phase_010_fetch_model/fetch_strategy_manager/strategy/git/git_strategy.py +3 -3
  12. qwak/llmops/provider/openai/provider.py +3 -3
  13. qwak/model/tools/adapters/output.py +1 -1
  14. qwak/model/utils/feature_utils.py +8 -12
  15. qwak/model_loggers/artifact_logger.py +7 -7
  16. qwak/tools/logger/logger.py +1 -1
  17. qwak_core-0.4.267.dist-info/METADATA +53 -0
  18. {qwak_core-0.4.266.dist-info → qwak_core-0.4.267.dist-info}/RECORD +19 -51
  19. frogml_storage/__init__.py +0 -0
  20. frogml_storage/_artifactory_api.py +0 -315
  21. frogml_storage/_environment.py +0 -22
  22. frogml_storage/_log_config.py +0 -45
  23. frogml_storage/_storage_utils.py +0 -15
  24. frogml_storage/_utils.py +0 -69
  25. frogml_storage/authentication/_authentication_utils.py +0 -259
  26. frogml_storage/authentication/models/_auth_config.py +0 -70
  27. frogml_storage/cli/_frogml_cli.py +0 -40
  28. frogml_storage/cli/_login_cli.py +0 -240
  29. frogml_storage/cli/commands/_login_command.py +0 -74
  30. frogml_storage/cli/models/_cli_login_arguments.py +0 -22
  31. frogml_storage/cli/utils/_cli_utils.py +0 -19
  32. frogml_storage/cli/utils/_login_checks_utility.py +0 -114
  33. frogml_storage/constants.py +0 -56
  34. frogml_storage/dataset_manifest.py +0 -13
  35. frogml_storage/entity_manifest.py +0 -93
  36. frogml_storage/exceptions/checksum_verification_error.py +0 -3
  37. frogml_storage/exceptions/validation_error.py +0 -4
  38. frogml_storage/frog_ml.py +0 -668
  39. frogml_storage/frogml_entity_type_info.py +0 -46
  40. frogml_storage/http/__init__.py +0 -0
  41. frogml_storage/http/http_client.py +0 -83
  42. frogml_storage/model_manifest.py +0 -60
  43. frogml_storage/models/_download_context.py +0 -54
  44. frogml_storage/models/frogml_dataset_version.py +0 -21
  45. frogml_storage/models/frogml_entity_version.py +0 -34
  46. frogml_storage/models/frogml_model_version.py +0 -21
  47. frogml_storage/serialization_metadata.py +0 -15
  48. frogml_storage/storage.py +0 -140
  49. frogml_storage/utils/_input_checks_utility.py +0 -104
  50. qwak_core-0.4.266.dist-info/METADATA +0 -419
  51. qwak_core-0.4.266.dist-info/entry_points.txt +0 -3
  52. {qwak_core-0.4.266.dist-info → qwak_core-0.4.267.dist-info}/WHEEL +0 -0
@@ -1,419 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: qwak-core
3
- Version: 0.4.266
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
- Provides-Extra: local-core-dependencies
22
- Requires-Dist: PyYAML
23
- Requires-Dist: cachetools
24
- Requires-Dist: chevron (==0.14.0)
25
- Requires-Dist: cloudpickle (==2.2.1) ; extra == "feature-store"
26
- Requires-Dist: dacite (==1.8.1)
27
- Requires-Dist: dependency-injector (>=4.0)
28
- Requires-Dist: filelock
29
- Requires-Dist: grpcio (>=1.57.0)
30
- Requires-Dist: grpcio-tools (>=1.47.0) ; (python_full_version >= "3.7.1" and python_version < "3.10") and (extra == "local-core-dependencies")
31
- Requires-Dist: grpcio-tools (>=1.56.2) ; (python_version >= "3.10") and (extra == "local-core-dependencies")
32
- Requires-Dist: joblib (>=1.3.2,<2.0.0)
33
- Requires-Dist: marshmallow-dataclass (>=8.5.8,<9.0.0)
34
- Requires-Dist: mypy-protobuf (>=3.0.0,<4.0.0) ; extra == "local-core-dependencies"
35
- Requires-Dist: protobuf (>=3.10,<4) ; python_full_version >= "3.7.1" and python_version < "3.10"
36
- Requires-Dist: protobuf (>=4.21.6) ; python_version >= "3.10"
37
- Requires-Dist: pyarrow (>=6.0.0) ; extra == "feature-store"
38
- Requires-Dist: pyathena (>=2.2.0,!=2.18.0) ; extra == "feature-store"
39
- Requires-Dist: pydantic
40
- Requires-Dist: pyspark (==3.4.2) ; extra == "feature-store"
41
- Requires-Dist: python-jose[cryptography] (>=3.4.0)
42
- Requires-Dist: python-json-logger (>=2.0.2)
43
- Requires-Dist: requests
44
- Requires-Dist: retrying (==1.3.4)
45
- Requires-Dist: tqdm
46
- Requires-Dist: typeguard (>=2,<3)
47
- Requires-Dist: typer
48
- Project-URL: Home page, https://www.qwak.com/
49
- Description-Content-Type: text/markdown
50
-
51
- # Qwak Core
52
-
53
- 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.
54
- Qwak Core contains all the objects and tools necessary to use the Qwak Platform
55
-
56
- # Frog ML Storage
57
-
58
- ## Table of contents:
59
-
60
- - [Overview](#overview)
61
- - [Working with Artifactory](#Working-with-Artifactory)
62
- - [Login by adding authentication details to your python code](#Login-by-adding-authentication-details-to-your-python-code)
63
- - [Login via environment variables](#Login-via-environment-variables)
64
- - [Login via cli](#Login-via-cli)
65
- - [Login by a single command line with options](#Login-by-a-single-command-line-with-options)
66
- - [Login by interactive flow in Cli](#Login-by-interactive-flow-in-Cli)
67
- - [Upload ML model to Artifactory](#Upload-ML-model-to-Artifactory)
68
- - [Download ML model from Artifactory](#Download-ML-model-from-Artifactory)
69
- - [Upload ML dataset to Artifactory](#Upload-ML-dataset-to-Artifactory)
70
- - [Download ML dataset from Artifactory](#Download-ML-dataset-from-Artifactory)
71
- - [Testing](#Testing)
72
- - [Locally run integration tests using local artifactory](#Locally-run-integration-tests-using-artifactory)
73
- - [Locally run tests using existing Artifactory](#Locally-run-tests-using-existing-Artifactory)
74
- - [Packaging](#Packaging)
75
- - [Linters](#Linters)
76
-
77
- ## Overview
78
-
79
- 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.
80
-
81
- ## Working with Artifactory
82
-
83
- FrogML Storage Library support is available from Artifactory version 7.84.x.
84
-
85
- To be able to use FrogML Storage with Artifactory, you should authenticate the frogml storage client against Artifactory.
86
- 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.
87
-
88
- The credentials retrieval order is as follows:
89
-
90
- 1. [Login by adding authentication details to your python code](#Login-by-adding-authentication-details-to-your-python-code)
91
- 2. [Login via environment variables](#Login-via-environment-variables)
92
- 3. [Login via cli](#login-via-cli)
93
-
94
-
95
- #### Login by adding authentication details to your python code
96
-
97
- ---
98
- **NOTE**
99
-
100
- It is strongly discouraged to use credentials in clear text. Use this method for testing purposes only.
101
-
102
- ---
103
-
104
- 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):
105
- - Username and Password
106
- - Access Token
107
-
108
- 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.
109
-
110
- Authentication by username and password:
111
-
112
- ```
113
- from frogml_storage.frog_ml import FrogMLStorage
114
- from frogml_storage.authentication.models._auth_config import AuthConfig
115
-
116
- arti = FrogMLStorage(AuthConfig.by_basic_auth("http://myorg.jfrog.io", <username>, <password>))
117
- ```
118
-
119
- Authentication by access token:
120
-
121
- ```
122
- from frogml_storage.frog_ml import FrogMLStorage
123
- from frogml_storage.authentication.models._auth_config import AuthConfig
124
-
125
- arti = FrogMLStorage(AuthConfig.by_access_token("http://myorg.jfrog.io", <token>))
126
- ```
127
-
128
- #### Login via environment variables
129
-
130
- You can also authenticate the frogml client using the following environment variables:
131
-
132
- - JF_URL - your JFrog platform domain, for example 'http://myorg.jfrog.io'
133
- - 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".
134
-
135
- After setting the environment variables, you can log in to the frogml client without specifying credentials.
136
-
137
-
138
- ```
139
- from frogml_storage.frog_ml import FrogMLStorage
140
- from frogml_storage.authentication.models._auth_config import AuthConfig
141
-
142
- arti = FrogMLStorage()
143
- ```
144
-
145
-
146
- ### Login via cli
147
-
148
- It is possible to authenticate the frogml client using any of the following methods:
149
-
150
- 1. Login by a single CLI command
151
- 2. Interactive flow
152
-
153
- After each login attempt, the authentication result (success or failure) is printed on the screen.
154
- 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.
155
-
156
- In both interactive flow and the single command flow, it is possible to authenticate the frogml client by:
157
-
158
- 1. Username and password
159
- 2. Access token
160
- 3. Anonymous authentication
161
-
162
-
163
-
164
- #### Login by a single command line with options
165
-
166
- The below examples show the frogml login options using the cli:
167
-
168
- Login using existing jfrog-cli of frogml configuration files (~/.jfrog/jfrog-cli.conf.v6 or ~/.frogml/config.json, respectively):
169
-
170
- ```
171
- frogml login
172
- ```
173
- If no configuration file is found, interactive mode will be triggered.
174
-
175
- Login by username and password:
176
-
177
- ```
178
- frogml login --url <artifactory_url> --username <username> --password <password>
179
- ```
180
-
181
- Where:
182
- - artifactory_url is your JFrog platform domain, for example 'http://myorg.jfrog.io'
183
- - username and password are your artifactory credentials for this domain
184
-
185
- Login by access token:
186
-
187
- ```
188
- frogml login --url <artifactory_url> --token <access_token>
189
- ```
190
-
191
- Where:
192
- - artifactory_url is your JFrog platform domain, for example 'http://myorg.jfrog.io'
193
- - token - your artifactory token for this domain. To generate a token, log in to your artifactory and navigate to Administration -> User Management -> Access Tokens.
194
-
195
- Login by anonymous access:
196
-
197
- ```
198
- frogml login --url <artifactory_url> --anonymous
199
- ```
200
-
201
- #### Login by interactive flow in cli:
202
-
203
- To start an interactive flow in the cli, run the command:
204
-
205
- ```
206
- frogml login --interactive
207
- ```
208
-
209
- After executing the command above, the cli prompts two options as follows:
210
-
211
- ```
212
- frogml login --interactive
213
- Please select from the following options:
214
- 1.Login by jfrog-cli configuration file: ~/.jfrog/jfrog-cli.conf.v6
215
- 2.Connecting to a new server
216
- ```
217
-
218
- On choosing the first option, the cli attempts to retrieve your authentication credentials from your JFrog CLI configuration file and sends them to Artifactory.
219
-
220
- 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.
221
-
222
- ```
223
- Enter artifactory base url: http://myorg.jfrog.io
224
- Choose your preferred authentication option:
225
- 0: Username and Password
226
- 1: Access Token
227
- 2: Anonymous Access
228
- ```
229
-
230
-
231
- ### Upload ML model to Artifactory
232
-
233
- You can upload a model to a FrogML repository using the upload_model_version() function.
234
- You can upload a single file or an entire folder.
235
- 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.
236
- After uploading the model, FrogML generates a file named model-info.json which contains the model name and its related files and dependencies.
237
-
238
- 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.
239
- Additionally, you can add properties to the model in Artifactory to categorize and label it.
240
- The function upload_model_version returns an instance of FrogMlModelVersion, which includes the model's name, version, and namespace.
241
-
242
- The below examples show how to upload a model to Artifactory:
243
-
244
- ---
245
- **NOTE**
246
-
247
- namespace, version, properties, dependencies_files_paths and code_archive_file_path are optional.
248
- model_path can point to a single file or a directory, in which case the whole directory is uploaded.
249
- model_type can be written as JSON or as SerializationMetadata object imported from jfrog_ml.serialization_metadata.
250
- All of SerializationMetadata fields must be populated.
251
-
252
- ---
253
-
254
-
255
- Upload an entire folder as model:
256
-
257
- ```
258
- from frogml_storage.frog_ml import FrogMLStorage
259
-
260
- arti = FrogMLStorage()
261
- arti.upload_model_version(repository=<repository_key>,
262
- namespace=<namespce>,
263
- model_name=<model_name>,
264
- model_path="~/model_to_upload/",
265
- model_type={"framework": "tensorflow", "framework_version": "2.3.0", "serialization_format": "H5", "runtime": "python", "runtime_version": "3.7"},
266
- properties={"model_type": "keras", "experiment": "my-exp"},
267
- dependencies_files_paths=["path/to/req/file1", "path/to/req/file2"],
268
- code_archive_file_path="path/to/code/archieve/file"
269
- )
270
- ```
271
-
272
- Upload a model with a specified version, and no dependencies and code archive:
273
-
274
- ```
275
- from frogml_storage.frog_ml import FrogMLStorage
276
-
277
- arti = FrogMLStorage()
278
- arti.upload_model_version(repository=<repository_key>,
279
- namespace=<namespce>,
280
- model_name=<model_name>,
281
- version=<version>,
282
- model_path="~/model_to_upload/",
283
- model_type={"framework": "tensorflow", "framework_version": "2.3.0", "serialization_format": "H5", "runtime": "python", "runtime_version": "3.7"}
284
- )
285
- ```
286
-
287
- ---
288
-
289
- #### Download ML model from Artifactory
290
-
291
- The below example shows how to download a model from Artifactory:
292
-
293
- ```
294
- from frogml_storage.frog_ml import FrogMLStorage
295
-
296
- arti = FrogMLStorage()
297
-
298
- arti.download_model_version(repository=<repository_key>,
299
- namespace=<namespace>,
300
- model_name=<model_name>,
301
- target_path="~/models",
302
- version=<version>)
303
- ```
304
-
305
- ---
306
- **NOTE**
307
-
308
- The dependencies and code archive cannot be downloaded.
309
-
310
- ---
311
-
312
- ### Upload ML dataset to Artifactory
313
-
314
- Upload an entire folder as dataset:
315
-
316
-
317
- ```
318
- from frogml_storage.frog_ml import FrogMLStorage
319
-
320
- arti = FrogMLStorage()
321
- arti.upload_dataset_version(repository=<repository_key>,
322
- namespace=<namespce>,
323
- dataset_name=<dataset_name>,
324
- source_path="~/dataset_to_upload/",
325
- properties={"dataset_type": "kerras", "experiment": "my-exp"})
326
- ```
327
-
328
- Upload a dataset with specified version:
329
-
330
- ```
331
- from frogml_storage.frog_ml import FrogMLStorage
332
-
333
- arti = FrogMLStorage()
334
- arti.upload_dataset_version(repository=<repository_key>,
335
- namespace=<namespce>,
336
- dataset_name=<dataset_name>,
337
- version=<version>,
338
- source_path="~/dataset_to_upload/")
339
- ```
340
-
341
- Upload a single file as a dataset:
342
-
343
- ```
344
- from frogml_storage.frog_ml import FrogMLStorage
345
-
346
- arti = FrogMLStorage()
347
- arti.upload_dataset_version(repository=<repository_key>,
348
- namespace=<namespce>,
349
- dataset_name=<dataset_name>,
350
- version=<version>,
351
- source_path="~/dataset_to_upload/config.json")
352
- ```
353
-
354
- #### Download ML dataset from Artifactory
355
-
356
- The below example shows how to download a dataset from Artifactory:
357
-
358
- ```
359
- from frogml_storage.frog_ml import FrogMLStorage
360
-
361
- arti = FrogMLStorage()
362
-
363
- arti.download_dataset_version(repository=<repository_key>,
364
- namespace=<namespace>,
365
- dataset_name=<dataset_name>,
366
- target_path="~/datasets",
367
- version=<version>)
368
- ```
369
-
370
- ## Testing
371
-
372
- ### Locally run integration tests using artifactory
373
-
374
- Prerequisites:
375
- - A user credentials (username, password)
376
-
377
- To run the integration tests, use the ```poetry run pytest tests/integrations/test_artifactory_integration.py``` command.
378
- In addition, you will need to supply your
379
- ARTIFACTORY_URL in a `http(s)://` format (if not supplied, default will be as defined [here](tests/integrations/conftest.py)), ARTIFACTORY_USERNAME, ARTIFACTORY_PASSWORD.
380
- the test will create a local repository in RT, will upload and download model and datasets using the provided details,
381
- and will delete the repository after the test.
382
-
383
- example:
384
- ```
385
- export ARTIFACTORY_URL=<artifactory_url>
386
- export ARTIFACTORY_USERNAME=<username>
387
- export ARTIFACTORY_PASSWORD=<password>
388
-
389
- poetry run pytest tests/integrations/test_artifactory_integration.py
390
- ```
391
-
392
- ### Locally run tests using existing Artifactory
393
-
394
- To run the tests, use the ```pytest``` command pointing it to an existing Artifactory host.
395
- Prerequisites:
396
- - A generic local repository in the Artifactory instance
397
- - A user token or user credentials (username, password)
398
-
399
- To run the test:
400
-
401
- ```
402
- python3 -m pytest tests/integrations/test_artifactory_integration.py --rt_url "<artifactory_url>" --rt_access_token <token> --repo_name <generic-repo-name> -s
403
- ```
404
-
405
- ## Packaging
406
-
407
- ```
408
- poetry build
409
- ```
410
-
411
- ## Linters
412
- Fix spaces and linebreaks with:
413
- ```
414
- make format
415
- ```
416
- Run linter check:
417
- ```
418
- make format
419
- ```
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- frogml=frogml_storage.cli._frogml_cli:main
3
-