Skip to content

Commit 4758eac

Browse files
committed
add pgvector-postgis and others version
1 parent 9e555dd commit 4758eac

File tree

7 files changed

+95
-45
lines changed

7 files changed

+95
-45
lines changed

.github/workflows/docker.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ on:
2727
- pgvector
2828
- node-sqitch
2929
- postgis
30+
- pgvector-postgis
3031
default: pgvector
3132
version:
3233
description: 'Specific version to build (must exist in version.yaml)'
@@ -52,7 +53,7 @@ jobs:
5253

5354
strategy:
5455
matrix:
55-
process: [pgvector, node-sqitch, postgis]
56+
process: [pgvector, node-sqitch, postgis, pgvector-postgis]
5657
max-parallel: 3
5758

5859
env:

docker/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PLATFORMS?=linux/arm64
88
PROCESS?=pgvector
99

1010
# Convenience: list of known processes
11-
PROCESSES:=pgvector node-sqitch postgis
11+
PROCESSES:=pgvector node-sqitch postgis pgvector-postgis
1212

1313
CONTAINER_NAME?=$(PROCESS)
1414

@@ -87,5 +87,7 @@ node-sqitch:
8787
$(MAKE) PROCESS=node-sqitch build-process
8888

8989
postgis:
90-
$(MAKE) PROCESS=postgis build-process
90+
$(MAKE) PROCESS=postgis build-process
9191

92+
pgvector-postgis:
93+
$(MAKE) PROCESS=pgvector-postgis build-process

