nucliadb 6.4.0.post4196__py3-none-any.whl → 6.4.0.post4204__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.
@@ -32,6 +32,7 @@ from fastapi_versioning import version
32
32
  from starlette.requests import Request as StarletteRequest
33
33
 
34
34
  from nucliadb.common import datamanagers
35
+ from nucliadb.common.back_pressure import maybe_back_pressure
35
36
  from nucliadb.ingest.orm.utils import set_title
36
37
  from nucliadb.models.internal.processing import PushPayload, Source
37
38
  from nucliadb.models.responses import HTTPClientError
@@ -43,7 +44,6 @@ from nucliadb.writer.api.v1.resource import (
43
44
  validate_rid_exists_or_raise_error,
44
45
  )
45
46
  from nucliadb.writer.api.v1.slug import ensure_slug_uniqueness, noop_context_manager
46
- from nucliadb.writer.back_pressure import maybe_back_pressure
47
47
  from nucliadb.writer.resource.audit import parse_audit
48
48
  from nucliadb.writer.resource.basic import parse_basic_creation, parse_user_classifications
49
49
  from nucliadb.writer.resource.field import (
@@ -215,7 +215,7 @@ async def _tus_post(
215
215
  detail="Cannot hide a resource: the KB does not have hidden resources enabled",
216
216
  )
217
217
 
218
- await maybe_back_pressure(request, kbid, resource_uuid=path_rid)
218
+ await maybe_back_pressure(kbid, resource_uuid=path_rid)
219
219
 
220
220
  dm = get_dm()
221
221
  storage_manager = get_storage_manager()
@@ -713,7 +713,7 @@ async def _upload(
713
713
  if path_rid is not None:
714
714
  await validate_rid_exists_or_raise_error(kbid, path_rid)
715
715
 
716
- await maybe_back_pressure(request, kbid, resource_uuid=path_rid)
716
+ await maybe_back_pressure(kbid, resource_uuid=path_rid)
717
717
 
718
718
  md5_user = x_md5
719
719
  path, rid, valid_field = await validate_field_upload(kbid, path_rid, field, md5_user)
@@ -21,12 +21,12 @@ from contextlib import asynccontextmanager
21
21
 
22
22
  from fastapi import FastAPI
23
23
 
24
+ from nucliadb.common.back_pressure import start_materializer, stop_materializer
25
+ from nucliadb.common.back_pressure.settings import settings as back_pressure_settings
24
26
  from nucliadb.common.context.fastapi import inject_app_context
25
27
  from nucliadb.ingest.processing import start_processing_engine, stop_processing_engine
26
28
  from nucliadb.ingest.utils import start_ingest, stop_ingest
27
29
  from nucliadb.writer import SERVICE_NAME
28
- from nucliadb.writer.back_pressure import start_materializer, stop_materializer
29
- from nucliadb.writer.settings import back_pressure_settings
30
30
  from nucliadb.writer.tus import finalize as storage_finalize
31
31
  from nucliadb.writer.tus import initialize as storage_initialize
32
32
  from nucliadb_telemetry.utils import clean_telemetry, setup_telemetry
@@ -19,7 +19,6 @@
19
19
  #
20
20
  from typing import Optional
21
21
 
22
- from pydantic import Field
23
22
  from pydantic_settings import BaseSettings
24
23
 
25
24
 
@@ -29,54 +28,4 @@ class Settings(BaseSettings):
29
28
  dm_redis_port: Optional[int] = None
30
29
 
31
30
 
32
- class BackPressureSettings(BaseSettings):
33
- enabled: bool = Field(
34
- default=False,
35
- description="Enable or disable back pressure.",
36
- alias="back_pressure_enabled",
37
- )
38
- indexing_rate: float = Field(
39
- default=10,
40
- description="Estimation of the indexing rate in messages per second. This is used to calculate the try again in time", # noqa
41
- )
42
- ingest_rate: float = Field(
43
- default=4,
44
- description="Estimation of the ingest processed consumer rate in messages per second. This is used to calculate the try again in time", # noqa
45
- )
46
- processing_rate: float = Field(
47
- default=1,
48
- description="Estimation of the processing rate in messages per second. This is used to calculate the try again in time", # noqa
49
- )
50
- max_indexing_pending: int = Field(
51
- default=1000,
52
- description="Max number of messages pending to index in a node queue before rate limiting writes. Set to 0 to disable indexing back pressure checks", # noqa
53
- alias="back_pressure_max_indexing_pending",
54
- )
55
- max_ingest_pending: int = Field(
56
- # Disabled by default
57
- default=0,
58
- description="Max number of messages pending to be ingested by processed consumers before rate limiting writes. Set to 0 to disable ingest back pressure checks", # noqa
59
- alias="back_pressure_max_ingest_pending",
60
- )
61
- max_processing_pending: int = Field(
62
- default=1000,
63
- description="Max number of messages pending to process per Knowledge Box before rate limiting writes. Set to 0 to disable processing back pressure checks", # noqa
64
- alias="back_pressure_max_processing_pending",
65
- )
66
- indexing_check_interval: int = Field(
67
- default=30,
68
- description="Interval in seconds to check the indexing pending messages",
69
- )
70
- ingest_check_interval: int = Field(
71
- default=30,
72
- description="Interval in seconds to check the ingest pending messages",
73
- )
74
- max_wait_time: int = Field(
75
- default=60,
76
- description="Max time in seconds to wait before trying again after back pressure",
77
- )
78
-
79
-
80
31
  settings = Settings()
81
-
82
- back_pressure_settings = BackPressureSettings()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb
3
- Version: 6.4.0.post4196
3
+ Version: 6.4.0.post4204
4
4
  Summary: NucliaDB
5
5
  Author-email: Nuclia <nucliadb@nuclia.com>
6
6
  License: AGPL
@@ -20,11 +20,11 @@ Classifier: Programming Language :: Python :: 3.12
20
20
  Classifier: Programming Language :: Python :: 3 :: Only
21
21
  Requires-Python: <4,>=3.9
22
22
  Description-Content-Type: text/markdown
23
- Requires-Dist: nucliadb-telemetry[all]>=6.4.0.post4196
24
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.4.0.post4196
25
- Requires-Dist: nucliadb-protos>=6.4.0.post4196
26
- Requires-Dist: nucliadb-models>=6.4.0.post4196
27
- Requires-Dist: nidx-protos>=6.4.0.post4196
23
+ Requires-Dist: nucliadb-telemetry[all]>=6.4.0.post4204
24
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.4.0.post4204
25
+ Requires-Dist: nucliadb-protos>=6.4.0.post4204
26
+ Requires-Dist: nucliadb-models>=6.4.0.post4204
27
+ Requires-Dist: nidx-protos>=6.4.0.post4204
28
28
  Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
29
29
  Requires-Dist: nuclia-models>=0.24.2
30
30
  Requires-Dist: uvicorn[standard]
@@ -60,6 +60,11 @@ nucliadb/common/ids.py,sha256=4QjoIofes_vtKj2HsFWZf8VVIVWXxdkYtLpx1n618Us,8239
60
60
  nucliadb/common/locking.py,sha256=RL0CabZVPzxHZyUjYeUyLvsJTm7W3J9o4fEgsY_ufNc,5896
61
61
  nucliadb/common/nidx.py,sha256=3EeQGjM_gxK0l_Rb54fspFWVNnzUiKF-_GMxTiiDC8Q,9116
62
62
  nucliadb/common/vector_index_config.py,sha256=LqGwhrDCp1q1vBow3scd1Chhr4GLYjYnGL72FKvOYYc,1552
63
+ nucliadb/common/back_pressure/__init__.py,sha256=paAcAZcfGRTyURF9lnn3vX0vcwakTEVswG_xcdGBH-U,928
64
+ nucliadb/common/back_pressure/cache.py,sha256=ANvXglWzI5naAD6N4E_fNi17qS6KNyAhjLeh6WlZZ84,2931
65
+ nucliadb/common/back_pressure/materializer.py,sha256=YzYfN7xI5nlmSowbdLktWIkrJJb3Q2vEmoyz9O3eb2s,11667
66
+ nucliadb/common/back_pressure/settings.py,sha256=3qNOzbI0KC6LMy-wMilXRSBfZu6CCpGHod26MTgAZ2o,3082
67
+ nucliadb/common/back_pressure/utils.py,sha256=aZeP1XSkdgaRgZC76yR9Kje3511ZUCp7KB-XzcvhMYY,2018
63
68
  nucliadb/common/cluster/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
64
69
  nucliadb/common/cluster/exceptions.py,sha256=t7v_l93t44l2tQpdQXgO_w-c4YZRcaayOz1A2i0w4RQ,1258
65
70
  nucliadb/common/cluster/grpc_node_dummy.py,sha256=JkufazWzMA4KFEU8EBkMbiiDW4C8lLcRhiiCxP7aCQY,2949
@@ -251,7 +256,7 @@ nucliadb/search/search/shards.py,sha256=mc5DK-MoCv9AFhlXlOFHbPvetcyNDzTFOJ5rimK8
251
256
  nucliadb/search/search/summarize.py,sha256=ksmYPubEQvAQgfPdZHfzB_rR19B2ci4IYZ6jLdHxZo8,4996
252
257
  nucliadb/search/search/utils.py,sha256=ajRIXfdTF67dBVahQCXW-rSv6gJpUMPt3QhJrWqArTQ,2175
253
258
  nucliadb/search/search/chat/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
254
- nucliadb/search/search/chat/ask.py,sha256=xNdkdH2NzqfONj_qkdGGFvdGlz94PiyxE2ayMVk-MdQ,37471
259
+ nucliadb/search/search/chat/ask.py,sha256=KO1YD1nGwblT4h2CfV7ccCpLP0OuoBCJQHBB5bDQatg,37476
255
260
  nucliadb/search/search/chat/exceptions.py,sha256=Siy4GXW2L7oPhIR86H3WHBhE9lkV4A4YaAszuGGUf54,1356
256
261
  nucliadb/search/search/chat/images.py,sha256=PA8VWxT5_HUGfW1ULhKTK46UBsVyINtWWqEM1ulzX1E,3095
257
262
  nucliadb/search/search/chat/prompt.py,sha256=Jnja-Ss7skgnnDY8BymVfdeYsFPnIQFL8tEvcRXTKUE,47356
@@ -328,28 +333,27 @@ nucliadb/train/generators/token_classifier.py,sha256=DdyMbrpxIVGWdTcz3SEN_3HwxKf
328
333
  nucliadb/train/generators/utils.py,sha256=ZNwvEVPZr-eP0MW3ABN7a11hPQKaa0NdVaRcgBcTp5w,3601
329
334
  nucliadb/writer/__init__.py,sha256=S298mrZL3vr62OrBqi97mdLxgR5cReMlRJgnaQHZV7s,1304
330
335
  nucliadb/writer/app.py,sha256=ABBO8-u4pDAa61b3mCdD0TFhuHAYcxMkgpZSGgWARuE,2736
331
- nucliadb/writer/back_pressure.py,sha256=4OwFGq9pvAbChB3WBZAY36lclfD-gD2ouC6YsKA4bIo,16892
332
336
  nucliadb/writer/exceptions.py,sha256=-Z7LW--eid7PNeKFuzo9kAlbLEBMUosxE-UVIgGD3SA,929
333
- nucliadb/writer/lifecycle.py,sha256=OYyhUZ1ejlybPzO-O_EsInjdifKiPiEzooy2d_2DW3k,2550
337
+ nucliadb/writer/lifecycle.py,sha256=P1b_KoNkMTeF1IbyDCh_zhexWbeYe5LH6p2iFSJPiN4,2576
334
338
  nucliadb/writer/openapi.py,sha256=thqCO1ht_RJgOkXs-aIsv8aXJrU5z8wo2n05l2_LqMs,1032
335
339
  nucliadb/writer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
336
340
  nucliadb/writer/run.py,sha256=euVZ_rtHDXs-O1kB-Pt1Id8eft9CYVpWH3zJzEoEqls,1448
337
- nucliadb/writer/settings.py,sha256=pA9aMAvY8H6zvsxAOdGY8SZLrThDvJ8KLhluGI0GxnQ,3288
341
+ nucliadb/writer/settings.py,sha256=gKtCTDF2E1m6lYL0Iv4WwY4VZuvw1Dsa-uIBZxCHTdU,1071
338
342
  nucliadb/writer/utilities.py,sha256=AZ5qEny1Xm0IDsFtH13oJa2usvJZK8f0FdgF1LrnLCw,1036
339
343
  nucliadb/writer/api/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
340
344
  nucliadb/writer/api/constants.py,sha256=qWEDjFUycrEZnSJyLnNK4PQNodU2oVmkO4NycaEZtio,1738
341
345
  nucliadb/writer/api/utils.py,sha256=wIQHlU8RQiIGVLI72suvyVIKlCU44Unh0Ae0IiN6Qwo,1313
342
346
  nucliadb/writer/api/v1/__init__.py,sha256=akI9A_jloNLb0dU4T5zjfdyvmSAiDeIdjAlzNx74FlU,1128
343
- nucliadb/writer/api/v1/export_import.py,sha256=elf-EQY5DD3mhw8kWb9tQpDcbrF9sY6VFYqxQOjuVP0,8201
344
- nucliadb/writer/api/v1/field.py,sha256=KOOBqBJzwsNczn_isxl-YFBL-bmduz3rzSDWMbAJefc,18523
347
+ nucliadb/writer/api/v1/export_import.py,sha256=v0sU55TtRSqDzwkDgcwv2uSaqKCuQTtGcMpYoHQYBQA,8192
348
+ nucliadb/writer/api/v1/field.py,sha256=OicvLF1bnkJj1ixALFLuhvFX6NCMFpORROcFcS9nKpk,18505
345
349
  nucliadb/writer/api/v1/knowledgebox.py,sha256=PHEYDFa-sN5JrI8-EiVVg5FDOsRuCLT43kyAB4xt-xA,9530
346
350
  nucliadb/writer/api/v1/learning_config.py,sha256=CKBjqcbewkfPwGUPLDWzZSpro6XkmCaVppe5Qtpu5Go,3117
347
- nucliadb/writer/api/v1/resource.py,sha256=jxphiyeXJq342BR1R8pRQ81L0i3Tczf_Yarqx_DqvWs,19786
351
+ nucliadb/writer/api/v1/resource.py,sha256=IaKHwP4M4Pm3xXj_xcnQCnTzKtXj_xj-r7YOHdH-89I,19750
348
352
  nucliadb/writer/api/v1/router.py,sha256=RjuoWLpZer6Kl2BW_wznpNo6XL3BOpdTGqXZCn3QrrQ,1034
349
353
  nucliadb/writer/api/v1/services.py,sha256=3AUjk-SmvqJx76v7y89DZx6oyasojPliGYeniRQjpcU,13337
350
354
  nucliadb/writer/api/v1/slug.py,sha256=xlVBDBpRi9bNulpBHZwhyftVvulfE0zFm1XZIWl-AKY,2389
351
355
  nucliadb/writer/api/v1/transaction.py,sha256=d2Vbgnkk_-FLGSTt3vfldwiJIUf0XoyD0wP1jQNz_DY,2430
352
- nucliadb/writer/api/v1/upload.py,sha256=fwWXA5BuLPuGKhOcuyf0CdutWJITjJ6fAvDzV_X9VsU,33809
356
+ nucliadb/writer/api/v1/upload.py,sha256=vdKurdxRU7vYlcQIXf5RNTuX-G0waBSak2HnNRmAbLk,33791
353
357
  nucliadb/writer/api/v1/vectorsets.py,sha256=F3iMViL5G95_Tns4aO2SOA0DwAzxK2_P8MXxtd_XLRE,6973
354
358
  nucliadb/writer/resource/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
355
359
  nucliadb/writer/resource/audit.py,sha256=FvxMZPzrNHtd31HgpZEvxzwAkbxJTZRhPLqRYYJi3tA,1426
@@ -365,8 +369,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
365
369
  nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
366
370
  nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
367
371
  nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
368
- nucliadb-6.4.0.post4196.dist-info/METADATA,sha256=jtJRm9idqV9MmQAmslJDXhOsEzTsiLBHKsdTvCJ6pqM,4223
369
- nucliadb-6.4.0.post4196.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
370
- nucliadb-6.4.0.post4196.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
371
- nucliadb-6.4.0.post4196.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
372
- nucliadb-6.4.0.post4196.dist-info/RECORD,,
372
+ nucliadb-6.4.0.post4204.dist-info/METADATA,sha256=fAIY46KkkEIlOfObcPGceV3ZnO74SMottRW6kUPOFnU,4223
373
+ nucliadb-6.4.0.post4204.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
374
+ nucliadb-6.4.0.post4204.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
375
+ nucliadb-6.4.0.post4204.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
376
+ nucliadb-6.4.0.post4204.dist-info/RECORD,,