Skip to content

Commit 7d5e4b8

Browse files
Upgrade to Postgres 18.3, AGE PG18 and pgvector v0.8.2
1 parent 87808a9 commit 7d5e4b8

File tree

5 files changed

+44
-30
lines changed

5 files changed

+44
-30
lines changed

.github/workflows/ci-multiarch.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: ci-multiarch
22

33
on:
44
pull_request:
5+
workflow_dispatch:
56
push:
67
branches:
78
- "**"
@@ -38,6 +39,7 @@ jobs:
3839
- name: Build image
3940
run: |
4041
docker buildx build \
42+
--pull \
4143
--platform "${{ matrix.platform }}" \
4244
--tag "pg4ai:test-${{ matrix.arch }}" \
4345
--load \
@@ -102,6 +104,7 @@ jobs:
102104
context: .
103105
file: ./Dockerfile
104106
platforms: linux/amd64,linux/arm64
107+
pull: true
105108
push: true
106109
tags: ${{ steps.meta.outputs.tags }}
107110
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# syntax=docker/dockerfile:1.7
22

3-
FROM postgres:16 AS builder
3+
FROM postgres:18.3 AS builder
44

5-
ARG AGE_VERSION=PG16/v1.5.0-rc0
6-
ARG PGVECTOR_VERSION=v0.7.0
7-
ARG PG_CONFIG=/usr/lib/postgresql/16/bin/pg_config
5+
ARG AGE_VERSION=PG18/v1.7.0-rc0
6+
ARG PGVECTOR_VERSION=v0.8.2
7+
ARG PG_CONFIG=/usr/lib/postgresql/18/bin/pg_config
88

99
RUN apt-get update && apt-get install -y --no-install-recommends \
1010
build-essential \
11-
postgresql-server-dev-16 \
11+
postgresql-server-dev-18 \
1212
bison \
1313
flex \
1414
git \
@@ -30,13 +30,13 @@ RUN git clone https://github.com/pgvector/pgvector.git && \
3030
make PG_CONFIG="${PG_CONFIG}" OPTFLAGS="" && \
3131
make PG_CONFIG="${PG_CONFIG}" OPTFLAGS="" install DESTDIR=/tmp/install-pgvector
3232

33-
FROM postgres:16 AS final
33+
FROM postgres:18.3 AS final
3434

35-
COPY --from=builder /tmp/install-age/usr/lib/postgresql/16/lib/age.so /usr/lib/postgresql/16/lib/
36-
COPY --from=builder /tmp/install-age/usr/share/postgresql/16/extension/age* /usr/share/postgresql/16/extension/
35+
COPY --from=builder /tmp/install-age/usr/lib/postgresql/18/lib/age.so /usr/lib/postgresql/18/lib/
36+
COPY --from=builder /tmp/install-age/usr/share/postgresql/18/extension/age* /usr/share/postgresql/18/extension/
3737

38-
COPY --from=builder /tmp/install-pgvector/usr/lib/postgresql/16/lib/vector.so /usr/lib/postgresql/16/lib/
39-
COPY --from=builder /tmp/install-pgvector/usr/share/postgresql/16/extension/vector* /usr/share/postgresql/16/extension/
38+
COPY --from=builder /tmp/install-pgvector/usr/lib/postgresql/18/lib/vector.so /usr/lib/postgresql/18/lib/
39+
COPY --from=builder /tmp/install-pgvector/usr/share/postgresql/18/extension/vector* /usr/share/postgresql/18/extension/
4040

4141
COPY docker/init/01-extensions.sql /docker-entrypoint-initdb.d/01-extensions.sql
4242

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# pg4ai: PostgreSQL 16 + Apache AGE + pgvector
1+
# pg4ai: PostgreSQL 18.3 + Apache AGE + pgvector
22

3-
Multi-Arch Docker Image (`linux/amd64`, `linux/arm64`) auf Basis von `postgres:16` mit:
3+
Multi-Arch Docker Image (`linux/amd64`, `linux/arm64`) auf Basis von `postgres:18.3` mit:
44

5-
- Apache AGE `PG16/v1.5.0-rc0` (Upstream-Tag fuer PG16)
6-
- pgvector `v0.7.0`
5+
- Apache AGE `PG18/v1.7.0-rc0` (Upstream-Tag fuer PG18)
6+
- pgvector `v0.8.2`
77

88
Die Extensions werden beim ersten DB-Start automatisch via Init-Skript aktiviert.
99

prompt.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ Bereitstellung eines produktionsreifen Docker-Images, das die Graph-Datenbank-Fu
88

99
### 2.1 Basis-Komponenten
1010

