Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/zalando/spilo
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 9, 2024
2 parents b891a53 + 5824aee commit 9722112
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 112 deletions.
2 changes: 1 addition & 1 deletion delivery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pipeline:
- id: push-spilo-ecr
env:
BASE_IMAGE: container-registry.zalando.net/library/ubuntu-22.04
PGVERSION: 15
PGVERSION: 16
MULTI_ARCH_REGISTRY: container-registry-test.zalando.net/acid
type: script
requires_human_approval: true
Expand Down
23 changes: 10 additions & 13 deletions postgres-appliance/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG BASE_IMAGE=ubuntu:22.04
ARG PGVERSION=15
ARG TIMESCALEDB="1.7.5 2.3.1 2.11.2"
ARG PGVERSION=16
ARG TIMESCALEDB="2.3.1 2.11.2 2.14.2"
ARG DEMO=false
ARG COMPRESS=false
ARG ADDITIONAL_LOCALES=
Expand Down Expand Up @@ -39,7 +39,7 @@ RUN bash /builddeps/prepare.sh

COPY --from=ubuntu-18 /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.18

COPY cron_unprivileged.c dependencies/src /builddeps/
COPY cron_unprivileged.c /builddeps/
COPY build_scripts/base.sh /builddeps/
COPY --from=dependencies-builder /builddeps/*.deb /builddeps/

Expand All @@ -48,25 +48,22 @@ ARG TIMESCALEDB
ARG TIMESCALEDB_APACHE_ONLY=false
ARG TIMESCALEDB_TOOLKIT=true
ARG COMPRESS
ARG PGOLDVERSIONS="10 11 12 13 14"
ARG PGOLDVERSIONS="11 12 13 14 15"
ARG WITH_PERL=false

ARG DEB_PG_SUPPORTED_VERSIONS="$PGOLDVERSIONS $PGVERSION"

# Install PostgreSQL, extensions and contribs
ENV POSTGIS_VERSION=3.4 \
POSTGIS_LEGACY=3.3 \
POSTGIS_SUPER_LEGACY=3.2 \
BG_MON_COMMIT=a0e7c93458ee7d96b0c95d9a0a4c5bc7a72ff5f4 \
PG_AUTH_MON_COMMIT=439697fe2980cf48f1760f45e04c2d69b2748e73 \
PG_MON_COMMIT=34c35a86e6dea26930bf1f770048cea2c695b80b \
BG_MON_COMMIT=ef60961eff92672b1e21f5260dc1211367da6f1f \
PG_AUTH_MON_COMMIT=3d010e5959285c32b155e8064c9c9b57869aeca7 \
PG_MON_COMMIT=a6c5982368edd876edbee01e51b91e7387071e21 \
SET_USER=REL4_0_1 \
PLPROFILER=fix/pg15-shmem \
PG_PROFILE=4.2 \
PLPROFILER=REL4_2_4 \
PG_PROFILE=4.5 \
PAM_OAUTH2=v1.0.1 \
PLANTUNER_COMMIT=800d81bc85da64ff3ef66e12aed1d4e1e54fc006 \
PG_PERMISSIONS_COMMIT=314b9359e3d77c0b2ef7dbbde97fa4be80e31925 \
PG_TM_AUX_COMMIT=51cf42f6043608919802fcc48458471d0ea3a127
PG_PERMISSIONS_COMMIT=314b9359e3d77c0b2ef7dbbde97fa4be80e31925

WORKDIR /builddeps
RUN bash base.sh
Expand Down
43 changes: 9 additions & 34 deletions postgres-appliance/build_scripts/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ else
make -C pam-oauth2 install

# prepare 3rd sources
git clone -b "$PLPROFILER" https://github.com/hughcapet/plprofiler.git
tar -xzf "plantuner-${PLANTUNER_COMMIT}.tar.gz"
git clone -b "$PLPROFILER" https://github.com/bigsql/plprofiler.git
curl -sL "https://github.com/zalando-pg/pg_mon/archive/$PG_MON_COMMIT.tar.gz" | tar xz

for p in python3-keyring python3-docutils ieee-data; do
Expand All @@ -55,7 +54,6 @@ fi
curl -sL "https://github.com/zalando-pg/bg_mon/archive/$BG_MON_COMMIT.tar.gz" | tar xz
curl -sL "https://github.com/zalando-pg/pg_auth_mon/archive/$PG_AUTH_MON_COMMIT.tar.gz" | tar xz
curl -sL "https://github.com/cybertec-postgresql/pg_permissions/archive/$PG_PERMISSIONS_COMMIT.tar.gz" | tar xz
curl -sL "https://github.com/hughcapet/pg_tm_aux/archive/$PG_TM_AUX_COMMIT.tar.gz" | tar xz
curl -sL "https://github.com/zubkov-andrei/pg_profile/archive/$PG_PROFILE.tar.gz" | tar xz
git clone -b "$SET_USER" https://github.com/pgaudit/set_user.git
git clone https://github.com/timescale/timescaledb.git
Expand Down Expand Up @@ -96,28 +94,15 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
"postgresql-${version}-postgis-${POSTGIS_VERSION%.*}"
"postgresql-${version}-postgis-${POSTGIS_VERSION%.*}-scripts"
"postgresql-${version}-repack"
"postgresql-${version}-wal2json")

if [ "$version" != "15" ]; then
# not yet present for pg15
EXTRAS+=("postgresql-${version}-pllua")
fi
"postgresql-${version}-wal2json"
"postgresql-${version}-decoderbufs"
"postgresql-${version}-pllua"
"postgresql-${version}-pgvector")

if [ "$WITH_PERL" = "true" ]; then
EXTRAS+=("postgresql-plperl-${version}")
fi

if [ "${version%.*}" -ge 10 ]; then
EXTRAS+=("postgresql-${version}-decoderbufs")
fi

if [ "${version%.*}" -ge 11 ]; then
EXTRAS+=("postgresql-${version}-pgvector")
fi

if [ "${version%.*}" -lt 11 ]; then
EXTRAS+=("postgresql-${version}-amcheck")
fi
fi

# Install PostgreSQL binaries, contrib, plproxy and multiple pl's
Expand Down Expand Up @@ -166,20 +151,15 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
rm /usr/share/keyrings/timescale_E7391C94080429FF.gpg
fi

EXTRA_EXTENSIONS=()
if [ "$DEMO" != "true" ]; then
EXTRA_EXTENSIONS=("plantuner-${PLANTUNER_COMMIT}" plprofiler)
if [ "${version%.*}" -ge 10 ]; then
EXTRA_EXTENSIONS+=("pg_mon-${PG_MON_COMMIT}")
fi
else
EXTRA_EXTENSIONS=()
EXTRA_EXTENSIONS+=("plprofiler" "pg_mon-${PG_MON_COMMIT}")
fi

for n in bg_mon-${BG_MON_COMMIT} \
pg_auth_mon-${PG_AUTH_MON_COMMIT} \
set_user \
pg_permissions-${PG_PERMISSIONS_COMMIT} \
pg_tm_aux-${PG_TM_AUX_COMMIT} \
pg_profile-${PG_PROFILE} \
"${EXTRA_EXTENSIONS[@]}"; do
make -C "$n" USE_PGXS=1 clean install-strip
Expand Down Expand Up @@ -281,17 +261,12 @@ if [ "$DEMO" != "true" ]; then
if [ "$v1" = "$v2" ]; then
started=1
elif [ $started = 1 ]; then

used_postgis_version=$POSTGIS_VERSION
if [ "${v1##*/}" = "11" ]; then used_postgis_version=$POSTGIS_LEGACY; fi

