Skip to content

Commit a4f1aff

Browse files
committed
feat: integrate vectorchord for migration
BREAKING CHANGE: adds new extension vchord
1 parent a9b281d commit a4f1aff

File tree

4 files changed

+36
-20
lines changed

4 files changed

+36
-20
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ jobs:
6363
POSTGRESQL_IMAGE=$(cat Dockerfile | grep 'FROM ghcr.io/cloudnative-pg/postgresql:')
6464
POSTGRESQL_FROM_TAG=$(echo $POSTGRESQL_IMAGE | cut -d':' -f2 | cut -d'@' -f1)
6565
echo "postgresql=${POSTGRESQL_FROM_TAG}" >> "$GITHUB_OUTPUT"
66-
PGVECTO_IMAGE=$(cat Dockerfile | grep 'FROM tensorchord/pgvecto-rs-binary:')
67-
PGVECTO_FROM_TAG=$(echo $PGVECTO_IMAGE | cut -d'-' -f4)
68-
echo "pgvecto=${PGVECTO_FROM_TAG}" >> "$GITHUB_OUTPUT"
66+
VECTORCHORD_IMAGE=$(cat Dockerfile | grep 'FROM tensorchord/vchord-binary:')
67+
VECTORCHORD_FROM_TAG=$(echo $VECTORCHORD_IMAGE | cut -d'-' -f4)
68+
echo "vchord=${VECTORCHORD_FROM_TAG}" >> "$GITHUB_OUTPUT"
6969
7070
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
7171
with:
@@ -75,10 +75,10 @@ jobs:
7575
tags: |
7676
ghcr.io/muhlba91/postgresql-pgvecto:latest
7777
ghcr.io/muhlba91/postgresql-pgvecto:${{ github.sha }}
78-
ghcr.io/muhlba91/postgresql-pgvecto:${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.pgvecto }}
79-
ghcr.io/muhlba91/postgresql-pgvecto:${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.pgvecto }}-${{ needs.release.outputs.tag_name }}
78+
ghcr.io/muhlba91/postgresql-pgvecto:${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.vchord }}
79+
ghcr.io/muhlba91/postgresql-pgvecto:${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.vchord }}-${{ needs.release.outputs.tag_name }}
8080
build-args: |
8181
CI_COMMIT_TIMESTAMP=${{ github.event.repository.updated_at }}
8282
CI_COMMIT_SHA=${{ github.sha }}
83-
CI_COMMIT_TAG=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.pgvecto }}-${{ needs.release.outputs.tag_name }}
84-
CI_UPSTREAM_VERSION=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.pgvecto }}
83+
CI_COMMIT_TAG=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.vchord }}-${{ needs.release.outputs.tag_name }}
84+
CI_UPSTREAM_VERSION=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.vchord }}

.github/workflows/verify.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ jobs:
6969
POSTGRESQL_IMAGE=$(cat Dockerfile | grep 'FROM ghcr.io/cloudnative-pg/postgresql:')
7070
POSTGRESQL_FROM_TAG=$(echo $POSTGRESQL_IMAGE | cut -d':' -f2 | cut -d'@' -f1)
7171
echo "postgresql=${POSTGRESQL_FROM_TAG}" >> "$GITHUB_OUTPUT"
72-
PGVECTO_IMAGE=$(cat Dockerfile | grep 'FROM tensorchord/pgvecto-rs-binary:')
73-
PGVECTO_FROM_TAG=$(echo $PGVECTO_IMAGE | cut -d'-' -f4)
74-
echo "pgvecto=${PGVECTO_FROM_TAG}" >> "$GITHUB_OUTPUT"
72+
VECTORCHORD_IMAGE=$(cat Dockerfile | grep 'FROM tensorchord/vchord-binary:')
73+
VECTORCHORD_FROM_TAG=$(echo $VECTORCHORD_IMAGE | cut -d'-' -f4)
74+
echo "vchord=${VECTORCHORD_FROM_TAG}" >> "$GITHUB_OUTPUT"
7575
7676
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
7777
with:
@@ -85,4 +85,4 @@ jobs:
8585
CI_COMMIT_TIMESTAMP=${{ github.event.repository.updated_at }}
8686
CI_COMMIT_SHA=${{ github.sha }}
8787
CI_COMMIT_TAG=latest
88-
CI_UPSTREAM_VERSION=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.pgvecto }}
88+
CI_UPSTREAM_VERSION=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.vchord }}

Dockerfile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ ARG CI_COMMIT_TAG
44
ARG CI_UPSTREAM_VERSION
55

66
# pgvecto.rs binary container
7-
FROM tensorchord/pgvecto-rs-binary:pg16-v0.3.0-${TARGETARCH} as binary
7+
FROM tensorchord/pgvecto-rs-binary:pg16-v0.3.0-${TARGETARCH} as pgvectors
8+
9+
# vchord binary container
10+
FROM tensorchord/vchord-binary:pg16-v0.4.3-${TARGETARCH} as vchord
811

912
# main container
1013
FROM ghcr.io/cloudnative-pg/postgresql:16.8-14@sha256:ed9bd4a26b152cf35f2c64e15f48126e3477ad222cfb04794562bdc999b8f0be
@@ -13,16 +16,24 @@ LABEL org.opencontainers.image.authors="Daniel Muehlbachler-Pietrzykowski <danie
1316
LABEL org.opencontainers.image.vendor="Daniel Muehlbachler-Pietrzykowski"
1417
LABEL org.opencontainers.image.source="https://github.com/muhlba91/postgresql-pgvecto-container"
1518
LABEL org.opencontainers.image.created="${CI_COMMIT_TIMESTAMP}"
16-
LABEL org.opencontainers.image.title="postgresql-pgvecto"
17-
LABEL org.opencontainers.image.description="A container integrating pgvecto.rs into CloudNativePG PostgreSQL"
19+
LABEL org.opencontainers.image.title="cloudnativepg-postgresql-vchord"
20+
LABEL org.opencontainers.image.description="A container integrating VectorChord into CloudNativePG PostgreSQL"
1821
LABEL org.opencontainers.image.revision="${CI_COMMIT_SHA}"
1922
LABEL org.opencontainers.image.version="${CI_COMMIT_TAG}"
2023
LABEL org.opencontainers.image.upstream="${CI_UPSTREAM_VERSION}"
2124

25+
# use root to install binaries
2226
USER root
27+
2328
# taken from https://github.com/tensorchord/pgvecto.rs/
24-
COPY --from=binary /pgvecto-rs-binary-release.deb /tmp/vectors.deb
29+
COPY --from=pgvectors /pgvecto-rs-binary-release.deb /tmp/vectors.deb
2530
RUN apt-get install --yes --no-install-recommends /tmp/vectors.deb && rm -f /tmp/vectors.deb
31+
32+
# taken from https://github.com/tensorchord/VectorChord/
33+
COPY --from=vchord /workspace/postgresql-*.deb /tmp/vchord.deb
34+
RUN apt-get install --yes --no-install-recommends /tmp/vchord.deb && rm -f /tmp/vchord.deb
35+
36+
# set user back to postgres
2637
USER 26
2738

28-
CMD ["postgres", "-c" ,"shared_preload_libraries=vectors.so", "-c", "search_path=\"$user\", public, vectors", "-c", "logging_collector=on"]
39+
CMD ["postgres", "-c" ,"shared_preload_libraries=vchord.so,vectors.so", "-c", "search_path=\"$user\", public, vectors", "-c", "logging_collector=on"]

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PostgreSQL with pgvecto.rs Container
1+
# PostgreSQL with VectorChord Container
22

33
[![](https://img.shields.io/github/license/muhlba91/postgresql-pgvecto-container?style=for-the-badge)](LICENSE)
44
[![](https://img.shields.io/github/actions/workflow/status/muhlba91/postgresql-pgvecto-container/release.yml?style=for-the-badge)](https://github.com/muhlba91/postgresql-pgvecto-container/actions/workflows/release.yml)
@@ -7,7 +7,7 @@
77
[![](https://img.shields.io/github/release-date/muhlba91/postgresql-pgvecto-container?style=for-the-badge)](https://github.com/muhlba91/postgresql-pgvecto-container/releases)
88
<a href="https://www.buymeacoffee.com/muhlba91" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="28" width="150"></a>
99

10-
A container integrating [pgvecto.rs](https://github.com/tensorchord/pgvecto.rs) into [CloudNativePG's PostgreSQL container](https://github.com/cloudnative-pg/postgres-containers).
10+
A container integrating [VectorChord](https://github.com/tensorchord/VectorChord) into [CloudNativePG's PostgreSQL container](https://github.com/cloudnative-pg/postgres-containers).
1111

1212
---
1313

@@ -16,6 +16,11 @@ A container integrating [pgvecto.rs](https://github.com/tensorchord/pgvecto.rs)
1616
>
1717
> The chosen upstream versions follow the [Immich requirements](https://github.com/immich-app/immich/blob/main/docker/docker-compose.yml).
1818
19+
> [!WARNING]
20+
> **This container is being migrated from pgvecto.rs to VectorChord!**
21+
>
22+
> Immich is migrating to VectorChord and, hence, this container will transition to only including VectorChord in upcoming releases.
23+
1924
---
2025

2126
## Installation Notes
@@ -27,10 +32,10 @@ Instead of using the upstream [CloudNativePG container](https://github.com/cloud
2732
The container images are tagged according to CloudNativePG's [image tag requirements](https://cloudnative-pg.io/documentation/1.23/container_images/#image-tag-requirements_1).
2833
Additionally, `latest` and `<GIT_COMMIT_SHA>` tags are created which are **not** compatible with CloudNativePG!
2934

30-
The tagging scheme is `<CLOUDNATIVEPG_POSTGRESQL_TAG>-<PGVECTO_TAG>[-<RELEASE_TAG>]` with:
35+
The tagging scheme is `<CLOUDNATIVEPG_POSTGRESQL_TAG>-<VECTORCHORD_TAG>[-<RELEASE_TAG>]` with:
3136

3237
- `<CLOUDNATIVEPG_POSTGRESQL_TAG>`: the upstream [CloudNativePG container](https://github.com/cloudnative-pg/postgres-containers/pkgs/container/postgresql) version
33-
- `<PGVECTO_TAG>`: the [pgvecto.rs](https://github.com/tensorchord/pgvecto.rs/releases) version
38+
- `<VECTORCHORD_TAG>`: the [VectorChord](https://github.com/tensorchord/VectorChord/releases) version
3439
- `<RELEASE_TAG>`: the release version of this container (used to version internal changes; optional to specify)
3540

3641
---

0 commit comments

Comments
 (0)