Metadata-Version: 2.1
Name: nucliadb
Version: 2.18.0.post483
Summary: UNKNOWN
Home-page: https://nucliadb.com
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
Keywords: search,semantic,AI
Platform: UNKNOWN
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 :: Only
Requires-Python: >=3.9, <4
Description-Content-Type: text/markdown
Requires-Dist: uvicorn (<0.19.0)
Requires-Dist: pydantic-argparse
Requires-Dist: nucliadb-node-binding (>=0.7.5)
Requires-Dist: aiohttp (>=3.8.1)
Requires-Dist: lru-dict (>=1.1.7)
Requires-Dist: backoff
Requires-Dist: aiofiles (>=0.8.0)
Requires-Dist: types-aiofiles (>=0.8.3)
Requires-Dist: protobuf (>=3.20.2)
Requires-Dist: types-protobuf (<4.0,>=3.19.20)
Requires-Dist: grpcio (>=1.44.0)
Requires-Dist: grpcio-health-checking (>=1.44.0)
Requires-Dist: grpcio-channelz (>=1.44.0)
Requires-Dist: grpcio-status (>=1.44.0)
Requires-Dist: grpcio-tools (>=1.44.0)
Requires-Dist: grpcio-testing (>=1.44.0)
Requires-Dist: grpcio-reflection (>=1.44.0)
Requires-Dist: orjson (>=3.6.7)
Requires-Dist: types-setuptools
Requires-Dist: pydantic (<2.0,>=1.9.0)
Requires-Dist: aiobotocore (>=2.1.1)
Requires-Dist: aioboto3
Requires-Dist: botocore
Requires-Dist: google-cloud-storage
Requires-Dist: gcloud
Requires-Dist: oauth2client
Requires-Dist: fastapi-versioning (>=0.10.0)
Requires-Dist: fastapi (<0.89.0,>=0.75.0)
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.24.7)
Requires-Dist: aiodns (>=3.0.0)
Requires-Dist: types-orjson
Requires-Dist: nucliadb-telemetry (>=1.12.0)
Requires-Dist: nucliadb-utils[cache,fastapi,storages] (==2.18.0-post483)
Requires-Dist: nucliadb-protos (==2.18.0-post483)
Requires-Dist: nucliadb-models (>=2.15.1.post353)
Requires-Dist: nucliadb-contributor-assets (~=1.0.0)
Requires-Dist: asyncpg (>=0.27.0)
Requires-Dist: tikv-client (>=0.0.3)
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.2)
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.

