Skip to content

feat: run the Hasura database on pgvector and add semantic search - #117

Merged
mosoriob merged 2 commits into
mainfrom
feat/hasura-db-pgvector
Sep 12, 2026
Merged

mosoriob merged 2 commits into
mainfrom
feat/hasura-db-pgvector

Conversation

@mosoriob

Copy link
Copy Markdown
Contributor

Problem

Every hasura migrate apply fails. Migration 1771200021000_standard_variable_embeddings runs CREATE EXTENSION vector. The chart pins the Hasura database to postgis/postgis:10-3.2-alpine, which ships no pgvector.

could not open extension control file "/usr/local/share/postgresql/extension/vector.control"

The pgvector work in mintproject/monorepo changed compose.yaml and the Tapis Pods deployment. It did not change this chart.

Changes

File Change
values.yaml components.hasura_db.image -> ghcr.io/mintproject/postgres-pgvector:develop
values.yaml new components.semantic_search block
templates/semantic-search.yaml new Deployment and Service on port 8091
templates/hasura.yaml always set SVO_SEMANTIC_SEARCH_WEBHOOK_URL
Chart.yaml 9.0.0-beta.12 -> 9.0.0-beta.13

Breaking change: a data migration is required

The new image is PostgreSQL 16. The old default was PostgreSQL 10. PostgreSQL 16 refuses to start on PostgreSQL 10 data files. A helm upgrade alone leaves the database pod in CrashLoopBackOff.

Each deployment must run these steps:

  1. Scale the Hasura deployment to 0.
  2. Dump the database with a PostgreSQL 16 pg_dump.
  3. Delete the PVC data-<release>-hasura-db-0.
  4. Upgrade, then restore with pg_restore.

The PVC carries helm.sh/resource-policy: keep, so Helm never deletes it for you.

Why the webhook variable is always set

The metadata in mintproject/monorepo declares nine event triggers with webhook_from_env: SVO_SEMANTIC_SEARCH_WEBHOOK_URL. Hasura rejects the whole metadata apply when the variable is absent. Setting it unconditionally keeps metadata apply working even when an operator disables the service. Override it with components.semantic_search.environment.webhook_url.

Verified

This was run on the shared MicroK8s dev cluster on 2026-09-12, by hand, in the order above.

Check Result
Server PostgreSQL 16.9
pgvector 0.8.6
Restore of the PostgreSQL 10 dump complete; 599 standard variables, 76 tables
hasura migrate apply 5 pending migrations applied, now 31 total
GraphQL query 200
helm lint passes
helm template with both ci/ values files and tapis.test.values.yaml renders
helm template with semantic_search.enabled=false renders; the variable is still set

Two limits reviewers must know

  • ARM is not covered. mintproject/monorepo builds postgres-pgvector for linux/amd64 only. arm_image keeps imresamu/postgis-arm64:12-3.4-alpine, which has no pgvector. An ARM deployment still cannot apply the embedding migration.
  • The image tag is develop. There is no released tag for this image yet. semantic-search falls back to global.imageTag; confirm that ghcr.io/mintproject/semantic-search publishes the tag your deployment pins.

🤖 Generated with Claude Code

https://claude.ai/code/session_0162tbdGCuxbimJUmfCbz69q

mosoriob and others added 2 commits September 12, 2026 14:51
The Hasura database image had no pgvector, so migration
1771200021000_standard_variable_embeddings failed on every deployment:

  could not open extension control file
  "/usr/local/share/postgresql/extension/vector.control"

Point components.hasura_db.image at ghcr.io/mintproject/postgres-pgvector,
which carries PostGIS 3.5 and pgvector 0.8.6.

BREAKING CHANGE: the image is PostgreSQL 16. The previous default was
PostgreSQL 10. PostgreSQL 16 refuses to start on PostgreSQL 10 data files.
An existing deployment must dump, delete the PVC and restore. values.yaml
carries the steps.

Also add the semantic-search service. The metadata in mintproject/monorepo
declares nine event triggers with
webhook_from_env: SVO_SEMANTIC_SEARCH_WEBHOOK_URL. Hasura rejects the whole
metadata apply when that variable is absent, so the Hasura pod always sets
it, even when components.semantic_search.enabled is false.

ARM is not covered. mintproject/monorepo builds postgres-pgvector for
linux/amd64 only, so arm_image keeps the old PostGIS image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant