Skip to content

Commit 47774ae

Browse files
authored
Merge pull request #64 from cybertec-postgresql/pg_vector
Pg vector
2 parents a29a46e + 6a8bd35 commit 47774ae

File tree

10 files changed

+95
-83
lines changed

10 files changed

+95
-83
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ docker/postgres-oracle
44
docker/newpg
55
docker/benchmark
66
docker/pgbackrest-old
7+
setup/helm/pgcluster
78

89
#FerretDB
910
docker/ferretdb
@@ -16,4 +17,7 @@ launcher/exporter_v2
1617

1718
# logical backup
1819
docker/logical_backup/
19-
scripts/logical_backup/
20+
scripts/logical_backup/
21+
22+
# grid-files
23+
/docker/add-grid-files/grid-files/*

Makefile

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ BASEOS ?= rocky9
55
CONTAINERIMAGE ?= rockylinux/rockylinux:9-ubi-micro
66
IMAGE_REPOSITORY ?= docker.io
77
IMAGE_PATH ?= cybertec-pg-container
8-
CONTAINERSUITE ?= cybertec-pg-container
98
PGVERSION ?= 17
10-
PGVERSION_FULL ?= 17.0
9+
PGVERSION_FULL ?= 17.4
1110
OLD_PG_VERSIONS ?= 13 14 15 16
12-
PATRONI_VERSION ?= multisite-4.0.2.1
13-
PGBACKREST_VERSION ?= 2.53
14-
POSTGIS_VERSION ?= 34
15-
ETCD_VERSION ?= 3.5.15
11+
PATRONI_VERSION ?= multisite-4.0.5.1
12+
PGBACKREST_VERSION ?= 2.54.2
13+
POSTGIS_VERSION ?= 35
14+
ETCD_VERSION ?= 3.5.21
15+
PGBOUNCER_VERSION ?= 1.24
1616
PACKAGER ?= dnf
17-
BUILD ?= 2
17+
BUILD ?= 1
1818
ARCH ?= amd64
1919
IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(BUILD)
2020
POSTGIS_IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(POSTGIS_VERSION)-$(BUILD)
@@ -48,20 +48,20 @@ base-build:
4848
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
4949
--build-arg BASEOS=$(BASEOS) \
5050
--build-arg PACKAGER=$(PACKAGER) \
51-
--build-arg CONTAINERSUITE=$(CONTAINERSUITE)
51+
--build-arg IMAGE_PATH=$(IMAGE_PATH)
5252

5353
base: base-build;
5454

5555
pgbackrest-build:
5656
docker build $(ROOTPATH) \
5757
--file $(ROOTPATH)/docker/pgbackrest/Dockerfile \
58-
--tag cybertec-pg-container/pgbackrest:$(IMAGE_TAG) \
58+
--tag cybertec-pg-container/pgbackrest:$(IMAGE_TAG) \
5959
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
6060
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
6161
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
6262
--build-arg BASEOS=$(BASEOS) \
6363
--build-arg PACKAGER=$(PACKAGER) \
64-
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
64+
--build-arg IMAGE_PATH=$(IMAGE_PATH) \
6565
--build-arg BUILD=$(BUILD) \
6666
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
6767
--build-arg OLD_PG_VERSIONS="$(OLD_PG_VERSIONS)" \
@@ -79,7 +79,7 @@ postgres-build:
7979
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
8080
--build-arg BASEOS=$(BASEOS) \
8181
--build-arg PACKAGER=$(PACKAGER) \
82-
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
82+
--build-arg IMAGE_PATH=$(IMAGE_PATH) \
8383
--build-arg BUILD=$(BUILD) \
8484
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
8585
--build-arg PATRONI_VERSION=$(PATRONI_VERSION) \
@@ -100,7 +100,7 @@ postgres-gis-build:
100100
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
101101
--build-arg BASEOS=$(BASEOS) \
102102
--build-arg PACKAGER=$(PACKAGER) \
103-
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
103+
--build-arg IMAGE_PATH=$(IMAGE_PATH) \
104104
--build-arg BUILD=$(BUILD) \
105105
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
106106
--build-arg PATRONI_VERSION=$(PATRONI_VERSION) \
@@ -121,7 +121,7 @@ postgres-oracle-build:
121121
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
122122
--build-arg BASEOS=$(BASEOS) \
123123
--build-arg PACKAGER=$(PACKAGER) \
124-
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
124+
--build-arg IMAGE_PATH=$(IMAGE_PATH) \
125125
--build-arg BUILD=$(BUILD) \
126126
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
127127
--build-arg PATRONI_VERSION=$(PATRONI_VERSION) \
@@ -141,22 +141,23 @@ pgbouncer-build:
141141
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
142142
--build-arg BASEOS=$(BASEOS) \
143143
--build-arg PACKAGER=$(PACKAGER) \
144-
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
144+
--build-arg IMAGE_PATH=$(IMAGE_PATH) \
145145
--build-arg BUILD=$(BUILD) \
146+
--build-arg PGBOUNCER_VERSION=${PGBOUNCER_VERSION} \
146147
--build-arg PGVERSION=$(PGVERSION)
147148

148149
pgbouncer: pgbouncer-build
149150

150151
exporter-build:
151-
docker build $(ROOTPATH) \
152+
docker build $(ROOTPATH) --no-cache \
152153
--file $(ROOTPATH)/docker/exporter/Dockerfile \
153154
--tag cybertec-pg-container/exporter:$(IMAGE_TAG) \
154155
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
155156
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
156157
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
157158
--build-arg BASEOS=$(BASEOS) \
158159
--build-arg PACKAGER=$(PACKAGER) \
159-
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
160+
--build-arg IMAGE_PATH=$(IMAGE_PATH) \
160161
--build-arg BUILD=$(BUILD) \
161162
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
162163
--build-arg PGVERSION=$(PGVERSION)
@@ -172,7 +173,7 @@ publicbeta-pg-build:
172173
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
173174
--build-arg BASEOS=$(BASEOS) \
174175
--build-arg PACKAGER=$(PACKAGER) \
175-
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
176+
--build-arg IMAGE_PATH=$(IMAGE_PATH) \
176177
--build-arg BUILD=$(BUILD) \
177178
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
178179
--build-arg PATRONI_VERSION=$(PATRONI_VERSION) \
@@ -192,7 +193,7 @@ publicbeta-pgbackrest-build:
192193
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
193194
--build-arg BASEOS=$(BASEOS) \
194195
--build-arg PACKAGER=$(PACKAGER) \
195-
--build-arg CONTAINERSUITE=$(CONTAINERSUITE) \
196+
--build-arg IMAGE_PATH=$(IMAGE_PATH) \
196197
--build-arg BUILD=$(BUILD) \
197198
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
198199
--build-arg OLD_PG_VERSIONS="$(OLD_PG_VERSIONS)" \

docker/add-grid-files/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ARG CONTAINERIMAGE
2+
3+
FROM ${CONTAINERIMAGE}
4+
5+
# Grid-Files ins Image kopieren
6+
COPY grid-files/ /proj/grids/
7+
8+
# Setze ein Arbeitsverzeichnis
9+
WORKDIR /proj
10+
11+
CMD ["/bin/sh", "-c", "cp -r /proj/grids/* /proj-target/"]
12+
13+
14+
#additionalVolumes:
15+
# - mountPath: /home/postgres/.local/share/proj
16+
# name: proj-grids
17+
# targetContainers:
18+
# - postgres
19+
# volumeSource:
20+
# emptyDir: {}
21+
# initContainers:
22+
# - image: 'docker.io/schmaetz/proj:test-v0.0.3'
23+
# name: proj
24+
# volumeMounts:
25+
# - mountPath: /proj-target
26+
# name: proj-grids

docker/exporter/Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
ARG CONTAINERSUITE
1+
ARG IMAGE_PATH
22
ARG BUILD
33
ARG BASEOS
44
ARG CONTAINERIMAGE
55

6-
FROM ${CONTAINERSUITE}/base:${BASEOS}-${BUILD} AS builder
6+
FROM ${IMAGE_PATH}/base:${BASEOS}-${BUILD} AS builder
77

88
ARG PACKAGER
99

@@ -15,13 +15,10 @@ RUN ${PACKAGER} -y install --nodocs \
1515
make \
1616
&& ${PACKAGER} -y clean all ;
1717

18-
RUN wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz && tar -xzf go1.23.0.linux-amd64.tar.gz && mv go /usr/local
18+
RUN wget https://go.dev/dl/go1.23.6.linux-amd64.tar.gz && tar -xzf go1.23.6.linux-amd64.tar.gz && mv go /usr/local
1919
ENV PATH=$PATH:/usr/local/go/bin
2020

21-
RUN git clone https://github.com/prometheus-community/postgres_exporter.git && cd postgres_exporter \
22-
# fix for pg17
23-
&& git fetch origin pull/1072/head:pr-pg17 && git fetch origin pull/1072/head:pr-pg17 && git merge pr-pg17 \
24-
&& make build;
21+
RUN git clone https://github.com/cybertec-postgresql/postgres_exporter.git && cd postgres_exporter && make build;
2522

2623
FROM ${CONTAINERIMAGE}
2724
COPY --from=builder /usr/bin/dumb-init /usr/bin/dumb-init

docker/pg-public-beta/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
ARG CONTAINERSUITE
1+
ARG IMAGE_PATH
22
ARG BUILD
33
ARG BASEOS
44
ARG PGVERSION
55

6-
FROM ${CONTAINERSUITE}/base:${BASEOS}-${BUILD} as builder
6+
FROM ${IMAGE_PATH}/base:${BASEOS}-${BUILD} as builder
77

88
# Dockerfile specific informations
99
ARG PACKAGER

docker/pgbackrest-public-beta/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
ARG CONTAINERSUITE
1+
ARG IMAGE_PATH
22
ARG BUILD
33
ARG BASEOS
44
ARG CONTAINERIMAGE
55

6-
FROM ${CONTAINERSUITE}/base:${BASEOS}-${BUILD} AS builder
6+
FROM ${IMAGE_PATH}/base:${BASEOS}-${BUILD} AS builder
77

88
# Dockerfile specific informations
99
ARG PACKAGER

docker/pgbackrest/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
ARG CONTAINERSUITE
1+
ARG IMAGE_PATH
22
ARG BUILD
33
ARG BASEOS
44
ARG CONTAINERIMAGE
55

6-
FROM ${CONTAINERSUITE}/base:${BASEOS}-${BUILD} AS builder
6+
FROM ${IMAGE_PATH}/base:${BASEOS}-${BUILD} AS builder
77

88
# Dockerfile specific informations
99
ARG PACKAGER
@@ -154,6 +154,6 @@ VOLUME ["sshd", "/home/postgres/pgdata", "/backrestrepo"]
154154

155155
ENTRYPOINT ["/scripts/nss_wrapper/nss_wrapper.sh"]
156156

157-
USER 26
157+
USER postgres
158158

159159
CMD ["dumb-init", "/launch.sh", "init"]

docker/pgbouncer/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
ARG CONTAINERSUITE
1+
ARG IMAGE_PATH
22
ARG BUILD
33
ARG BASEOS
44
ARG CONTAINERIMAGE
55

6-
FROM ${CONTAINERSUITE}/base:${BASEOS}-${BUILD} AS builder
6+
FROM ${IMAGE_PATH}/base:${BASEOS}-${BUILD} AS builder
77

88
ARG PACKAGER
9+
ARG PGBOUNCER_VERSION
910

1011
RUN ${PACKAGER} -y install --nodocs \
1112
--setopt=skip_missing_names_on_install=False \
1213
dumb-init \
13-
pgbouncer \
14+
"pgbouncer-${PGBOUNCER_VERSION}.*" \
1415
&& ${PACKAGER} -y autoremove \
1516
&& ${PACKAGER} -y clean dbcache \
1617
&& ${PACKAGER} -y clean all;

docker/postgres-gis/Dockerfile

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
ARG CONTAINERSUITE
1+
ARG IMAGE_PATH
22
ARG BUILD
33
ARG BASEOS
44
ARG PGVERSION
55

6-
FROM ${CONTAINERSUITE}/base:${BASEOS}-${BUILD} as builder
6+
FROM ${IMAGE_PATH}/base:${BASEOS}-${BUILD} as builder
77

88
# Dockerfile specific informations
99
ARG PACKAGER
@@ -18,11 +18,8 @@ ARG ETCD_VERSION
1818
ARG ARCH
1919

2020
# Spilo-specific
21-
ENV SET_USER=REL4_1_0 \
22-
PAM_OAUTH2=v1.0.1 \
23-
PG_PERMISSIONS=REL_1_3 \
24-
PLANTUNER_COMMIT=800d81bc85da64ff3ef66e12aed1d4e1e54fc006 \
25-
PG_TM_AUX_COMMIT=6c012d38a4c1b0ba4a36952d60b0ce3a22ac9c3d
21+
ENV PAM_OAUTH2=v1.0.1 \
22+
PG_PERMISSIONS=REL_1_3
2623

2724
# Get some Standard-Stuff
2825
RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 \
@@ -58,6 +55,7 @@ RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setop
5855
libicu \
5956
pgbackrest-${PGBACKREST_VERSION} \
6057
cronie \
58+
libcurl-devel \
6159
&& ${PACKAGER} -y clean all;
6260

6361
# install etcdctl
@@ -68,23 +66,18 @@ ENV PATHBACKUP = $PATH
6866
RUN wget https://smarden.org/runit/runit-2.1.2.tar.gz -P /package/
6967
COPY cron_unprivileged.c /package/
7068

71-
# Install pam_oauth2.so
72-
#RUN #git clone -b $PAM_OAUTH2 --recurse-submodules https://github.com/zalando-pg/pam-oauth2.git \
73-
#&& make -C pam-oauth2 install \
74-
#&& curl -sL https://github.com/zalando-pg/bg_mon/archive/$BG_MON_COMMIT.tar.gz | tar xz \
75-
#&& curl -sL https://github.com/zalando-pg/pg_auth_mon/archive/$PG_AUTH_MON_COMMIT.tar.gz | tar xz \
76-
77-
RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python-etcd psutil requests cdiff ydiff --upgrade \
69+
RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python-etcd psutil requests cdiff ydiff==1.3 --upgrade \
7870
&& if [[ $PATRONI_VERSION == "multisite-"* ]]; then \
7971
git clone -b $PATRONI_VERSION https://github.com/cybertec-postgresql/patroni; \
8072
pip3 install ./patroni[kubernetes,etcd,etcd3]; \
8173
else \
8274
pip3 install patroni[kubernetes$EXTRAS]==$PATRONI_VERSION --upgrade; \
8375
fi \
8476
&& mkdir /usr/lib/postgresql \
77+
# Install pam_oauth2.so
78+
&& git clone -b $PAM_OAUTH2 --recurse-submodules https://github.com/zalando-pg/pam-oauth2.git && make -C pam-oauth2 install \
8579
&& git clone -b $PG_PERMISSIONS https://github.com/cybertec-postgresql/pg_permissions.git \
86-
&& git clone -b $SET_USER https://github.com/pgaudit/set_user.git \
87-
#&& git clone https://github.com/dimitri/pgextwlist.git \
80+
&& git clone https://github.com/dimitri/pgextwlist.git \
8881
&& git clone https://github.com/crunchydata/pgnodemx \
8982
\
9083
&& ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 postgresql${PGVERSION} libevent-devel brotli-devel libbrotli \
@@ -102,7 +95,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
10295
# Install PostgreSQL binaries, contrib, plproxy and multiple pl's
10396
&& ${PACKAGER} -y install -y postgresql${version}-contrib \
10497
postgresql${version}-plpython3 postgresql${version}-devel \
105-
pg_cron_${version} \
98+
pg_cron_${version} pgvector_${version} set_user_${version} \
10699
# Modify for using origial-spilo scripts
107100
&& ln -s /usr/pgsql-${version} /usr/lib/postgresql/${version} \
108101
&& export PATH=$PATHBACKUP:/usr/pgsql-${version}/bin \
@@ -111,11 +104,10 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
111104
# Install TimescaleDB
112105
&& ${PACKAGER} -y install timescaledb_${version} \
113106
&& cd / \
114-
&& for n in set_user pg_permissions $EXTRA_EXTENSIONS; do \
115-
#pg_profile-${PG_PROFILE} pg_tm_aux-${PG_TM_AUX_COMMIT} bg_mon-${BG_MON_COMMIT} pg_auth_mon-${PG_AUTH_MON_COMMIT}
107+
&& for n in pg_permissions $EXTRA_EXTENSIONS; do \
116108
make -C $n USE_PGXS=1 clean install-strip; \
117109
done \
118-
#&& cd /pgextwlist && make clean && make && make install \
110+
&& cd /pgextwlist && make clean && make && make install \
119111
&& cd /pgnodemx && make USE_PGXS=1 clean && make USE_PGXS=1 && make USE_PGXS=1 install; \
120112
done \
121113
&& ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 glibc-static \
@@ -125,10 +117,9 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
125117
RUN cd /package && tar -xvzf runit-2.1.2.tar.gz && rm runit-2.1.2.tar.gz \
126118
&& cd admin/runit-2.1.2 && package/install \
127119
&& ln -s /usr/local/bin/runsvdir /usr/bin/runsvdir \
128-
&& rm -rf /pg_permissions /pgextwlist /pg_stat_kcache /pgnodemx /timescaledb /set_user /pam-oauth2 \
129-
&& rm /etc/pgbackrest.conf && rm -rf /var/spool/pgbackrest;
130-
131-
RUN ${PACKAGER} -y remove $(rpm -qa "*devel*") python3-pip python3-wheel python3-dev python3-setuptools git patchutils flatpak glibc-static gcc glibc-devel --exclude libgeotiff17-devel --exclude libtiff-devel --exclude libspatialite50-devel \
120+
&& rm -rf /pg_permissions /pgextwlist /pg_stat_kcache /pgnodemx /timescaledb /pam-oauth2 \
121+
&& rm /etc/pgbackrest.conf && rm -rf /var/spool/pgbackrest \
122+
&& ${PACKAGER} -y remove $(rpm -qa "*devel*") python3-pip python3-wheel python3-dev python3-setuptools git patchutils flatpak glibc-static gcc glibc-devel --exclude libgeotiff17-devel --exclude libtiff-devel --exclude libspatialite50-devel \
132123
&& ${PACKAGER} -y autoremove \
133124
&& ${PACKAGER} -y clean dbcache \
134125
&& ${PACKAGER} -y clean all;
@@ -205,6 +196,6 @@ COPY launcher/postgres/launch.sh /
205196

206197
ENTRYPOINT ["/scripts/nss_wrapper/nss_wrapper.sh"]
207198

208-
USER 26
199+
USER postgres
209200

210201
CMD ["/bin/sh", "/launch.sh", "init"]

0 commit comments

Comments
 (0)