Metadata-Version: 2.2
Name: nucliadb
Version: 6.3.1.post3546
Summary: NucliaDB
Author-email: Nuclia <nucliadb@nuclia.com>
License: AGPL
Project-URL: Nuclia, https://nuclia.com
Project-URL: Github, https://github.com/nuclia/nucliadb
Project-URL: Slack, https://nuclia-community.slack.com
Project-URL: API Reference, https://docs.nuclia.dev/docs/api
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: <4,>=3.9
Description-Content-Type: text/markdown
Requires-Dist: nucliadb-telemetry[all]>=6.3.1.post3546
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.1.post3546
Requires-Dist: nucliadb-protos>=6.3.1.post3546
Requires-Dist: nucliadb-models>=6.3.1.post3546
Requires-Dist: nidx-protos>=6.3.1.post3546
Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
Requires-Dist: nuclia-models>=0.24.2
Requires-Dist: uvicorn
Requires-Dist: argdantic
Requires-Dist: aiohttp>=3.11.11
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.6
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: pyyaml>=5.1
Requires-Dist: fastapi-versioning>=0.10.0
Requires-Dist: fastapi>=0.95.2
Requires-Dist: sentry-sdk>=2.8.0
Requires-Dist: pyjwt>=2.4.0
Requires-Dist: mmh3>=3.0.0
Requires-Dist: httpx>=0.23.0
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
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.
