Skip to content

Commit 6a8bd35

Browse files
committed
postgres + postgres-gis Anpassungen pgvector
1 parent 9bd19ac commit 6a8bd35

File tree

4 files changed

+44
-36
lines changed

4 files changed

+44
-36
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ launcher/exporter_v2
1919
docker/logical_backup/
2020
scripts/logical_backup/
2121

22+
# grid-files
23+
/docker/add-grid-files/grid-files/*

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/postgres-gis/Dockerfile

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,11 @@ ARG PG_SUPPORTED_VERSIONS="$PGVERSION"
1515
ARG PG_SUPPORTED_VERSIONS="$OLD_PG_VERSIONS $PGVERSION"
1616
ARG POSTGIS_VERSION
1717
ARG ETCD_VERSION
18-
ARG PGVECTOR
1918
ARG ARCH
2019

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

2824
# Get some Standard-Stuff
2925
RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 \
@@ -59,6 +55,7 @@ RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setop
5955
libicu \
6056
pgbackrest-${PGBACKREST_VERSION} \
6157
cronie \
58+
libcurl-devel \
6259
&& ${PACKAGER} -y clean all;
6360

6461
# install etcdctl
@@ -69,12 +66,6 @@ ENV PATHBACKUP = $PATH
6966
RUN wget https://smarden.org/runit/runit-2.1.2.tar.gz -P /package/
7067
COPY cron_unprivileged.c /package/
7168

72-
# Install pam_oauth2.so
73-
#RUN #git clone -b $PAM_OAUTH2 --recurse-submodules https://github.com/zalando-pg/pam-oauth2.git \
74-
#&& make -C pam-oauth2 install \
75-
#&& curl -sL https://github.com/zalando-pg/bg_mon/archive/$BG_MON_COMMIT.tar.gz | tar xz \
76-
#&& curl -sL https://github.com/zalando-pg/pg_auth_mon/archive/$PG_AUTH_MON_COMMIT.tar.gz | tar xz \
77-
7869
RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python-etcd psutil requests cdiff ydiff==1.3 --upgrade \
7970
&& if [[ $PATRONI_VERSION == "multisite-"* ]]; then \
8071
git clone -b $PATRONI_VERSION https://github.com/cybertec-postgresql/patroni; \
@@ -83,9 +74,9 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
8374
pip3 install patroni[kubernetes$EXTRAS]==$PATRONI_VERSION --upgrade; \
8475
fi \
8576
&& 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 \
8679
&& git clone -b $PG_PERMISSIONS https://github.com/cybertec-postgresql/pg_permissions.git \
87-
&& git clone -b $SET_USER https://github.com/pgaudit/set_user.git \
88-
&& git clone -b $PGVECTOR https://github.com/pgvector/pgvector.git \
8980
&& git clone https://github.com/dimitri/pgextwlist.git \
9081
&& git clone https://github.com/crunchydata/pgnodemx \
9182
\
@@ -104,7 +95,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
10495
# Install PostgreSQL binaries, contrib, plproxy and multiple pl's
10596
&& ${PACKAGER} -y install -y postgresql${version}-contrib \
10697
postgresql${version}-plpython3 postgresql${version}-devel \
107-
pg_cron_${version} \
98+
pg_cron_${version} pgvector_${version} set_user_${version} \
10899
# Modify for using origial-spilo scripts
109100
&& ln -s /usr/pgsql-${version} /usr/lib/postgresql/${version} \
110101
&& export PATH=$PATHBACKUP:/usr/pgsql-${version}/bin \
@@ -113,8 +104,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
113104
# Install TimescaleDB
114105
&& ${PACKAGER} -y install timescaledb_${version} \
115106
&& cd / \
116-
&& for n in set_user pg_permissions pgvector $EXTRA_EXTENSIONS; do \
117-
#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 \
118108
make -C $n USE_PGXS=1 clean install-strip; \
119109
done \
120110
&& cd /pgextwlist && make clean && make && make install \
@@ -127,7 +117,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
127117
RUN cd /package && tar -xvzf runit-2.1.2.tar.gz && rm runit-2.1.2.tar.gz \
128118
&& cd admin/runit-2.1.2 && package/install \
129119
&& ln -s /usr/local/bin/runsvdir /usr/bin/runsvdir \
130-
&& rm -rf /pg_permissions /pgextwlist /pg_stat_kcache /pgvector /pgnodemx /timescaledb /set_user /pam-oauth2 \
120+
&& rm -rf /pg_permissions /pgextwlist /pg_stat_kcache /pgnodemx /timescaledb /pam-oauth2 \
131121
&& rm /etc/pgbackrest.conf && rm -rf /var/spool/pgbackrest \
132122
&& ${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 \
133123
&& ${PACKAGER} -y autoremove \

docker/postgres/Dockerfile

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ ARG OLD_PG_VERSIONS
1414
ARG PG_SUPPORTED_VERSIONS="$PGVERSION"
1515
ARG PG_SUPPORTED_VERSIONS="$OLD_PG_VERSIONS $PGVERSION"
1616
ARG ETCD_VERSION
17-
ARG PGVECTOR
1817
ARG ARCH
1918

2019
# 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
20+
ENV PAM_OAUTH2=v1.0.1 \
21+
PG_PERMISSIONS=REL_1_3
2622

2723
# Get some Standard-Stuff
2824
RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 \
@@ -58,6 +54,7 @@ RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setop
5854
libicu \
5955
pgbackrest-${PGBACKREST_VERSION} \
6056
cronie \
57+
libcurl-devel \
6158
&& ${PACKAGER} -y clean all;
6259

6360
# install etcdctl
@@ -68,12 +65,6 @@ ENV PATHBACKUP = $PATH
6865
RUN wget https://smarden.org/runit/runit-2.1.2.tar.gz -P /package/
6966
COPY cron_unprivileged.c /package/
7067

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-
7768
RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python-etcd psutil requests cdiff ydiff==1.3 --upgrade \
7869
&& if [[ $PATRONI_VERSION == "multisite-"* ]]; then \
7970
git clone -b $PATRONI_VERSION https://github.com/cybertec-postgresql/patroni; \
@@ -82,9 +73,9 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
8273
pip3 install patroni[kubernetes$EXTRAS]==$PATRONI_VERSION --upgrade; \
8374
fi \
8475
&& mkdir /usr/lib/postgresql \
76+
# Install pam_oauth2.so
77+
&& git clone -b $PAM_OAUTH2 --recurse-submodules https://github.com/zalando-pg/pam-oauth2.git && make -C pam-oauth2 install \
8578
&& 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 -b $PGVECTOR https://github.com/pgvector/pgvector.git \
8879
&& git clone https://github.com/dimitri/pgextwlist.git \
8980
&& git clone https://github.com/crunchydata/pgnodemx \
9081
\
@@ -103,15 +94,14 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
10394
# Install PostgreSQL binaries, contrib, plproxy and multiple pl's
10495
&& ${PACKAGER} -y install -y postgresql${version}-contrib \
10596
postgresql${version}-plpython3 postgresql${version}-devel \
106-
pg_cron_${version} \
97+
pg_cron_${version} pgvector_${version} set_user_${version} \
10798
# Modify for using origial-spilo scripts
10899
&& ln -s /usr/pgsql-${version} /usr/lib/postgresql/${version} \
109100
&& export PATH=$PATHBACKUP:/usr/pgsql-${version}/bin \
110101
# Install TimescaleDB
111102
&& ${PACKAGER} -y install timescaledb_${version} \
112103
&& cd / \
113-
&& for n in set_user pg_permissions pgvector $EXTRA_EXTENSIONS; do \
114-
#pg_profile-${PG_PROFILE} pg_tm_aux-${PG_TM_AUX_COMMIT} bg_mon-${BG_MON_COMMIT} pg_auth_mon-${PG_AUTH_MON_COMMIT}
104+
&& for n in pg_permissions $EXTRA_EXTENSIONS; do \
115105
make -C $n USE_PGXS=1 clean install-strip; \
116106
done \
117107
&& cd /pgextwlist && make clean && make && make install \
@@ -124,7 +114,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
124114
RUN cd /package && tar -xvzf runit-2.1.2.tar.gz && rm runit-2.1.2.tar.gz \
125115
&& cd admin/runit-2.1.2 && package/install \
126116
&& ln -s /usr/local/bin/runsvdir /usr/bin/runsvdir \
127-
&& rm -rf /pg_permissions /pgextwlist /pg_stat_kcache /pgvector /pgnodemx /timescaledb /set_user /pam-oauth2 \
117+
&& rm -rf /pg_permissions /pgextwlist /pg_stat_kcache /pgnodemx /timescaledb /pam-oauth2 \
128118
&& rm /etc/pgbackrest.conf && rm -rf /var/spool/pgbackrest \
129119
&& ${PACKAGER} -y remove $(rpm -qa "*devel*") python3-pip python3-wheel python3-dev python3-setuptools git patchutils flatpak glibc-static gcc glibc-devel \
130120
&& ${PACKAGER} -y autoremove \

0 commit comments

Comments
 (0)