Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to Bitnami Based Postgres Image #61

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,41 @@ on:
- main

jobs:
# As the pgvecto-rs module is needed in the Immich Postgres, a custom Bitnami Image Build is implemented.
build-postgres:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/pg-bitnami-vecto-rs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v1
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v2
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Get bitnami tag
run: cd ./images/pgvecto-bitnami && ./bitnami-tag.sh >> $GITHUB_ENV
- name: Build and Push Versioned Docker Image
id: build-and-push
uses: docker/build-push-action@v2
with:
push: true
file: ./images/pgvecto-bitnami/Dockerfile
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BITNAMI_TAG }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BITNAMI_TAG=${{ env.BITNAMI_TAG }}
release:
needs: build-postgres
permissions: write-all
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 3 additions & 2 deletions charts/immich/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ immich:
postgresql:
enabled: false
image:
repository: tensorchord/pgvecto-rs
tag: pg14-v0.1.11
registry: ghcr.io
repository: immich-app/immich-charts/pg-bitnami-vecto-rs
tag: 14.5.0-debian-11-r6
global:
postgresql:
auth:
Expand Down
13 changes: 13 additions & 0 deletions images/pgvecto-bitnami/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ARG PGVECTORS_TAG=pg14-v0.1.11-amd64
ARG BITNAMI_TAG
FROM scratch as nothing
FROM tensorchord/pgvecto-rs-binary:${PGVECTORS_TAG} as binary

FROM docker.io/bitnami/postgresql:${BITNAMI_TAG}
COPY --from=binary /pgvecto-rs-binary-release.deb /tmp/vectors.deb
USER root
RUN apt-get install -y /tmp/vectors.deb && rm -f /tmp/vectors.deb && \
mv /usr/lib/postgresql/*/lib/vectors.so /opt/bitnami/postgresql/lib/ && \
mv usr/share/postgresql/*/extension/vectors* opt/bitnami/postgresql/share/extension/
USER 1001
ENV POSTGRESQL_EXTRA_FLAGS="-c shared_preload_libraries=vectors.so"
11 changes: 11 additions & 0 deletions images/pgvecto-bitnami/bitnami-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
## This Script is intended to get Version Names from the Helm Chart to Build
## a new Bitnami Image based of pgvector.rs

# Get yq
[ -f ./yq_linux_amd64 ] || curl -L https://github.com/mikefarah/yq/releases/download/v4.40.5/yq_linux_amd64 > yq_linux_amd64
chmod +x yq_linux_amd64

# Export Vars
export BITNAMI_TAG=$(./yq_linux_amd64 '.postgresql.image.tag' ../../charts/immich/values.yaml)
echo BITNAMI_TAG=$BITNAMI_TAG