for d1 in extension contrib contrib/postgis-$used_postgis_version; do
for d1 in extension contrib contrib/postgis-$POSTGIS_VERSION; do
cd "$v1/$d1"
d2="$d1"
d1="../../${v1##*/}/$d1"
if [ "${d2%-*}" = "contrib/postgis" ]; then
if [ "${v2##*/}" = "11" ]; then d2="${d2%-*}-$POSTGIS_LEGACY"
elif [ "${v2##*/}" = "10" ]; then d2="${d2%-*}-$POSTGIS_SUPER_LEGACY"; fi
if [ "${v2##*/}" = "11" ]; then d2="${d2%-*}-$POSTGIS_LEGACY"; fi
d1="../$d1"
fi
d2="$v2/$d2"
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion postgres-appliance/major_upgrade/pg_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class _PostgresqlUpgrade(Postgresql):

_INCOMPATIBLE_EXTENSIONS = ('amcheck_next', 'pg_repack',)
_INCOMPATIBLE_EXTENSIONS = ('pg_repack',)

def adjust_shared_preload_libraries(self, version):
from spilo_commons import adjust_extensions
Expand Down
10 changes: 5 additions & 5 deletions postgres-appliance/scripts/spilo_commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

# (min_version, max_version, shared_preload_libraries, extwlist.extensions)
extensions = {
'timescaledb': (9.6, 15, True, True),
'pg_cron': (9.5, 15, True, False),
'pg_stat_kcache': (9.4, 15, True, False),
'pg_partman': (9.4, 15, False, True)
'timescaledb': (9.6, 16, True, True),
'pg_cron': (9.5, 16, True, False),
'pg_stat_kcache': (9.4, 16, True, False),
'pg_partman': (9.4, 16, False, True)
}
if os.environ.get('ENABLE_PG_MON') == 'true':
extensions['pg_mon'] = (11, 15, True, False)
extensions['pg_mon'] = (11, 16, True, False)


def adjust_extensions(old, version, extwlist=False):
Expand Down
2 changes: 1 addition & 1 deletion postgres-appliance/tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ services:
postgresql:
parameters:
shared_buffers: 32MB
PGVERSION: '10'
PGVERSION: '11'
# Just to test upgrade with clone. Without CLONE_SCOPE they don't work
CLONE_WAL_S3_BUCKET: *bucket
CLONE_AWS_ACCESS_KEY_ID: *access_key
Expand Down
3 changes: 1 addition & 2 deletions postgres-appliance/tests/schema.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CREATE EXTENSION pg_repack;
CREATE EXTENSION amcheck_next; /* the upgrade script must delete it before running pg_upgrade --check! */
CREATE EXTENSION pg_repack; /* the upgrade script must delete it before running pg_upgrade --check! */

CREATE DATABASE test_db;
\c test_db
Expand Down
Loading

0 comments on commit 9722112

Please sign in to comment.