docker/pgvector-postgis/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
ARG BASE=postgres
2+
ARG BASE_VERSION=14
3+
FROM ${BASE}:${BASE_VERSION}
4+
5+
LABEL org.opencontainers.image.source="https://github.com/launchql/launchql"
6+
ARG BASE
7+
ARG BASE_VERSION
8+
ENV BASE_VERSION=${BASE_VERSION}
9+
10+
# Debian-based: install both pgvector and postgis from PGDG per-PG-major
11+
RUN set -eux; \
12+
export DEBIAN_FRONTEND=noninteractive; \
13+
apt-get update; \
14+
apt-get install -y --no-install-recommends ca-certificates curl gnupg dirmngr; \
15+
update-ca-certificates || true; \
16+
CODENAME=$(. /etc/os-release && echo "$VERSION_CODENAME"); \
17+
install -d -m 0755 /usr/share/keyrings; \
18+
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgresql.gpg; \
19+
echo "deb [signed-by=/usr/share/keyrings/postgresql.gpg] https://apt.postgresql.org/pub/repos/apt ${CODENAME}-pgdg main" > /etc/apt/sources.list.d/pgdg.list; \
20+
apt-get update; \
21+
PG_MAJOR=$(pg_config --version | sed 's/^PostgreSQL \([0-9]\+\).*/\1/'); \
22+
apt-get install -y --no-install-recommends \
23+
postgresql-${PG_MAJOR}-postgis-3 \
24+
postgresql-${PG_MAJOR}-postgis-3-scripts \
25+
postgis \
26+
postgresql-${PG_MAJOR}-pgvector \
27+
make \
28+
bash; \
29+
rm -rf /var/lib/apt/lists/*
30+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
base: postgres
2+
versions:
3+
- 14.19
4+
- 15.14
5+
- 16.10
6+
- 17.6
7+
- 18.0
8+

docker/pgvector/Dockerfile

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,26 @@
11
ARG BASE=postgres
2-
ARG BASE_VERSION=13.3-alpine
2+
ARG BASE_VERSION=14
33
FROM ${BASE}:${BASE_VERSION}
44

55
LABEL org.opencontainers.image.source="https://github.com/launchql/launchql"
66
ARG BASE
77
ARG BASE_VERSION
8-
ARG PGVECTOR_REF="v0.8.1"
98
ENV BASE_VERSION=${BASE_VERSION}
10-
ENV PGVECTOR_REF=${PGVECTOR_REF}
119

12-
# Install PGVector extension with LLVM bitcode enabled.
13-
# - Detect OS (Alpine vs Debian) and install matching LLVM/clang per pg_config
10+
# Debian-based install: use PGDG per-PG-major package
1411
RUN set -eux; \
15-
: "${BASE_VERSION:?BASE_VERSION not set}"; \
16-
if [ -f /etc/alpine-release ]; then \
17-
apk add --no-cache --virtual .build-deps git build-base bash make curl ca-certificates; \
18-
LLVM_CFG=$(pg_config --configure | tr ' ' '\n' | sed -n 's/^LLVM_CONFIG=\(.*\)$/\1/p' | tr -d '\"\'\'' ); \
19-
[ -n "${LLVM_CFG}" ] || { echo "Server not built with LLVM (LLVM_CONFIG missing)" >&2; exit 1; }; \
20-
LLVM_VER=$(echo "${LLVM_CFG}" | sed -E 's#.*/llvm-?([0-9]+)/.*#\1#'); \
21-
[ -n "${LLVM_VER}" ] || { echo "Could not determine LLVM version from: ${LLVM_CFG}" >&2; exit 1; }; \
22-
apk add --no-cache --virtual .clang \
23-
"clang${LLVM_VER}" \
24-
"llvm${LLVM_VER}" \
25-
"llvm${LLVM_VER}-libs" \
26-
"llvm${LLVM_VER}-linker-tools"; \
27-
git clone --quiet --depth 1 --branch "${PGVECTOR_REF}" https://github.com/pgvector/pgvector.git; \
28-
cd pgvector && make && make install; \
29-
cd .. && rm -rf pgvector; \
30-
apk del .clang .build-deps; \
31-
else \
32-
export DEBIAN_FRONTEND=noninteractive; \
33-
apt-get update; \
34-
apt-get install -y --no-install-recommends ca-certificates curl gnupg build-essential git make; \
35-
LLVM_CFG=$(pg_config --configure | tr ' ' '\n' | sed -n 's/^LLVM_CONFIG=\(.*\)$/\1/p' | tr -d '\"\'\'' ); \
36-
[ -n "${LLVM_CFG}" ] || { echo "Server not built with LLVM (LLVM_CONFIG missing)" >&2; exit 1; }; \
37-
LLVM_VER=$(echo "${LLVM_CFG}" | sed -E 's#.*/llvm-?([0-9]+)/.*#\1#'); \
38-
[ -n "${LLVM_VER}" ] || { echo "Could not determine LLVM version from: ${LLVM_CFG}" >&2; exit 1; }; \
39-
apt-get install -y --no-install-recommends "llvm-${LLVM_VER}" "clang-${LLVM_VER}"; \
40-
git clone --quiet --depth 1 --branch "${PGVECTOR_REF}" https://github.com/pgvector/pgvector.git; \
41-
cd pgvector && make && make install; \
42-
cd .. && rm -rf pgvector; \
43-
apt-get purge -y --auto-remove build-essential git make curl gnupg "llvm-${LLVM_VER}" "clang-${LLVM_VER}"; \
44-
rm -rf /var/lib/apt/lists/*; \
45-
fi
12+
export DEBIAN_FRONTEND=noninteractive; \
13+
apt-get update; \
14+
apt-get install -y --no-install-recommends ca-certificates curl gnupg dirmngr; \
15+
update-ca-certificates || true; \
16+
CODENAME=$(. /etc/os-release && echo "$VERSION_CODENAME"); \
17+
install -d -m 0755 /usr/share/keyrings; \
18+
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgresql.gpg; \
19+
echo "deb [signed-by=/usr/share/keyrings/postgresql.gpg] https://apt.postgresql.org/pub/repos/apt ${CODENAME}-pgdg main" > /etc/apt/sources.list.d/pgdg.list; \
20+
apt-get update; \
21+
PG_MAJOR=$(pg_config --version | sed 's/^PostgreSQL \([0-9]\+\).*/\1/'); \
22+
apt-get install -y --no-install-recommends \
23+
postgresql-${PG_MAJOR}-pgvector \
24+
make \
25+
bash; \
26+
rm -rf /var/lib/apt/lists/*

docker/pgvector/Dockerfile.alpine

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ARG BASE=postgres
2+
ARG BASE_VERSION=13.3-alpine
3+
FROM ${BASE}:${BASE_VERSION}
4+
5+
LABEL org.opencontainers.image.source="https://github.com/launchql/launchql"
6+
ARG BASE
7+
ARG BASE_VERSION
8+
ARG PGVECTOR_REF="v0.8.1"
9+
ENV BASE_VERSION=${BASE_VERSION}
10+
ENV PGVECTOR_REF=${PGVECTOR_REF}
11+
12+
# Alpine build (kept as a backup variant)
13+
RUN set -eux; \
14+
: "${BASE_VERSION:?BASE_VERSION not set}"; \
15+
apk add --no-cache --virtual .build-deps git build-base bash make curl ca-certificates; \
16+
LLVM_CFG=$(pg_config --configure | tr ' ' '\n' | sed -n 's/^LLVM_CONFIG=\(.*\)$/\1/p' | tr -d '\"\'\'' ); \
17+
[ -n "${LLVM_CFG}" ] || { echo "Server not built with LLVM (LLVM_CONFIG missing)" >&2; exit 1; }; \
18+
LLVM_VER=$(echo "${LLVM_CFG}" | sed -E 's#.*/llvm-?([0-9]+)/.*#\1#'); \
19+
[ -n "${LLVM_VER}" ] || { echo "Could not determine LLVM version from: ${LLVM_CFG}" >&2; exit 1; }; \
20+
apk add --no-cache --virtual .clang \
21+
"clang${LLVM_VER}" \
22+
"llvm${LLVM_VER}" \
23+
"llvm${LLVM_VER}-libs" \
24+
"llvm${LLVM_VER}-linker-tools"; \
25+
git clone --quiet --depth 1 --branch "${PGVECTOR_REF}" https://github.com/pgvector/pgvector.git; \
26+
cd pgvector && make && make install; \
27+
cd .. && rm -rf pgvector; \
28+
apk del .clang .build-deps
29+

docker/pgvector/version.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
base: postgres
22
versions:
3-
- 13.3-alpine
4-
- 14.19-alpine
5-
- 15.14-alpine
6-
- 16.10-alpine
7-
- 17.6-alpine
8-
- 18.0-alpine
3+
- 14.19
4+
- 15.14
5+
- 16.10
6+
- 17.6
7+
- 18.0

0 commit comments

Comments
 (0)