Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ jobs:
POSTGRESQL_IMAGE=$(cat Dockerfile | grep 'FROM ghcr.io/cloudnative-pg/postgresql:')
POSTGRESQL_FROM_TAG=$(echo $POSTGRESQL_IMAGE | cut -d':' -f2 | cut -d'@' -f1)
echo "postgresql=${POSTGRESQL_FROM_TAG}" >> "$GITHUB_OUTPUT"
VECTORCHORD_IMAGE=$(cat Dockerfile | grep 'FROM tensorchord/vchord-binary:')
VECTORCHORD_FROM_TAG=$(echo $VECTORCHORD_IMAGE | cut -d'-' -f3)
VECTORCHORD_IMAGE=$(cat Dockerfile | grep -m 1 'ARG VCHORD_VERSION')
VECTORCHORD_FROM_TAG=$(echo $VECTORCHORD_IMAGE | cut -d'=' -f2)
echo "vchord=${VECTORCHORD_FROM_TAG}" >> "$GITHUB_OUTPUT"

- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
Expand All @@ -82,3 +82,4 @@ jobs:
CI_COMMIT_SHA=${{ github.sha }}
CI_COMMIT_TAG=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.vchord }}-${{ needs.release.outputs.tag_name }}
CI_UPSTREAM_VERSION=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.vchord }}
VCHORD_VERSION=${{ steps.from_tag.outputs.vchord }}
5 changes: 3 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ jobs:
POSTGRESQL_IMAGE=$(cat Dockerfile | grep 'FROM ghcr.io/cloudnative-pg/postgresql:')
POSTGRESQL_FROM_TAG=$(echo $POSTGRESQL_IMAGE | cut -d':' -f2 | cut -d'@' -f1)
echo "postgresql=${POSTGRESQL_FROM_TAG}" >> "$GITHUB_OUTPUT"
VECTORCHORD_IMAGE=$(cat Dockerfile | grep 'FROM tensorchord/vchord-binary:')
VECTORCHORD_FROM_TAG=$(echo $VECTORCHORD_IMAGE | cut -d'-' -f3)
VECTORCHORD_IMAGE=$(cat Dockerfile | grep -m 1 'ARG VCHORD_VERSION')
VECTORCHORD_FROM_TAG=$(echo $VECTORCHORD_IMAGE | cut -d'=' -f2)
echo "vchord=${VECTORCHORD_FROM_TAG}" >> "$GITHUB_OUTPUT"

- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
Expand All @@ -86,3 +86,4 @@ jobs:
CI_COMMIT_SHA=${{ github.sha }}
CI_COMMIT_TAG=latest
CI_UPSTREAM_VERSION=${{ steps.from_tag.outputs.postgresql }}-${{ steps.from_tag.outputs.vchord }}
VCHORD_VERSION=${{ steps.from_tag.outputs.vchord }}
24 changes: 15 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,37 @@
ARG CI_COMMIT_SHA
ARG CI_COMMIT_TAG
ARG CI_UPSTREAM_VERSION

# vchord binary container
FROM tensorchord/vchord-binary:pg17-v0.4.3-${TARGETARCH} as vchord
ARG VCHORD_VERSION=0.4.3

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

ARG VCHORD_VERSION

LABEL org.opencontainers.image.authors="Daniel Muehlbachler-Pietrzykowski <daniel.muehlbachler@niftyside.com>"
LABEL org.opencontainers.image.vendor="Daniel Muehlbachler-Pietrzykowski"
LABEL org.opencontainers.image.source="https://github.com/muhlba91/postgresql-pgvecto-container"
LABEL org.opencontainers.image.created="${CI_COMMIT_TIMESTAMP}"

Check warning on line 15 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Container Image

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$CI_COMMIT_TIMESTAMP' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
LABEL org.opencontainers.image.title="cloudnativepg-postgresql-vchord"
LABEL org.opencontainers.image.title="cloudnativepg-postgresql-vectorchord"
LABEL org.opencontainers.image.description="A container integrating VectorChord into CloudNativePG PostgreSQL"
LABEL org.opencontainers.image.revision="${CI_COMMIT_SHA}"

Check warning on line 18 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Container Image

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$CI_COMMIT_SHA' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
LABEL org.opencontainers.image.version="${CI_COMMIT_TAG}"

Check warning on line 19 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Container Image

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$CI_COMMIT_TAG' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
LABEL org.opencontainers.image.upstream="${CI_UPSTREAM_VERSION}"

Check warning on line 20 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Container Image

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$CI_UPSTREAM_VERSION' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

# use root to install binaries
USER root

# taken from https://github.com/tensorchord/VectorChord/
COPY --from=vchord /workspace/postgresql-*.deb /tmp/vchord.deb
RUN apt-get install --yes --no-install-recommends /tmp/vchord.deb && rm -f /tmp/vchord.deb
# taken from: https://github.com/tensorchord/VectorChord-images
# hadolint ignore=DL3008,DL3015,SC2046
RUN apt-get update && \
apt-get install -y --no-install-recommends wget ca-certificates && \
wget -q https://github.com/tensorchord/VectorChord/releases/download/${VCHORD_VERSION}/postgresql-16-vchord_${VCHORD_VERSION}-1_$(dpkg --print-architecture).deb -P /tmp && \
apt-get install -y /tmp/postgresql-16-vchord_${VCHORD_VERSION}-1_$(dpkg --print-architecture).deb && \
apt-get remove -y wget ca-certificates && \
apt-get purge -y --auto-remove && \
rm -rf /tmp/* /var/lib/apt/lists/*

# set user back to postgres
USER 26

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