Skip to content

Commit 8de3a73

Browse files
committed
feat: download vchord from github releases
BREAKING CHANGE: revert to postgres 16.8
1 parent c5b2670 commit 8de3a73

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ 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-
VECTORCHORD_IMAGE=$(cat Dockerfile | grep 'FROM tensorchord/vchord-binary:')
67-
VECTORCHORD_FROM_TAG=$(echo $VECTORCHORD_IMAGE | cut -d'-' -f3)
66+
VECTORCHORD_IMAGE=$(cat Dockerfile | grep 'ARG VCHORD_VERSION=')
67+
VECTORCHORD_FROM_TAG=$(echo $VECTORCHORD_IMAGE | cut -d'=' -f2)
6868
echo "vchord=${VECTORCHORD_FROM_TAG}" >> "$GITHUB_OUTPUT"
6969
7070
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
@@ -82,3 +82,4 @@ jobs:
8282
CI_COMMIT_SHA=${{ github.sha }}
8383
CI_COMMIT_TAG=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.vchord }}-${{ needs.release.outputs.tag_name }}
8484
CI_UPSTREAM_VERSION=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.vchord }}
85+
VCHORD_VERSION=${{ steps.from_tag.outputs.vchord }}

.github/workflows/verify.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ 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-
VECTORCHORD_IMAGE=$(cat Dockerfile | grep 'FROM tensorchord/vchord-binary:')
73-
VECTORCHORD_FROM_TAG=$(echo $VECTORCHORD_IMAGE | cut -d'-' -f3)
72+
VECTORCHORD_IMAGE=$(cat Dockerfile | grep 'ARG VCHORD_VERSION=')
73+
VECTORCHORD_FROM_TAG=$(echo $VECTORCHORD_IMAGE | cut -d'=' -f2)
7474
echo "vchord=${VECTORCHORD_FROM_TAG}" >> "$GITHUB_OUTPUT"
7575
7676
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
@@ -86,3 +86,4 @@ jobs:
8686
CI_COMMIT_SHA=${{ github.sha }}
8787
CI_COMMIT_TAG=latest
8888
CI_UPSTREAM_VERSION=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.vchord }}
89+
VCHORD_VERSION=${{ steps.from_tag.outputs.vchord }}

Dockerfile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@ ARG CI_COMMIT_TIMESTAMP
22
ARG CI_COMMIT_SHA
33
ARG CI_COMMIT_TAG
44
ARG CI_UPSTREAM_VERSION
5-
6-
# vchord binary container
7-
FROM tensorchord/vchord-binary:pg17-v0.4.3-${TARGETARCH} as vchord
5+
ARG VCHORD_VERSION=0.4.3
86

97
# main container
10-
FROM ghcr.io/cloudnative-pg/postgresql:17.5-7@sha256:ce4f594010149f48592359ddd87fb0ba8a99cbc871965d2aaa770d025c5c6025
8+
FROM ghcr.io/cloudnative-pg/postgresql:16.8-14@sha256:ed9bd4a26b152cf35f2c64e15f48126e3477ad222cfb04794562bdc999b8f0be
119

1210
LABEL org.opencontainers.image.authors="Daniel Muehlbachler-Pietrzykowski <daniel.muehlbachler@niftyside.com>"
1311
LABEL org.opencontainers.image.vendor="Daniel Muehlbachler-Pietrzykowski"
1412
LABEL org.opencontainers.image.source="https://github.com/muhlba91/postgresql-pgvecto-container"
1513
LABEL org.opencontainers.image.created="${CI_COMMIT_TIMESTAMP}"
16-
LABEL org.opencontainers.image.title="cloudnativepg-postgresql-vchord"
14+
LABEL org.opencontainers.image.title="cloudnativepg-postgresql-vectorchord"
1715
LABEL org.opencontainers.image.description="A container integrating VectorChord into CloudNativePG PostgreSQL"
1816
LABEL org.opencontainers.image.revision="${CI_COMMIT_SHA}"
1917
LABEL org.opencontainers.image.version="${CI_COMMIT_TAG}"
@@ -22,11 +20,16 @@ LABEL org.opencontainers.image.upstream="${CI_UPSTREAM_VERSION}"
2220
# use root to install binaries
2321
USER root
2422

25-
# taken from https://github.com/tensorchord/VectorChord/
26-
COPY --from=vchord /workspace/postgresql-*.deb /tmp/vchord.deb
27-
RUN apt-get install --yes --no-install-recommends /tmp/vchord.deb && rm -f /tmp/vchord.deb
23+
# taken from: https://github.com/tensorchord/VectorChord-images
24+
RUN apt-get update && \
25+
apt-get install -y --no-install-recommends wget ca-certificates && \
26+
wget https://github.com/tensorchord/VectorChord/releases/download/${VCHORD_VERSION}/postgresql-16-vchord_${VCHORD_VERSION}-1_$(dpkg --print-architecture).deb -P /tmp && \
27+
apt-get install -y /tmp/postgresql-16-vchord_${VCHORD_VERSION}-1_$(dpkg --print-architecture).deb && \
28+
apt-get remove -y wget ca-certificates && \
29+
apt-get purge -y --auto-remove && \
30+
rm -rf /tmp/* /var/lib/apt/lists/*
2831

2932
# set user back to postgres
3033
USER 26
3134

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

0 commit comments

Comments
 (0)