Metadata-Version: 2.1
Name: nucliadb
Version: 5.0.0.post643
Home-page: https://docs.nuclia.dev/docs/guides/nucliadb/intro
Author: NucliaDB Community
Author-email: nucliadb@nuclia.com
License: BSD
Project-URL: Nuclia, https://nuclia.com
Project-URL: Github, https://github.com/nuclia/nucliadb
Project-URL: Discord, https://discord.gg/8EvQwmsbzf
Project-URL: API Reference, https://docs.nuclia.dev/docs/api
Keywords: search,semantic,AI
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.9, <4
Description-Content-Type: text/markdown
Requires-Dist: nucliadb-telemetry[all] >=5.0.0.post643
Requires-Dist: nucliadb-utils[cache,fastapi,storages] >=5.0.0.post643
Requires-Dist: nucliadb-protos >=5.0.0.post643
Requires-Dist: nucliadb-models >=5.0.0.post643
Requires-Dist: nucliadb-admin-assets >=1.0.0.post1224
Requires-Dist: nucliadb-node-binding >=2.26.0
Requires-Dist: uvicorn <0.19.0
Requires-Dist: argdantic
Requires-Dist: aiohttp >=3.9.4
Requires-Dist: lru-dict >=1.1.7
Requires-Dist: backoff
Requires-Dist: aiofiles >=0.8.0
Requires-Dist: psutil >=5.9.7
Requires-Dist: types-psutil >=5.9.5.17
Requires-Dist: types-aiofiles >=0.8.3
Requires-Dist: protobuf >=4.22.3
Requires-Dist: types-protobuf <5,>=4.24
Requires-Dist: grpcio <1.63.0,>=1.44.0
Requires-Dist: grpcio-health-checking <1.63.0,>=1.44.0
Requires-Dist: grpcio-channelz <1.63.0,>=1.44.0
Requires-Dist: grpcio-status <1.63.0,>=1.44.0
Requires-Dist: grpcio-tools <1.63.0,>=1.44.0
Requires-Dist: grpcio-testing <1.63.0,>=1.44.0
Requires-Dist: grpcio-reflection <1.63.0,>=1.44.0
Requires-Dist: orjson >=3.6.7
Requires-Dist: types-setuptools
Requires-Dist: pydantic >=2.7
Requires-Dist: pydantic-settings >=2.2
Requires-Dist: aiobotocore >=2.9.0
Requires-Dist: botocore >=1.34.0
Requires-Dist: google-cloud-storage
Requires-Dist: gcloud
Requires-Dist: oauth2client
Requires-Dist: jwcrypto >=1.5.6
Requires-Dist: fastapi-versioning >=0.10.0
Requires-Dist: fastapi >=0.95.2
Requires-Dist: sentry-sdk >=1.5.12
Requires-Dist: pyjwt >=2.4.0
Requires-Dist: mmh3 >=3.0.0
Requires-Dist: httpx >=0.23.0
Requires-Dist: types-pkg-resources >=0.1.3
Requires-Dist: grpc-stubs >=1.44.0
Requires-Dist: aiodns >=3.0.0
Requires-Dist: types-orjson
Requires-Dist: psycopg[binary,pool]
Requires-Dist: multidict >=6.0.4
Requires-Dist: deprecated >=1.2.12
Requires-Dist: asgiref >=3.3.2
Requires-Dist: jmespath >=1.0.0
Requires-Dist: idna >=3.3
Requires-Dist: sniffio >=1.2.0
Requires-Dist: async-lru >=2.0.4
Requires-Dist: async-timeout >=4.0.3
Requires-Dist: cachetools >=5.3.2
Requires-Dist: types-cachetools >=5.3.0.5
Requires-Dist: kubernetes-asyncio
Provides-Extra: redis
Requires-Dist: redis >=4.3.4 ; extra == 'redis'

# nucliadb

This module contains most of the Python components for NucliaDB:

- ingest
- reader
- writer
- search
- train

# NucliaDB Migrations

This module is used to manage NucliaDB Migrations.

All migrations will be provided in the `migrations` folder and have a filename
that follows the structure: `[sequence]_[migration name].py`.
Where `sequence` is the order the migration should be run in with zero padding.
Example: `0001_migrate_data.py`.

Each migration should have the following:

```python
from nucliadb.migrator.context import ExecutionContext


async def migrate(context: ExecutionContext) -> None:
    """
    Non-kb type of migration. Migrate global data.
    """


async def migrate_kb(context: ExecutionContext, kbid: str) -> None:
    """
    Migrate kb.

    Must have both types of migrations.
    """
```


## How migrations are managed

- All migrations utilize a distributed lock to prevent simulateously running jobs
- Global migration state:
    - current version
    - target version
    - KBs to migrate
- KB Migration State:
    - current version

- Migrations are currently run with a deployment and will be continuously retried on failure.
- Running migrations in a deployment is to make sure a migration does not prevent code deployment.
