Skip to content

Commit 1c6ef9f

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

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-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 -m 1 '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 -m 1 '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: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ 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
9+
10+
ARG VCHORD_VERSION
1111

1212
LABEL org.opencontainers.image.authors="Daniel Muehlbachler-Pietrzykowski <daniel.muehlbachler@niftyside.com>"
1313
LABEL org.opencontainers.image.vendor="Daniel Muehlbachler-Pietrzykowski"
1414
LABEL org.opencontainers.image.source="https://github.com/muhlba91/postgresql-pgvecto-container"
1515
LABEL org.opencontainers.image.created="${CI_COMMIT_TIMESTAMP}"
16-
LABEL org.opencontainers.image.title="cloudnativepg-postgresql-vchord"
16+
LABEL org.opencontainers.image.title="cloudnativepg-postgresql-vectorchord"
1717
LABEL org.opencontainers.image.description="A container integrating VectorChord into CloudNativePG PostgreSQL"
1818
LABEL org.opencontainers.image.revision="${CI_COMMIT_SHA}"
1919
LABEL org.opencontainers.image.version="${CI_COMMIT_TAG}"
@@ -22,11 +22,17 @@ LABEL org.opencontainers.image.upstream="${CI_UPSTREAM_VERSION}"
2222
# use root to install binaries
2323
USER root
2424

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
25+
# taken from: https://github.com/tensorchord/VectorChord-images
26+
# hadolint ignore=DL3008,DL3015,SC2046
27+
RUN apt-get update && \
28+
apt-get install -y --no-install-recommends wget ca-certificates && \
29+
wget -q https://github.com/tensorchord/VectorChord/releases/download/${VCHORD_VERSION}/postgresql-16-vchord_${VCHORD_VERSION}-1_$(dpkg --print-architecture).deb -P /tmp && \
30+
apt-get install -y /tmp/postgresql-16-vchord_${VCHORD_VERSION}-1_$(dpkg --print-architecture).deb && \
31+
apt-get remove -y wget ca-certificates && \
32+
apt-get purge -y --auto-remove && \
33+
rm -rf /tmp/* /var/lib/apt/lists/*
2834

2935
# set user back to postgres
3036
USER 26
3137

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

0 commit comments

Comments
 (0)