Vectorstore Asynchronous Tasks
Celery tasks of the vectorstore app.
deploy_vectorstore(): create a vectorstore’s database, and check it until it is ready. Queued bydeploy. Each run checks once, and queues itself again, rather than waiting.provision_vectorstore(),undeploy_vectorstore()anddelete_vectorstore(): apply a self-hosted server’s changed spec, stop serving, and destroy the database, then delete the vectorstore. Queued by the service’squeue_*methods: the web server only reads the cluster, and the infrastructure worker makes every change (ADR-038, phase 3, issue #1080).load_vectorstore_document(): split, embed and load a document. Queued when a document is added.delete_vectorstore_document(): remove a document’s chunks, then the document.snapshot_vectorstore(): take a snapshot, or backup, on request.reconcile_vectorstores(): Celery Beat, every few minutes. Check deployed vectorstores, record their status, conditions and statistics, and take over a deploy whose task was lost.maintain_vectorstores(): Celery Beat, hourly. Take snapshots on each manifest’s schedule, prune them to its retention, and queue documents whose task was lost again.
- smarter.apps.vectorstore.tasks.queued_vectorstore(vectorstore_id)[source]
Read a vectorstore that a task was queued for, with what its backend needs.
- Parameters:
vectorstore_id (
int) – The vectorstore’s id.- Return type:
- Returns:
The vectorstore, or None, logged, if it no longer exists.
- smarter.apps.vectorstore.tasks.record_task_failure(service, action, error)[source]
Record that a queued change to a vectorstore failed, as its status message, keeping its status.
Whoever queued the change has already been answered, so this is where they see why: describe, and the console.
destroy()records its own failure, failed.- Parameters:
service (
VectorstoreService) – The vectorstore’s service.action (
str) – What failed, e.g.Undeploy.error (
Exception) – Why.
- Return type: