nucliadb 6.9.1.post5182__py3-none-any.whl → 6.9.1.post5192__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.
- nucliadb/common/cluster/manager.py +3 -19
- nucliadb/common/cluster/rebalance.py +5 -2
- nucliadb/common/cluster/rollover.py +11 -0
- nucliadb/common/datamanagers/atomic.py +5 -0
- nucliadb/ingest/consumer/service.py +1 -2
- nucliadb/ingest/consumer/shard_creator.py +16 -5
- nucliadb/ingest/orm/knowledgebox.py +78 -29
- nucliadb/ingest/orm/processor/processor.py +5 -1
- nucliadb/ingest/service/writer.py +12 -5
- nucliadb/migrator/datamanager.py +1 -7
- nucliadb/writer/api/v1/knowledgebox.py +15 -22
- {nucliadb-6.9.1.post5182.dist-info → nucliadb-6.9.1.post5192.dist-info}/METADATA +6 -6
- {nucliadb-6.9.1.post5182.dist-info → nucliadb-6.9.1.post5192.dist-info}/RECORD +16 -16
- {nucliadb-6.9.1.post5182.dist-info → nucliadb-6.9.1.post5192.dist-info}/WHEEL +0 -0
- {nucliadb-6.9.1.post5182.dist-info → nucliadb-6.9.1.post5192.dist-info}/entry_points.txt +0 -0
- {nucliadb-6.9.1.post5182.dist-info → nucliadb-6.9.1.post5192.dist-info}/top_level.txt +0 -0
|
@@ -43,8 +43,6 @@ from nucliadb_protos import knowledgebox_pb2, writer_pb2
|
|
|
43
43
|
from nucliadb_telemetry import errors
|
|
44
44
|
from nucliadb_utils.utilities import get_storage
|
|
45
45
|
|
|
46
|
-
from .settings import settings
|
|
47
|
-
|
|
48
46
|
logger = logging.getLogger(__name__)
|
|
49
47
|
|
|
50
48
|
|
|
@@ -113,6 +111,8 @@ class KBShardManager:
|
|
|
113
111
|
self,
|
|
114
112
|
txn: Transaction,
|
|
115
113
|
kbid: str,
|
|
114
|
+
*,
|
|
115
|
+
prewarm_enabled: bool,
|
|
116
116
|
) -> writer_pb2.ShardObject:
|
|
117
117
|
kb_shards = await datamanagers.cluster.get_kb_shards(txn, kbid=kbid, for_update=True)
|
|
118
118
|
if kb_shards is None:
|
|
@@ -133,6 +133,7 @@ class KBShardManager:
|
|
|
133
133
|
req = NewShardRequest(
|
|
134
134
|
kbid=kbid,
|
|
135
135
|
vectorsets_configs=vectorsets,
|
|
136
|
+
prewarm_enabled=prewarm_enabled,
|
|
136
137
|
)
|
|
137
138
|
|
|
138
139
|
resp = await nidx_api.NewShard(req) # type: ignore
|
|
@@ -232,23 +233,6 @@ class KBShardManager:
|
|
|
232
233
|
indexpb.shard = shard.nidx_shard_id
|
|
233
234
|
await nidx.index(indexpb)
|
|
234
235
|
|
|
235
|
-
def should_create_new_shard(self, num_paragraphs: int) -> bool:
|
|
236
|
-
return num_paragraphs > settings.max_shard_paragraphs
|
|
237
|
-
|
|
238
|
-
async def maybe_create_new_shard(
|
|
239
|
-
self,
|
|
240
|
-
kbid: str,
|
|
241
|
-
num_paragraphs: int,
|
|
242
|
-
):
|
|
243
|
-
if not self.should_create_new_shard(num_paragraphs):
|
|
244
|
-
return
|
|
245
|
-
|
|
246
|
-
logger.info({"message": "Adding shard", "kbid": kbid})
|
|
247
|
-
|
|
248
|
-
async with datamanagers.with_transaction() as txn:
|
|
249
|
-
await self.create_shard_by_kbid(txn, kbid)
|
|
250
|
-
await txn.commit()
|
|
251
|
-
|
|
252
236
|
async def create_vectorset(self, kbid: str, config: knowledgebox_pb2.VectorSetConfig):
|
|
253
237
|
"""Create a new vectorset in all KB shards."""
|
|
254
238
|
|
|
@@ -75,9 +75,12 @@ async def maybe_add_shard(kbid: str) -> None:
|
|
|
75
75
|
settings.max_shard_paragraphs * 0.9 # 90% of the max
|
|
76
76
|
):
|
|
77
77
|
# create new shard
|
|
78
|
-
async with datamanagers.
|
|
78
|
+
async with datamanagers.with_rw_transaction() as txn:
|
|
79
|
+
kb_config = await datamanagers.kb.get_config(txn, kbid=kbid)
|
|
80
|
+
prewarm = kb_config is not None and kb_config.prewarm_enabled
|
|
81
|
+
|
|
79
82
|
sm = get_shard_manager()
|
|
80
|
-
await sm.create_shard_by_kbid(txn, kbid)
|
|
83
|
+
await sm.create_shard_by_kbid(txn, kbid, prewarm_enabled=prewarm)
|
|
81
84
|
await txn.commit()
|
|
82
85
|
|
|
83
86
|
|
|
@@ -34,8 +34,10 @@ from nucliadb.common.external_index_providers.base import ExternalIndexManager
|
|
|
34
34
|
from nucliadb.common.external_index_providers.manager import (
|
|
35
35
|
get_external_index_manager,
|
|
36
36
|
)
|
|
37
|
+
from nucliadb.common.maindb.utils import get_driver
|
|
37
38
|
from nucliadb.common.nidx import get_nidx_api_client
|
|
38
39
|
from nucliadb.common.vector_index_config import nucliadb_index_config_to_nidx
|
|
40
|
+
from nucliadb.ingest.orm.knowledgebox import KnowledgeBox
|
|
39
41
|
from nucliadb.migrator.settings import settings
|
|
40
42
|
from nucliadb_protos import utils_pb2, writer_pb2
|
|
41
43
|
from nucliadb_telemetry import errors
|
|
@@ -415,6 +417,15 @@ async def cutover_shards(app_context: ApplicationContext, kbid: str) -> None:
|
|
|
415
417
|
|
|
416
418
|
await txn.commit()
|
|
417
419
|
|
|
420
|
+
# For KBs with pre-warm enabled, we must configure the new shards. There may
|
|
421
|
+
# be some small delay between this call and the shards being actually
|
|
422
|
+
# prewarmed, but rollovers are quite unusual and we prefer this rather than
|
|
423
|
+
# prewarming old and new shards at the same time
|
|
424
|
+
kb_config = await datamanagers.atomic.kb.get_config(kbid=kbid)
|
|
425
|
+
if kb_config is not None and kb_config.prewarm_enabled:
|
|
426
|
+
driver = get_driver()
|
|
427
|
+
await KnowledgeBox.configure_shards(driver, kbid, prewarm=True)
|
|
428
|
+
|
|
418
429
|
|
|
419
430
|
async def validate_indexed_data(
|
|
420
431
|
app_context: ApplicationContext, kbid: str, external: Optional[ExternalIndexManager] = None
|
|
@@ -42,6 +42,7 @@ from typing_extensions import Concatenate, ParamSpec
|
|
|
42
42
|
|
|
43
43
|
from nucliadb.common.maindb.driver import Transaction
|
|
44
44
|
|
|
45
|
+
from . import cluster as cluster_dm
|
|
45
46
|
from . import kb as kb_dm
|
|
46
47
|
from . import labels as labels_dm
|
|
47
48
|
from . import resources as resources_dm
|
|
@@ -73,6 +74,10 @@ def rw_txn_wrap(fun: Callable[Concatenate[Transaction, P], Awaitable[T]]) -> Cal
|
|
|
73
74
|
return wrapper
|
|
74
75
|
|
|
75
76
|
|
|
77
|
+
class cluster:
|
|
78
|
+
get_kb_shards = ro_txn_wrap(cluster_dm.get_kb_shards)
|
|
79
|
+
|
|
80
|
+
|
|
76
81
|
class kb:
|
|
77
82
|
exists_kb = ro_txn_wrap(kb_dm.exists_kb)
|
|
78
83
|
get_config = ro_txn_wrap(kb_dm.get_config)
|
|
@@ -140,9 +140,8 @@ async def start_shard_creator() -> Callable[[], Awaitable[None]]:
|
|
|
140
140
|
driver = await setup_driver()
|
|
141
141
|
pubsub = await get_pubsub()
|
|
142
142
|
assert pubsub is not None, "Pubsub is not configured"
|
|
143
|
-
storage = await get_storage(service_name=SERVICE_NAME)
|
|
144
143
|
|
|
145
|
-
shard_creator = ShardCreatorHandler(driver=driver,
|
|
144
|
+
shard_creator = ShardCreatorHandler(driver=driver, pubsub=pubsub)
|
|
146
145
|
await shard_creator.initialize()
|
|
147
146
|
|
|
148
147
|
return shard_creator.finalize
|
|
@@ -25,14 +25,14 @@ from typing import Any
|
|
|
25
25
|
|
|
26
26
|
from nidx_protos import nodereader_pb2, noderesources_pb2
|
|
27
27
|
|
|
28
|
-
from nucliadb.common import locking
|
|
28
|
+
from nucliadb.common import datamanagers, locking
|
|
29
|
+
from nucliadb.common.cluster.settings import settings
|
|
29
30
|
from nucliadb.common.cluster.utils import get_shard_manager
|
|
30
31
|
from nucliadb.common.maindb.driver import Driver
|
|
31
32
|
from nucliadb.common.nidx import get_nidx_api_client
|
|
32
33
|
from nucliadb_protos import writer_pb2
|
|
33
34
|
from nucliadb_utils import const
|
|
34
35
|
from nucliadb_utils.cache.pubsub import PubSubDriver
|
|
35
|
-
from nucliadb_utils.storages.storage import Storage
|
|
36
36
|
|
|
37
37
|
from . import metrics
|
|
38
38
|
from .utils import DelayedTaskHandler
|
|
@@ -52,12 +52,10 @@ class ShardCreatorHandler:
|
|
|
52
52
|
self,
|
|
53
53
|
*,
|
|
54
54
|
driver: Driver,
|
|
55
|
-
storage: Storage,
|
|
56
55
|
pubsub: PubSubDriver,
|
|
57
56
|
check_delay: float = 10.0,
|
|
58
57
|
):
|
|
59
58
|
self.driver = driver
|
|
60
|
-
self.storage = storage
|
|
61
59
|
self.pubsub = pubsub
|
|
62
60
|
self.shard_manager = get_shard_manager()
|
|
63
61
|
self.task_handler = DelayedTaskHandler(check_delay)
|
|
@@ -111,4 +109,17 @@ class ShardCreatorHandler:
|
|
|
111
109
|
shard_id=noderesources_pb2.ShardId(id=current_shard.nidx_shard_id)
|
|
112
110
|
) # type: ignore
|
|
113
111
|
)
|
|
114
|
-
|
|
112
|
+
|
|
113
|
+
if not should_create_new_shard(shard.paragraphs):
|
|
114
|
+
return
|
|
115
|
+
|
|
116
|
+
logger.info({"message": "Adding shard", "kbid": kbid})
|
|
117
|
+
async with datamanagers.with_rw_transaction() as txn:
|
|
118
|
+
kb_config = await datamanagers.kb.get_config(txn, kbid=kbid)
|
|
119
|
+
prewarm = kb_config is not None and kb_config.prewarm_enabled
|
|
120
|
+
await self.shard_manager.create_shard_by_kbid(txn, kbid, prewarm_enabled=prewarm)
|
|
121
|
+
await txn.commit()
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def should_create_new_shard(num_paragraphs: int) -> bool:
|
|
125
|
+
return num_paragraphs > settings.max_shard_paragraphs
|
|
@@ -24,7 +24,7 @@ from uuid import uuid4
|
|
|
24
24
|
|
|
25
25
|
from grpc import StatusCode
|
|
26
26
|
from grpc.aio import AioRpcError
|
|
27
|
-
from nidx_protos import noderesources_pb2
|
|
27
|
+
from nidx_protos import nidx_pb2, noderesources_pb2
|
|
28
28
|
|
|
29
29
|
from nucliadb.common import datamanagers
|
|
30
30
|
from nucliadb.common.cluster.exceptions import ShardNotFound
|
|
@@ -108,6 +108,7 @@ class KnowledgeBox:
|
|
|
108
108
|
external_index_provider: CreateExternalIndexProviderMetadata = CreateExternalIndexProviderMetadata(),
|
|
109
109
|
hidden_resources_enabled: bool = False,
|
|
110
110
|
hidden_resources_hide_on_creation: bool = False,
|
|
111
|
+
prewarm_enabled: bool = False,
|
|
111
112
|
) -> tuple[str, str]:
|
|
112
113
|
"""Creates a new knowledge box and return its id and slug."""
|
|
113
114
|
|
|
@@ -194,6 +195,7 @@ class KnowledgeBox:
|
|
|
194
195
|
migration_version=get_latest_version(),
|
|
195
196
|
hidden_resources_enabled=hidden_resources_enabled,
|
|
196
197
|
hidden_resources_hide_on_creation=hidden_resources_hide_on_creation,
|
|
198
|
+
prewarm_enabled=prewarm_enabled,
|
|
197
199
|
)
|
|
198
200
|
config.external_index_provider.CopyFrom(stored_external_index_provider)
|
|
199
201
|
await datamanagers.kb.set_config(txn, kbid=kbid, config=config)
|
|
@@ -220,7 +222,7 @@ class KnowledgeBox:
|
|
|
220
222
|
shard_manager = get_shard_manager()
|
|
221
223
|
# XXX creating a shard is a slow IO operation that requires a write
|
|
222
224
|
# txn to be open!
|
|
223
|
-
await shard_manager.create_shard_by_kbid(txn, kbid)
|
|
225
|
+
await shard_manager.create_shard_by_kbid(txn, kbid, prewarm_enabled=prewarm_enabled)
|
|
224
226
|
# shards don't need a rollback as they will be eventually purged
|
|
225
227
|
|
|
226
228
|
await txn.commit()
|
|
@@ -243,39 +245,86 @@ class KnowledgeBox:
|
|
|
243
245
|
@classmethod
|
|
244
246
|
async def update(
|
|
245
247
|
cls,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
+
driver: Driver,
|
|
249
|
+
kbid: str,
|
|
250
|
+
*,
|
|
248
251
|
slug: Optional[str] = None,
|
|
249
|
-
|
|
252
|
+
title: Optional[str] = None,
|
|
253
|
+
description: Optional[str] = None,
|
|
254
|
+
migration_version: Optional[int] = None,
|
|
255
|
+
external_index_provider: Optional[StoredExternalIndexProviderMetadata] = None,
|
|
256
|
+
hidden_resources_enabled: Optional[bool] = None,
|
|
257
|
+
hidden_resources_hide_on_creation: Optional[bool] = None,
|
|
258
|
+
prewarm_enabled: Optional[bool] = None,
|
|
250
259
|
) -> str:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
else:
|
|
264
|
-
exist.slug = slug
|
|
260
|
+
async with driver.rw_transaction() as txn:
|
|
261
|
+
stored = await datamanagers.kb.get_config(txn, kbid=kbid, for_update=True)
|
|
262
|
+
if not stored:
|
|
263
|
+
raise datamanagers.exceptions.KnowledgeBoxNotFound()
|
|
264
|
+
|
|
265
|
+
if slug:
|
|
266
|
+
await txn.delete(datamanagers.kb.KB_SLUGS.format(slug=stored.slug))
|
|
267
|
+
await txn.set(
|
|
268
|
+
datamanagers.kb.KB_SLUGS.format(slug=slug),
|
|
269
|
+
kbid.encode(),
|
|
270
|
+
)
|
|
271
|
+
stored.slug = slug
|
|
265
272
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
273
|
+
if title is not None:
|
|
274
|
+
stored.title = title
|
|
275
|
+
if description is not None:
|
|
276
|
+
stored.description = description
|
|
270
277
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
278
|
+
if migration_version is not None:
|
|
279
|
+
stored.migration_version = migration_version
|
|
280
|
+
|
|
281
|
+
if external_index_provider is not None:
|
|
282
|
+
stored.external_index_provider.MergeFrom(external_index_provider)
|
|
275
283
|
|
|
276
|
-
|
|
284
|
+
if hidden_resources_enabled is not None:
|
|
285
|
+
stored.hidden_resources_enabled = hidden_resources_enabled
|
|
286
|
+
if hidden_resources_hide_on_creation is not None:
|
|
287
|
+
stored.hidden_resources_hide_on_creation = hidden_resources_hide_on_creation
|
|
288
|
+
|
|
289
|
+
update_nidx_prewarm = None
|
|
290
|
+
if prewarm_enabled is not None:
|
|
291
|
+
if stored.prewarm_enabled != prewarm_enabled:
|
|
292
|
+
update_nidx_prewarm = prewarm_enabled
|
|
293
|
+
stored.prewarm_enabled = prewarm_enabled
|
|
294
|
+
|
|
295
|
+
if stored.hidden_resources_hide_on_creation and not stored.hidden_resources_enabled:
|
|
296
|
+
raise KnowledgeBoxCreationError(
|
|
297
|
+
"Cannot hide new resources if the hidden resources feature is disabled"
|
|
298
|
+
)
|
|
277
299
|
|
|
278
|
-
|
|
300
|
+
await datamanagers.kb.set_config(txn, kbid=kbid, config=stored)
|
|
301
|
+
|
|
302
|
+
await txn.commit()
|
|
303
|
+
|
|
304
|
+
if update_nidx_prewarm is not None:
|
|
305
|
+
await cls.configure_shards(driver, kbid, prewarm=update_nidx_prewarm)
|
|
306
|
+
|
|
307
|
+
return kbid
|
|
308
|
+
|
|
309
|
+
@classmethod
|
|
310
|
+
async def configure_shards(cls, driver: Driver, kbid: str, *, prewarm: bool):
|
|
311
|
+
shards_obj = await datamanagers.atomic.cluster.get_kb_shards(kbid=kbid)
|
|
312
|
+
if shards_obj is None:
|
|
313
|
+
logger.warning(f"Shards not found for KB while updating pre-warm flag", extra={"kbid": kbid})
|
|
314
|
+
return
|
|
315
|
+
|
|
316
|
+
nidx_shard_ids = [shard.nidx_shard_id for shard in shards_obj.shards]
|
|
317
|
+
|
|
318
|
+
nidx_api = get_nidx_api_client()
|
|
319
|
+
if nidx_api is not None and len(nidx_shard_ids) > 0:
|
|
320
|
+
configs = [
|
|
321
|
+
nidx_pb2.ShardConfig(
|
|
322
|
+
shard_id=shard_id,
|
|
323
|
+
prewarm_enabled=prewarm,
|
|
324
|
+
)
|
|
325
|
+
for shard_id in nidx_shard_ids
|
|
326
|
+
]
|
|
327
|
+
await nidx_api.ConfigureShards(nidx_pb2.ShardsConfig(configs=configs))
|
|
279
328
|
|
|
280
329
|
@classmethod
|
|
281
330
|
async def delete(cls, driver: Driver, kbid: str):
|
|
@@ -457,7 +457,11 @@ class Processor:
|
|
|
457
457
|
shard = await self.index_node_shard_manager.get_current_active_shard(txn, kbid)
|
|
458
458
|
if shard is None:
|
|
459
459
|
# No current shard available, create a new one
|
|
460
|
-
|
|
460
|
+
kb_config = await datamanagers.kb.get_config(txn, kbid=kbid)
|
|
461
|
+
prewarm = kb_config is not None and kb_config.prewarm_enabled
|
|
462
|
+
shard = await self.index_node_shard_manager.create_shard_by_kbid(
|
|
463
|
+
txn, kbid, prewarm_enabled=prewarm
|
|
464
|
+
)
|
|
461
465
|
await datamanagers.resources.set_resource_shard_id(
|
|
462
466
|
txn, kbid=kbid, rid=uuid, shard=shard.shard
|
|
463
467
|
)
|
|
@@ -126,6 +126,7 @@ class WriterServicer(writer_pb2_grpc.WriterServicer):
|
|
|
126
126
|
external_index_provider=request.external_index_provider,
|
|
127
127
|
hidden_resources_enabled=request.hidden_resources_enabled,
|
|
128
128
|
hidden_resources_hide_on_creation=request.hidden_resources_hide_on_creation,
|
|
129
|
+
prewarm_enabled=request.prewarm_enabled,
|
|
129
130
|
)
|
|
130
131
|
|
|
131
132
|
except KnowledgeBoxConflict:
|
|
@@ -167,11 +168,17 @@ class WriterServicer(writer_pb2_grpc.WriterServicer):
|
|
|
167
168
|
)
|
|
168
169
|
|
|
169
170
|
try:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
kbid = await KnowledgeBoxORM.update(
|
|
172
|
+
self.driver,
|
|
173
|
+
kbid=request.uuid,
|
|
174
|
+
slug=request.slug,
|
|
175
|
+
title=request.config.title or None,
|
|
176
|
+
description=request.config.description or None,
|
|
177
|
+
external_index_provider=request.config.external_index_provider or None,
|
|
178
|
+
hidden_resources_enabled=request.config.hidden_resources_enabled,
|
|
179
|
+
hidden_resources_hide_on_creation=request.config.hidden_resources_hide_on_creation,
|
|
180
|
+
prewarm_enabled=request.config.prewarm_enabled,
|
|
181
|
+
)
|
|
175
182
|
except KnowledgeBoxNotFound:
|
|
176
183
|
return UpdateKnowledgeBoxResponse(status=KnowledgeBoxResponseStatus.NOTFOUND)
|
|
177
184
|
except Exception:
|
nucliadb/migrator/datamanager.py
CHANGED
|
@@ -77,13 +77,7 @@ class MigrationsDataManager:
|
|
|
77
77
|
return KnowledgeBoxInfo(current_version=kb_config.migration_version)
|
|
78
78
|
|
|
79
79
|
async def update_kb_info(self, *, kbid: str, current_version: int) -> None:
|
|
80
|
-
|
|
81
|
-
kb_config = await datamanagers.kb.get_config(txn, kbid=kbid, for_update=True)
|
|
82
|
-
if kb_config is None:
|
|
83
|
-
raise Exception(f"KB {kbid} does not exist")
|
|
84
|
-
kb_config.migration_version = current_version
|
|
85
|
-
await KnowledgeBoxORM.update(txn, kbid, config=kb_config)
|
|
86
|
-
await txn.commit()
|
|
80
|
+
await KnowledgeBoxORM.update(self.driver, kbid, migration_version=current_version)
|
|
87
81
|
|
|
88
82
|
async def get_global_info(self) -> GlobalInfo:
|
|
89
83
|
async with self.driver.ro_transaction() as txn:
|
|
@@ -147,8 +147,6 @@ async def create_kb(item: KnowledgeBoxConfig) -> tuple[str, str]:
|
|
|
147
147
|
@requires(NucliaDBRoles.MANAGER)
|
|
148
148
|
@version(1)
|
|
149
149
|
async def update_kb(request: Request, kbid: str, item: KnowledgeBoxConfig) -> KnowledgeBoxObjID:
|
|
150
|
-
driver = get_driver()
|
|
151
|
-
config = None
|
|
152
150
|
if (
|
|
153
151
|
item.slug
|
|
154
152
|
or item.title
|
|
@@ -156,29 +154,24 @@ async def update_kb(request: Request, kbid: str, item: KnowledgeBoxConfig) -> Kn
|
|
|
156
154
|
or item.hidden_resources_enabled
|
|
157
155
|
or item.hidden_resources_hide_on_creation
|
|
158
156
|
):
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
title=item.title or "",
|
|
162
|
-
description=item.description or "",
|
|
163
|
-
hidden_resources_enabled=item.hidden_resources_enabled,
|
|
164
|
-
hidden_resources_hide_on_creation=item.hidden_resources_hide_on_creation,
|
|
165
|
-
)
|
|
166
|
-
try:
|
|
167
|
-
async with driver.rw_transaction() as txn:
|
|
157
|
+
try:
|
|
158
|
+
driver = get_driver()
|
|
168
159
|
await KnowledgeBox.update(
|
|
169
|
-
|
|
170
|
-
|
|
160
|
+
driver,
|
|
161
|
+
kbid=kbid,
|
|
171
162
|
slug=item.slug,
|
|
172
|
-
|
|
163
|
+
title=item.title,
|
|
164
|
+
description=item.description,
|
|
165
|
+
hidden_resources_enabled=item.hidden_resources_enabled,
|
|
166
|
+
hidden_resources_hide_on_creation=item.hidden_resources_hide_on_creation,
|
|
173
167
|
)
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
return KnowledgeBoxObjID(uuid=kbid)
|
|
168
|
+
except datamanagers.exceptions.KnowledgeBoxNotFound:
|
|
169
|
+
raise HTTPException(status_code=404, detail="Knowledge box does not exist")
|
|
170
|
+
except Exception as exc:
|
|
171
|
+
logger.exception("Could not update KB", exc_info=exc, extra={"kbid": kbid})
|
|
172
|
+
raise HTTPException(status_code=500, detail="Error updating knowledge box")
|
|
173
|
+
|
|
174
|
+
return KnowledgeBoxObjID(uuid=kbid)
|
|
182
175
|
|
|
183
176
|
|
|
184
177
|
@only_for_onprem
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nucliadb
|
|
3
|
-
Version: 6.9.1.
|
|
3
|
+
Version: 6.9.1.post5192
|
|
4
4
|
Summary: NucliaDB
|
|
5
5
|
Author-email: Nuclia <nucliadb@nuclia.com>
|
|
6
6
|
License-Expression: AGPL-3.0-or-later
|
|
@@ -19,11 +19,11 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
20
|
Requires-Python: <4,>=3.9
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
|
-
Requires-Dist: nucliadb-telemetry[all]>=6.9.1.
|
|
23
|
-
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.9.1.
|
|
24
|
-
Requires-Dist: nucliadb-protos>=6.9.1.
|
|
25
|
-
Requires-Dist: nucliadb-models>=6.9.1.
|
|
26
|
-
Requires-Dist: nidx-protos>=6.9.1.
|
|
22
|
+
Requires-Dist: nucliadb-telemetry[all]>=6.9.1.post5192
|
|
23
|
+
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.9.1.post5192
|
|
24
|
+
Requires-Dist: nucliadb-protos>=6.9.1.post5192
|
|
25
|
+
Requires-Dist: nucliadb-models>=6.9.1.post5192
|
|
26
|
+
Requires-Dist: nidx-protos>=6.9.1.post5192
|
|
27
27
|
Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
|
|
28
28
|
Requires-Dist: nuclia-models>=0.50.0
|
|
29
29
|
Requires-Dist: uvicorn[standard]
|
|
@@ -85,9 +85,9 @@ nucliadb/common/catalog/utils.py,sha256=lQLTe3rN_ra0CiNjTQIiIaU4lhx5beRkx1Va10ZB
|
|
|
85
85
|
nucliadb/common/cluster/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
|
86
86
|
nucliadb/common/cluster/exceptions.py,sha256=t7v_l93t44l2tQpdQXgO_w-c4YZRcaayOz1A2i0w4RQ,1258
|
|
87
87
|
nucliadb/common/cluster/grpc_node_dummy.py,sha256=JkufazWzMA4KFEU8EBkMbiiDW4C8lLcRhiiCxP7aCQY,2949
|
|
88
|
-
nucliadb/common/cluster/manager.py,sha256=
|
|
89
|
-
nucliadb/common/cluster/rebalance.py,sha256=
|
|
90
|
-
nucliadb/common/cluster/rollover.py,sha256=
|
|
88
|
+
nucliadb/common/cluster/manager.py,sha256=p-haaGEnCa-20t-I2XEo4QJ5ZC1QgJ6p2jzXFYVB6nQ,12346
|
|
89
|
+
nucliadb/common/cluster/rebalance.py,sha256=U-LgmDZq7JaEKh4fruUoW8VrqAAnpQrdwqN_p0tbCKo,8899
|
|
90
|
+
nucliadb/common/cluster/rollover.py,sha256=i_W5_ds_5c_SZWxQGg4I8c_d7tP2VEPSnCVq5HU55jI,26490
|
|
91
91
|
nucliadb/common/cluster/settings.py,sha256=f6Y5K0PGahkedwe5wtkWMnbqwDFJgOOwX_MOIGwH9Dg,2271
|
|
92
92
|
nucliadb/common/cluster/utils.py,sha256=IfW5PA7Ab26xWUYNOc3yBoksWV1GK4BGhTRo1vnHNKg,4662
|
|
93
93
|
nucliadb/common/cluster/standalone/__init__.py,sha256=itSI7dtTwFP55YMX4iK7JzdMHS5CQVUiB1XzQu4UBh8,833
|
|
@@ -95,7 +95,7 @@ nucliadb/common/cluster/standalone/utils.py,sha256=af3r-x_GF7A6dwIAhZLR-r-SZQEVx
|
|
|
95
95
|
nucliadb/common/context/__init__.py,sha256=IKAHuiCjbOEsqfLozWwJ6mRFzFncsZMyxNC5E_XZ5EM,6016
|
|
96
96
|
nucliadb/common/context/fastapi.py,sha256=mH_8n5t7quNSPivNM2JS5EQf2sTVJsdzXW6LaY7EHAA,1629
|
|
97
97
|
nucliadb/common/datamanagers/__init__.py,sha256=xKc6ZMqKUs20R90jJT4xkQ8TFMNwQnhhuWnBBqVnKdM,2084
|
|
98
|
-
nucliadb/common/datamanagers/atomic.py,sha256
|
|
98
|
+
nucliadb/common/datamanagers/atomic.py,sha256=-3T2--A0_qFWmy573t-DS29EHFcMTyjGvcvky6J9tAM,3341
|
|
99
99
|
nucliadb/common/datamanagers/cluster.py,sha256=iU0b7AESm1Yi8Wp3pIKgqixZGNMjeBrxSpvEKsaZKgY,1831
|
|
100
100
|
nucliadb/common/datamanagers/entities.py,sha256=gI-0mbMlqrr9FiyhexEh6czhgYcMxE2s9m4o866EK9o,5340
|
|
101
101
|
nucliadb/common/datamanagers/exceptions.py,sha256=Atz_PP_GGq4jgJaWcAkcRbHBoBaGcC9yJvFteylKtTE,883
|
|
@@ -150,8 +150,8 @@ nucliadb/ingest/consumer/consumer.py,sha256=1OetpJXp6glaAe4kKqUA_L46BS-ZyEccTkwt
|
|
|
150
150
|
nucliadb/ingest/consumer/materializer.py,sha256=tgD_rDI2twQzcz8kKNiW_L4YIth16IGh9mUfD5wiSD4,3858
|
|
151
151
|
nucliadb/ingest/consumer/metrics.py,sha256=ji1l_4cKiHJthQd8YNem1ft4iMbw9KThmVvJmLcv3Xg,1075
|
|
152
152
|
nucliadb/ingest/consumer/pull.py,sha256=Ki_aHi72W83yD03lPt6Yz2l_uCeu62fd4upEMcOZcm4,9201
|
|
153
|
-
nucliadb/ingest/consumer/service.py,sha256=
|
|
154
|
-
nucliadb/ingest/consumer/shard_creator.py,sha256=
|
|
153
|
+
nucliadb/ingest/consumer/service.py,sha256=_yj3gUKaCUA6Wp_73Bm8tO2Xk1vR8-aJV2xvPZpjAfM,5524
|
|
154
|
+
nucliadb/ingest/consumer/shard_creator.py,sha256=qUEpxZLE1etw1nL8L3O9HvZBx5NNql7S1vKDyqelN2M,4849
|
|
155
155
|
nucliadb/ingest/consumer/utils.py,sha256=jpX8D4lKzuPCpArQLZeX_Zczq3pfen_zAf8sPJfOEZU,2642
|
|
156
156
|
nucliadb/ingest/fields/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
|
157
157
|
nucliadb/ingest/fields/base.py,sha256=D8NzawonF7hivDW9zvQBbV938TKA6e2OCGqV4kS96RU,24405
|
|
@@ -167,23 +167,23 @@ nucliadb/ingest/orm/broker_message.py,sha256=XWaiZgDOz94NPOPT-hqbRr5ZkpVimUw6PjU
|
|
|
167
167
|
nucliadb/ingest/orm/entities.py,sha256=kXyeF6XOpFKhEsGLcY-GLIk21Exp0cJst4XQQ9jJoug,14791
|
|
168
168
|
nucliadb/ingest/orm/exceptions.py,sha256=gsp7TtVNQPiIEh-zf_UEJClwuFU0iu-5vzj0OrKMScg,1550
|
|
169
169
|
nucliadb/ingest/orm/index_message.py,sha256=mWlpQ0-KChSVIbHewVE8sXCe-7LiPIIh0cBqr3axU8o,16554
|
|
170
|
-
nucliadb/ingest/orm/knowledgebox.py,sha256=
|
|
170
|
+
nucliadb/ingest/orm/knowledgebox.py,sha256=rjZKD8dIhr-2kvm77K0OBjQKv8VU1FoWi0YQDswZ9fo,25630
|
|
171
171
|
nucliadb/ingest/orm/metrics.py,sha256=OiuggTh-n3kZHA2G73NEUdIlh8c3yFrbusI88DK-Mko,1273
|
|
172
172
|
nucliadb/ingest/orm/resource.py,sha256=zQeZyZ-tCxr-DhonLobfZRkz_iEew0Y-cGfXeNNIHG0,40432
|
|
173
173
|
nucliadb/ingest/orm/utils.py,sha256=fCQRuyecgqhaY7mcBG93oaXMkzkKb9BFjOcy4-ZiSNw,2693
|
|
174
174
|
nucliadb/ingest/orm/processor/__init__.py,sha256=xhDNKCxY0XNOlIVKEtM8QT75vDUkJIt7K-_VgGbbOQU,904
|
|
175
175
|
nucliadb/ingest/orm/processor/auditing.py,sha256=gxn5v30KVaH0TnIjo715mWjzKGJ-DMviElEXJG9BNN4,4612
|
|
176
176
|
nucliadb/ingest/orm/processor/data_augmentation.py,sha256=v-pj4GbBWSuO8dQyahs5UDr5ghsyfhCZDS0ftKd6ZYc,5179
|
|
177
|
-
nucliadb/ingest/orm/processor/processor.py,sha256=
|
|
177
|
+
nucliadb/ingest/orm/processor/processor.py,sha256=t9k0AxKRC3w5btv_e4Xw93vMwWCtEytWDV1kxFXCtbk,31609
|
|
178
178
|
nucliadb/ingest/orm/processor/sequence_manager.py,sha256=kUH0bCuM6NqpA0xSwfyb9igig3Btu57pc8VYnKggqx4,1693
|
|
179
179
|
nucliadb/ingest/service/__init__.py,sha256=LHQFUkdmNBOWqBG0Md9sMMI7g5TQZ-hLAnhw6ZblrJg,2002
|
|
180
180
|
nucliadb/ingest/service/exceptions.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
|
181
|
-
nucliadb/ingest/service/writer.py,sha256=
|
|
181
|
+
nucliadb/ingest/service/writer.py,sha256=ilHBV3cW4D-vO0hWKZP0hA9j5xNnEgsXrrw7r0VOt9M,21988
|
|
182
182
|
nucliadb/middleware/__init__.py,sha256=A8NBlBuEkunCFMKpR9gnfNELsVn0Plc55BIQMbWDM8Q,2202
|
|
183
183
|
nucliadb/migrator/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
|
184
184
|
nucliadb/migrator/command.py,sha256=dKbJ1tAmP6X4lMVRSSlz351euaqs2wBPpOczLjATUes,2089
|
|
185
185
|
nucliadb/migrator/context.py,sha256=3h6M_AG2HFjTYtQC2XDmKps7wywdUduT1RM3C30S_S0,1334
|
|
186
|
-
nucliadb/migrator/datamanager.py,sha256=
|
|
186
|
+
nucliadb/migrator/datamanager.py,sha256=PttueVXSqwXHNvrT8p2626Td-NHb4eGBbfBY_F4vVdw,4928
|
|
187
187
|
nucliadb/migrator/exceptions.py,sha256=jTj3YhKmFwUyjjgoKUNoCAiGrpEbB64X1Um212nSNQ8,889
|
|
188
188
|
nucliadb/migrator/migrator.py,sha256=NUOhaCyEoAldXVexYEqClppIN0TMXrF37Ulz0y0TWCY,10840
|
|
189
189
|
nucliadb/migrator/models.py,sha256=3PJkL2PGvKgIG0KIBv4H5XCsOVmwWMlRV3m0ntDj10Q,1145
|
|
@@ -362,7 +362,7 @@ nucliadb/writer/api/utils.py,sha256=wIQHlU8RQiIGVLI72suvyVIKlCU44Unh0Ae0IiN6Qwo,
|
|
|
362
362
|
nucliadb/writer/api/v1/__init__.py,sha256=akI9A_jloNLb0dU4T5zjfdyvmSAiDeIdjAlzNx74FlU,1128
|
|
363
363
|
nucliadb/writer/api/v1/export_import.py,sha256=v0sU55TtRSqDzwkDgcwv2uSaqKCuQTtGcMpYoHQYBQA,8192
|
|
364
364
|
nucliadb/writer/api/v1/field.py,sha256=nO3IEV6v5hokdIo5HoaecdwDqvr1PzCJlh5DafzcNTw,19130
|
|
365
|
-
nucliadb/writer/api/v1/knowledgebox.py,sha256=
|
|
365
|
+
nucliadb/writer/api/v1/knowledgebox.py,sha256=hx3J91fziaISU1aYdfI0eIQNuJj8BrBzGb6B4Rt2j-I,7881
|
|
366
366
|
nucliadb/writer/api/v1/learning_config.py,sha256=DTLEzKJ3dHvi8pbZscjElUqCH_ZvLc6WZgvalFqHo10,4450
|
|
367
367
|
nucliadb/writer/api/v1/resource.py,sha256=IfcT6HXnR5sC5wSnQSuKmFzEWcLTh7OzZEAV4hYmXnA,20442
|
|
368
368
|
nucliadb/writer/api/v1/router.py,sha256=RjuoWLpZer6Kl2BW_wznpNo6XL3BOpdTGqXZCn3QrrQ,1034
|
|
@@ -385,8 +385,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
|
|
|
385
385
|
nucliadb/writer/tus/s3.py,sha256=vu1BGg4VqJ_x2P1u2BxqPKlSfw5orT_a3R-Ln5oPUpU,8483
|
|
386
386
|
nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
|
|
387
387
|
nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
|
|
388
|
-
nucliadb-6.9.1.
|
|
389
|
-
nucliadb-6.9.1.
|
|
390
|
-
nucliadb-6.9.1.
|
|
391
|
-
nucliadb-6.9.1.
|
|
392
|
-
nucliadb-6.9.1.
|
|
388
|
+
nucliadb-6.9.1.post5192.dist-info/METADATA,sha256=dS74zqOkgFw6qgTfAPpcIj1yfslFWNp1X9233WPKPMk,4158
|
|
389
|
+
nucliadb-6.9.1.post5192.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
390
|
+
nucliadb-6.9.1.post5192.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
|
|
391
|
+
nucliadb-6.9.1.post5192.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
|
|
392
|
+
nucliadb-6.9.1.post5192.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|