11-
* **Base Image:** `postgres:16` (Debian-basiert für maximale Kompatibilität beim Kompilieren).
12-
* **Apache AGE:** Version `v1.5.0` (kompatibel mit PG16).
13-
* **pgvector:** Version `v0.7.0` oder aktuellster Stable-Release.
11+
* **Base Image:** `postgres:18.3` (Debian-basiert für maximale Kompatibilität beim Kompilieren).
12+
* **Apache AGE:** Version `PG18/v1.7.0-rc0` (kompatibel mit PG18).
13+
* **pgvector:** Version `v0.8.2` (aktueller Stable-Release).
1414

1515
### 2.2 Build-Anforderungen
1616

17-
* **Multi-Stage Build:** * *Stage 1 (Builder):* Installation von `build-essential`, `postgresql-server-dev-16`, `bison`, `flex`, `git`. Kompilierung beider Extensions.
18-
* *Stage 2 (Final):* Kopieren der `.so` Dateien und Control-Files in ein sauberes `postgres:16` Image, um die Image-Größe minimal zu halten (~250MB statt >800MB).
17+
* **Multi-Stage Build:** * *Stage 1 (Builder):* Installation von `build-essential`, `postgresql-server-dev-18`, `bison`, `flex`, `git`. Kompilierung beider Extensions.
18+
* *Stage 2 (Final):* Kopieren der `.so` Dateien und Control-Files in ein sauberes `postgres:18.3` Image, um die Image-Größe minimal zu halten (~250MB statt >800MB).
1919

2020

2121
* **Architektur-Support:** Volle Unterstützung für `linux/amd64` und `linux/arm64` via Docker Buildx.
@@ -53,4 +53,3 @@ Nach dem Start des Containers müssen folgende Befehle erfolgreich sein:
5353
* **Registry:** Ziel ist ein Public Repository (z.B. GitHub Packages oder Docker Hub).
5454
* **CI/CD:** GitHub Action Workflow zur automatischen Erstellung bei Änderungen am Dockerfile.
5555

56-

scripts/smoke-test.sh

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,27 @@ elif [[ -n "${EXPECT_ARCH}" ]]; then
2828
run_args+=(--platform "linux/${EXPECT_ARCH}")
2929
fi
3030

31-
if ! docker run -d \
32-
"${run_args[@]}" \
33-
--name "${CONTAINER_NAME}" \
34-
-e POSTGRES_USER="${POSTGRES_USER}" \
35-
-e POSTGRES_PASSWORD="${POSTGRES_PASSWORD}" \
36-
-e POSTGRES_DB="${POSTGRES_DB}" \
37-
"${IMAGE_REF}" >/dev/null; then
38-
echo "Container failed to start."
39-
exit 10
31+
if (( ${#run_args[@]} > 0 )); then
32+
if ! docker run -d \
33+
"${run_args[@]}" \
34+
--name "${CONTAINER_NAME}" \
35+
-e POSTGRES_USER="${POSTGRES_USER}" \
36+
-e POSTGRES_PASSWORD="${POSTGRES_PASSWORD}" \
37+
-e POSTGRES_DB="${POSTGRES_DB}" \
38+
"${IMAGE_REF}" >/dev/null; then
39+
echo "Container failed to start."
40+
exit 10
41+
fi
42+
else
43+
if ! docker run -d \
44+
--name "${CONTAINER_NAME}" \
45+
-e POSTGRES_USER="${POSTGRES_USER}" \
46+
-e POSTGRES_PASSWORD="${POSTGRES_PASSWORD}" \
47+
-e POSTGRES_DB="${POSTGRES_DB}" \
48+
"${IMAGE_REF}" >/dev/null; then
49+
echo "Container failed to start."
50+
exit 10
51+
fi
4052
fi
4153

4254
elapsed=0
@@ -75,7 +87,7 @@ fi
7587
echo "Running Apache AGE graph check ..."
7688
if ! docker exec -e PGPASSWORD="${POSTGRES_PASSWORD}" "${CONTAINER_NAME}" \
7789
psql -v ON_ERROR_STOP=1 -U "${POSTGRES_USER}" -d "${POSTGRES_DB}" \
78-
-c "SELECT * FROM ag_catalog.create_graph('my_graph');" >/dev/null; then
90+
-c "LOAD 'age'; SET search_path = ag_catalog, \"\$user\", public; SELECT * FROM ag_catalog.create_graph('my_graph');" >/dev/null; then
7991
echo "AGE SQL check failed."
8092
docker logs "${CONTAINER_NAME}" || true
8193
exit 30

0 commit comments

Comments
 (0)