From 8f3e595c48315470b18b770698030064e1b30a97 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 21 Aug 2024 09:54:48 +0200 Subject: [PATCH 01/13] Add support for building and testing PSQL16 on CentOS Stream 10 Signed-off-by: Petr "Stone" Hracek --- manifest.yml | 3 +++ specs/multispec.yml | 12 ++++++++++++ src/Dockerfile | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/manifest.yml b/manifest.yml index bcf27884..b11b4022 100644 --- a/manifest.yml +++ b/manifest.yml @@ -32,6 +32,9 @@ DISTGEN_MULTI_RULES: - src: src/Dockerfile dest: Dockerfile.c9s + - src: src/Dockerfile + dest: Dockerfile.c10s + - src: src/Dockerfile.fedora dest: Dockerfile.fedora diff --git a/specs/multispec.yml b/specs/multispec.yml index a5ae7f21..69db1896 100644 --- a/specs/multispec.yml +++ b/specs/multispec.yml @@ -65,6 +65,17 @@ specs: environment_setup: >-4 { yum -y module enable postgresql:{{ spec.version }} || :; } && \ + c10s: + distros: + - centos-stream-10-x86_64 + s2i_base: quay.io/sclorg/s2i-core-c10s:c10s + org: "sclorg" + prod: "c10s" + openshift_tags: "database,postgresql,postgresql{{ spec.short }},postgresql-{{ spec.short }}" + redhat_component: "postgresql-{{ spec.short }}-container" + img_name: "{{ spec.org }}/postgresql-{{ spec.short }}-{{ spec.prod }}" + pkgs: "postgresql-server postgresql-contrib glibc-locale-source" + version: "12": version: "12" @@ -126,3 +137,4 @@ matrix: - rhel-9-x86_64 - centos-stream-9-x86_64 - fedora-40-x86_64 + - centos-stream-10-x86_64 diff --git a/src/Dockerfile b/src/Dockerfile index 7b6ac535..f7ca468f 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -55,6 +55,9 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions {% if spec.repo_enable_reason %} {{ spec.repo_enable_reason }} {% endif %} +{% if spec.prod == "c10s" %} +RUN INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper {{ spec.pkgs }}" && \ +{% else %} RUN {{ spec.environment_setup }} {% if spec.has_devel_repo %} {% if config.os.id == 'rhel' %} @@ -67,6 +70,7 @@ RUN {{ spec.environment_setup }} {% endif %} {% endif %} INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper {{ spec.pkgs }}" && \ +{% endif %} {% if spec.version not in ["9.6", "10", "11"] %} INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ From 2bec2da722e026801a56e49d8c592b5e64ae6916 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 21 Aug 2024 09:55:28 +0200 Subject: [PATCH 02/13] Add generated DOckerfile.c10s Signed-off-by: Petr "Stone" Hracek --- 16/Dockerfile.c10s | 89 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 16/Dockerfile.c10s diff --git a/16/Dockerfile.c10s b/16/Dockerfile.c10s new file mode 100644 index 00000000..49523525 --- /dev/null +++ b/16/Dockerfile.c10s @@ -0,0 +1,89 @@ +FROM quay.io/sclorg/s2i-core-c10s:c10s + +# PostgreSQL image for OpenShift. +# Volumes: +# * /var/lib/pgsql/data - Database cluster for PostgreSQL +# Environment: +# * $POSTGRESQL_USER - Database user name +# * $POSTGRESQL_PASSWORD - User's password +# * $POSTGRESQL_DATABASE - Name of the database to create +# * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' +# PostgreSQL administrative account + +ENV POSTGRESQL_VERSION=16 \ + POSTGRESQL_PREV_VERSION=15 \ + HOME=/var/lib/pgsql \ + PGUSER=postgres \ + APP_DATA=/opt/app-root + +ENV SUMMARY="PostgreSQL is an advanced Object-Relational database management system" \ + DESCRIPTION="PostgreSQL is an advanced Object-Relational database management system (DBMS). \ +The image contains the client and server programs that you'll need to \ +create, run, maintain and access a PostgreSQL DBMS server." + +LABEL summary="$SUMMARY" \ + description="$DESCRIPTION" \ + io.k8s.description="$DESCRIPTION" \ + io.k8s.display-name="PostgreSQL 16" \ + io.openshift.expose-services="5432:postgresql" \ + io.openshift.tags="database,postgresql,postgresql16,postgresql-16" \ + io.openshift.s2i.assemble-user="26" \ + name="sclorg/postgresql-16-c10s" \ + com.redhat.component="postgresql-16-container" \ + version="1" \ + usage="podman run -d --name postgresql_database -e POSTGRESQL_USER=user -e POSTGRESQL_PASSWORD=pass -e POSTGRESQL_DATABASE=db -p 5432:5432 sclorg/postgresql-16-c10s" \ + maintainer="SoftwareCollections.org " + +EXPOSE 5432 + +COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions + +# This image must forever use UID 26 for postgres user so our volumes are +# safe in the future. This should *never* change, the last test is there +# to make sure of that. +RUN INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server postgresql-contrib glibc-locale-source" && \ + INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ + INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ + yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + postgres -V | grep -qe "$POSTGRESQL_VERSION\." && echo "Found VERSION $POSTGRESQL_VERSION" && \ + yum -y clean all --enablerepo='*' && \ + localedef -f UTF-8 -i en_US en_US.UTF-8 && \ + test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \ + mkdir -p /var/lib/pgsql/data && \ + /usr/libexec/fix-permissions /var/lib/pgsql /var/run/postgresql + +# Get prefix path and path to scripts rather than hard-code them in scripts +ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/postgresql \ + ENABLED_COLLECTIONS= + +COPY root / +COPY ./s2i/bin/ $STI_SCRIPTS_PATH + +# Hard links are not supported in Testing Farm approach during sync to guest +# operation system. Therefore tests are failing on error +# /usr/libexec/s2i/run no such file or directory +RUN ln -s /usr/bin/run-postgresql $STI_SCRIPTS_PATH/run + +# Not using VOLUME statement since it's not working in OpenShift Online: +# https://github.com/sclorg/httpd-container/issues/30 +# VOLUME ["/var/lib/pgsql/data"] + +# S2I permission fixes +# -------------------- +# 1. unless specified otherwise (or - equivalently - we are in OpenShift), s2i +# build process would be executed as 'uid=26(postgres) gid=26(postgres)'. +# Such process wouldn't be able to execute the default 'assemble' script +# correctly (it transitively executes 'fix-permissions' script). So let's +# add the 'postgres' user into 'root' group here +# +# 2. we call fix-permissions on $APP_DATA here directly (UID=0 during build +# anyways) to assure that s2i process is actually able to _read_ the +# user-specified scripting. +RUN usermod -a -G root postgres && \ + /usr/libexec/fix-permissions --read-only "$APP_DATA" + +USER 26 + +ENTRYPOINT ["container-entrypoint"] +CMD ["run-postgresql"] From d14dc02433df10582f91977493ad091d3dba1eda Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 21 Aug 2024 09:57:17 +0200 Subject: [PATCH 03/13] Update imagestreams for PSQL 16 and C10S Signed-off-by: Petr "Stone" Hracek --- imagestreams/imagestreams.yaml | 3 +++ imagestreams/postgresql-centos.json | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/imagestreams/imagestreams.yaml b/imagestreams/imagestreams.yaml index fe036bf3..c0abe2fb 100644 --- a/imagestreams/imagestreams.yaml +++ b/imagestreams/imagestreams.yaml @@ -15,6 +15,9 @@ - name: CentOS Stream 9 app_versions: [13, 15, 16] + - name: CentOS Stream 10 + app_versions: [16] + - filename: postgresql-rhel.json latest: "16-el9" distros: diff --git a/imagestreams/postgresql-centos.json b/imagestreams/postgresql-centos.json index bc139daf..797e6ee9 100644 --- a/imagestreams/postgresql-centos.json +++ b/imagestreams/postgresql-centos.json @@ -63,6 +63,24 @@ "type": "Local" } }, + { + "name": "16-el10", + "annotations": { + "openshift.io/display-name": "PostgreSQL 16 (CentOS Stream 10)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Provides a PostgreSQL 16 database on CentOS Stream 10. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/blob/master/README.md.", + "iconClass": "icon-postgresql", + "tags": "database,postgresql", + "version": "16" + }, + "from": { + "kind": "DockerImage", + "name": "quay.io/sclorg/postgresql-16-c10s:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "latest", "annotations": { From 4f7503b8e587740a05e58c526a043f7367f10cab Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 21 Aug 2024 09:57:36 +0200 Subject: [PATCH 04/13] Update build and push with postgresql-16-c10s Signed-off-by: Petr "Stone" Hracek --- .github/workflows/build-and-push.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 1e34d515..5d1a77fa 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -38,6 +38,14 @@ jobs: quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" docker_context: 16 + - dockerfile: "16/Dockerfile.c10s" + registry_namespace: "sclorg" + tag: "c10s" + image_name: "postgresql-16-c10s" + quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME" + quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" + docker_context: 16 + - dockerfile: "15/Dockerfile.fedora" registry_namespace: "fedora" tag: "15" From b92faf4cbdb0cd382d4337dfeafc337fe638cbca Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 21 Aug 2024 10:12:54 +0200 Subject: [PATCH 05/13] Do not fix /run/postgresql because it does not exist during installation Signed-off-by: Petr "Stone" Hracek --- 16/Dockerfile.c10s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/16/Dockerfile.c10s b/16/Dockerfile.c10s index 49523525..26134e36 100644 --- a/16/Dockerfile.c10s +++ b/16/Dockerfile.c10s @@ -51,7 +51,8 @@ RUN INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server pos localedef -f UTF-8 -i en_US en_US.UTF-8 && \ test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \ mkdir -p /var/lib/pgsql/data && \ - /usr/libexec/fix-permissions /var/lib/pgsql /var/run/postgresql + # Directory /var/run/postgresql was removed and /run/postgresql is marked as %ghost dir + /usr/libexec/fix-permissions /var/lib/pgsql # Get prefix path and path to scripts rather than hard-code them in scripts ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/postgresql \ From 56bfda9e2c616c09e0b9dbc30a3dbb740762ca8f Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 21 Aug 2024 10:24:36 +0200 Subject: [PATCH 06/13] Add c10s case to test/pg-test-lib.sh Signed-off-by: Petr "Stone" Hracek --- test/pg-test-lib.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/pg-test-lib.sh b/test/pg-test-lib.sh index 3bc6749d..9b184df9 100644 --- a/test/pg-test-lib.sh +++ b/test/pg-test-lib.sh @@ -33,6 +33,10 @@ get_image_id () ns=c9s local image=quay.io/sclorg/postgresql-${version}-$ns ;; + c10s) + ns=c10s + local image=quay.io/sclorg/postgresql-${version}-$ns + ;; esac docker pull "$image" >/dev/null echo "$image" From efcd2960721bcfe14e41eb6eef81f246a1d29348 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Thu, 5 Sep 2024 09:19:40 +0200 Subject: [PATCH 07/13] Update 16/Dockerfile.c10s Signed-off-by: Petr "Stone" Hracek --- 16/Dockerfile.c10s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/16/Dockerfile.c10s b/16/Dockerfile.c10s index 26134e36..8e6ce27b 100644 --- a/16/Dockerfile.c10s +++ b/16/Dockerfile.c10s @@ -51,8 +51,8 @@ RUN INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server pos localedef -f UTF-8 -i en_US en_US.UTF-8 && \ test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \ mkdir -p /var/lib/pgsql/data && \ - # Directory /var/run/postgresql was removed and /run/postgresql is marked as %ghost dir - /usr/libexec/fix-permissions /var/lib/pgsql + mkdir -p /run/postgresql && \ + /usr/libexec/fix-permissions /var/lib/pgsql /run/postgresql # Get prefix path and path to scripts rather than hard-code them in scripts ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/postgresql \ From 3727f133857fbe188cad4dc4684909d61c838e00 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Thu, 5 Sep 2024 13:26:52 +0200 Subject: [PATCH 08/13] Remove SCL part, Use gettext-envsubst and nss_wrapper-libs Signed-off-by: Petr "Stone" Hracek --- src/Dockerfile | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Dockerfile b/src/Dockerfile index f7ca468f..0daebdaa 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -56,20 +56,10 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions {{ spec.repo_enable_reason }} {% endif %} {% if spec.prod == "c10s" %} -RUN INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper {{ spec.pkgs }}" && \ +RUN INSTALL_PKGS="rsync tar gettext-envsubst bind-utils nss_wrapper-libs {{ spec.pkgs }}" && \ {% else %} RUN {{ spec.environment_setup }} -{% if spec.has_devel_repo %} - {% if config.os.id == 'rhel' %} - {% if spec.has_devel_repo.rhel == 'brew' %} - yum-config-manager --add-repo http://download.devel.redhat.com/brewroot/repos/rhscl-{{ spec.rhscl_version.development }}-rh-postgresql{{ spec.version }}-rhel-7-build/latest/x86_64 && \ - echo gpgcheck=0 >> /etc/yum.repos.d/download.devel.redhat.com_brewroot_repos_rhscl-{{ spec.rhscl_version.development }}-rh-postgresql{{ spec.version }}-rhel-7-build_latest_x86_64.repo && \ - {% elif spec.has_devel_repo.rhel == 'beta' %} - yum-config-manager --enable rhel-server-rhscl-7-beta-rpms && \ - {% endif %} - {% endif %} -{% endif %} - INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper {{ spec.pkgs }}" && \ + INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs {{ spec.pkgs }}" && \ {% endif %} {% if spec.version not in ["9.6", "10", "11"] %} INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ From 9fc49762994a55340259ea82e1360c7620ef7022 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Thu, 5 Sep 2024 13:27:45 +0200 Subject: [PATCH 09/13] Add generated files Signed-off-by: Petr "Stone" Hracek --- 12/Dockerfile.rhel8 | 2 +- 13/Dockerfile.c9s | 2 +- 13/Dockerfile.rhel8 | 2 +- 13/Dockerfile.rhel9 | 2 +- 15/Dockerfile.c9s | 2 +- 15/Dockerfile.rhel8 | 2 +- 15/Dockerfile.rhel9 | 2 +- 16/Dockerfile.c10s | 2 +- 16/Dockerfile.c9s | 2 +- 16/Dockerfile.rhel8 | 2 +- 16/Dockerfile.rhel9 | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/12/Dockerfile.rhel8 b/12/Dockerfile.rhel8 index 95bd17de..c37c48e5 100644 --- a/12/Dockerfile.rhel8 +++ b/12/Dockerfile.rhel8 @@ -43,7 +43,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # safe in the future. This should *never* change, the last test is there # to make sure of that. RUN yum -y module enable postgresql:12 && \ - INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server postgresql-contrib" && \ + INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs postgresql-server postgresql-contrib" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ diff --git a/13/Dockerfile.c9s b/13/Dockerfile.c9s index ab81c7bc..4b870a53 100644 --- a/13/Dockerfile.c9s +++ b/13/Dockerfile.c9s @@ -42,7 +42,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # safe in the future. This should *never* change, the last test is there # to make sure of that. RUN { yum -y module enable postgresql:13 || :; } && \ - INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server postgresql-contrib" && \ + INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs postgresql-server postgresql-contrib" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ diff --git a/13/Dockerfile.rhel8 b/13/Dockerfile.rhel8 index 93dae539..c736efdc 100644 --- a/13/Dockerfile.rhel8 +++ b/13/Dockerfile.rhel8 @@ -43,7 +43,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # safe in the future. This should *never* change, the last test is there # to make sure of that. RUN yum -y module enable postgresql:13 && \ - INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server postgresql-contrib" && \ + INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs postgresql-server postgresql-contrib" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ diff --git a/13/Dockerfile.rhel9 b/13/Dockerfile.rhel9 index 31ba1775..af4da6c6 100644 --- a/13/Dockerfile.rhel9 +++ b/13/Dockerfile.rhel9 @@ -43,7 +43,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # safe in the future. This should *never* change, the last test is there # to make sure of that. RUN { yum -y module enable postgresql:13 || :; } && \ - INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server postgresql-contrib" && \ + INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs postgresql-server postgresql-contrib" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ diff --git a/15/Dockerfile.c9s b/15/Dockerfile.c9s index b13e8303..e78d45b8 100644 --- a/15/Dockerfile.c9s +++ b/15/Dockerfile.c9s @@ -42,7 +42,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # safe in the future. This should *never* change, the last test is there # to make sure of that. RUN { yum -y module enable postgresql:15 || :; } && \ - INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server postgresql-contrib" && \ + INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs postgresql-server postgresql-contrib" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ diff --git a/15/Dockerfile.rhel8 b/15/Dockerfile.rhel8 index bb278bcb..302ee20f 100644 --- a/15/Dockerfile.rhel8 +++ b/15/Dockerfile.rhel8 @@ -43,7 +43,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # safe in the future. This should *never* change, the last test is there # to make sure of that. RUN yum -y module enable postgresql:15 && \ - INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server postgresql-contrib" && \ + INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs postgresql-server postgresql-contrib" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ diff --git a/15/Dockerfile.rhel9 b/15/Dockerfile.rhel9 index f59932a1..1a09870a 100644 --- a/15/Dockerfile.rhel9 +++ b/15/Dockerfile.rhel9 @@ -43,7 +43,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # safe in the future. This should *never* change, the last test is there # to make sure of that. RUN { yum -y module enable postgresql:15 || :; } && \ - INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server postgresql-contrib" && \ + INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs postgresql-server postgresql-contrib" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ diff --git a/16/Dockerfile.c10s b/16/Dockerfile.c10s index 8e6ce27b..c532efe7 100644 --- a/16/Dockerfile.c10s +++ b/16/Dockerfile.c10s @@ -41,7 +41,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # This image must forever use UID 26 for postgres user so our volumes are # safe in the future. This should *never* change, the last test is there # to make sure of that. -RUN INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server postgresql-contrib glibc-locale-source" && \ +RUN INSTALL_PKGS="rsync tar gettext-envsubst bind-utils nss_wrapper-libs postgresql-server postgresql-contrib glibc-locale-source" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ diff --git a/16/Dockerfile.c9s b/16/Dockerfile.c9s index b5f84829..9eaa70c3 100644 --- a/16/Dockerfile.c9s +++ b/16/Dockerfile.c9s @@ -42,7 +42,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # safe in the future. This should *never* change, the last test is there # to make sure of that. RUN { yum -y module enable postgresql:16 || :; } && \ - INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server postgresql-contrib" && \ + INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs postgresql-server postgresql-contrib" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ diff --git a/16/Dockerfile.rhel8 b/16/Dockerfile.rhel8 index adf4b0f4..caeb622d 100644 --- a/16/Dockerfile.rhel8 +++ b/16/Dockerfile.rhel8 @@ -43,7 +43,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # safe in the future. This should *never* change, the last test is there # to make sure of that. RUN yum -y module enable postgresql:16 && \ - INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server postgresql-contrib" && \ + INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs postgresql-server postgresql-contrib" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ diff --git a/16/Dockerfile.rhel9 b/16/Dockerfile.rhel9 index 030fa59b..e560842d 100644 --- a/16/Dockerfile.rhel9 +++ b/16/Dockerfile.rhel9 @@ -43,7 +43,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # safe in the future. This should *never* change, the last test is there # to make sure of that. RUN { yum -y module enable postgresql:16 || :; } && \ - INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper postgresql-server postgresql-contrib" && \ + INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs postgresql-server postgresql-contrib" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ From d39abb45fbfee6cdee8b18551b682d7e1bc6134c Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Tue, 10 Sep 2024 09:11:51 +0200 Subject: [PATCH 10/13] Add xz to C10S Dockerfile Signed-off-by: Petr "Stone" Hracek --- specs/multispec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/multispec.yml b/specs/multispec.yml index 69db1896..659b432c 100644 --- a/specs/multispec.yml +++ b/specs/multispec.yml @@ -74,7 +74,7 @@ specs: openshift_tags: "database,postgresql,postgresql{{ spec.short }},postgresql-{{ spec.short }}" redhat_component: "postgresql-{{ spec.short }}-container" img_name: "{{ spec.org }}/postgresql-{{ spec.short }}-{{ spec.prod }}" - pkgs: "postgresql-server postgresql-contrib glibc-locale-source" + pkgs: "postgresql-server postgresql-contrib glibc-locale-source xz" version: "12": From c57d4e7a17ef49c4578a96e689be2f3cca2548db Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Tue, 10 Sep 2024 09:12:08 +0200 Subject: [PATCH 11/13] Add generated sources Signed-off-by: Petr "Stone" Hracek --- 16/Dockerfile.c10s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/16/Dockerfile.c10s b/16/Dockerfile.c10s index c532efe7..4100459f 100644 --- a/16/Dockerfile.c10s +++ b/16/Dockerfile.c10s @@ -41,7 +41,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # This image must forever use UID 26 for postgres user so our volumes are # safe in the future. This should *never* change, the last test is there # to make sure of that. -RUN INSTALL_PKGS="rsync tar gettext-envsubst bind-utils nss_wrapper-libs postgresql-server postgresql-contrib glibc-locale-source" && \ +RUN INSTALL_PKGS="rsync tar gettext-envsubst bind-utils nss_wrapper-libs postgresql-server postgresql-contrib glibc-locale-source xz" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ From 5ae39e76fe160ecd2d98e5a0791c27cde4a5bf0c Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Fri, 13 Sep 2024 11:23:06 +0200 Subject: [PATCH 12/13] Let's use suffix names for C10S Signed-off-by: Petr "Stone" Hracek --- 16/Dockerfile.c10s | 7 ++++--- specs/multispec.yml | 3 ++- src/Dockerfile | 6 ++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/16/Dockerfile.c10s b/16/Dockerfile.c10s index 4100459f..7b0c9335 100644 --- a/16/Dockerfile.c10s +++ b/16/Dockerfile.c10s @@ -41,11 +41,12 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # This image must forever use UID 26 for postgres user so our volumes are # safe in the future. This should *never* change, the last test is there # to make sure of that. -RUN INSTALL_PKGS="rsync tar gettext-envsubst bind-utils nss_wrapper-libs postgresql-server postgresql-contrib glibc-locale-source xz" && \ +RUN INSTALL_PKGS="rsync tar gettext-envsubst bind-utils nss_wrapper-libs postgresql16-server postgresql16-contrib glibc-locale-source xz" && \ + PSQL_PKGS=postgresql16-server postgresql16-contrib glibc-locale-source xz && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ - yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ + yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS $PSQL_PKGS && \ + rpm -V $INSTALL_PKGS postgresql-server-16 postgresql-contrib-16 && \ postgres -V | grep -qe "$POSTGRESQL_VERSION\." && echo "Found VERSION $POSTGRESQL_VERSION" && \ yum -y clean all --enablerepo='*' && \ localedef -f UTF-8 -i en_US en_US.UTF-8 && \ diff --git a/specs/multispec.yml b/specs/multispec.yml index 659b432c..e45b97c1 100644 --- a/specs/multispec.yml +++ b/specs/multispec.yml @@ -74,7 +74,8 @@ specs: openshift_tags: "database,postgresql,postgresql{{ spec.short }},postgresql-{{ spec.short }}" redhat_component: "postgresql-{{ spec.short }}-container" img_name: "{{ spec.org }}/postgresql-{{ spec.short }}-{{ spec.prod }}" - pkgs: "postgresql-server postgresql-contrib glibc-locale-source xz" + pkgs: "postgresql{{ spec.short }}-server postgresql{{ spec.short }}-contrib glibc-locale-source xz" + check_pkgs: "postgresql-server-{{ spec.short }} postgresql-contrib-{{ spec.short }}" version: "12": diff --git a/src/Dockerfile b/src/Dockerfile index 0daebdaa..01eec376 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -57,6 +57,7 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions {% endif %} {% if spec.prod == "c10s" %} RUN INSTALL_PKGS="rsync tar gettext-envsubst bind-utils nss_wrapper-libs {{ spec.pkgs }}" && \ + PSQL_PKGS={{ spec.pkgs }} && \ {% else %} RUN {{ spec.environment_setup }} INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs {{ spec.pkgs }}" && \ @@ -65,8 +66,13 @@ RUN {{ spec.environment_setup }} INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ {% endif %} +{% if spec.prod == "c10s" %} + yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS $PSQL_PKGS && \ + rpm -V $INSTALL_PKGS {{ spec.check_pkgs }} && \ +{% else %} yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ +{% endif %} postgres -V | grep -qe "$POSTGRESQL_VERSION\." && echo "Found VERSION $POSTGRESQL_VERSION" && \ {% if spec.post_install %} {{ spec.post_install }} From 21c1929afd740cd59f50243685c05a26285d2a84 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Fri, 13 Sep 2024 12:47:11 +0200 Subject: [PATCH 13/13] Replace package nss_wrapper with nss_wrapper-libs Add PSQL_PKGS as alone variable Signed-off-by: Petr "Stone" Hracek --- 16/Dockerfile.c10s | 7 +++---- specs/multispec.yml | 4 ++-- src/Dockerfile | 6 ++++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/16/Dockerfile.c10s b/16/Dockerfile.c10s index 7b0c9335..388dcdb8 100644 --- a/16/Dockerfile.c10s +++ b/16/Dockerfile.c10s @@ -41,12 +41,11 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions # This image must forever use UID 26 for postgres user so our volumes are # safe in the future. This should *never* change, the last test is there # to make sure of that. -RUN INSTALL_PKGS="rsync tar gettext-envsubst bind-utils nss_wrapper-libs postgresql16-server postgresql16-contrib glibc-locale-source xz" && \ - PSQL_PKGS=postgresql16-server postgresql16-contrib glibc-locale-source xz && \ +RUN INSTALL_PKGS="rsync tar gettext-envsubst bind-utils nss_wrapper-libs glibc-locale-source xz" && \ + PSQL_PKGS="postgresql16-server postgresql16-contrib postgresql16-upgrade" && \ INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ - INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS $PSQL_PKGS && \ - rpm -V $INSTALL_PKGS postgresql-server-16 postgresql-contrib-16 && \ + rpm -V $INSTALL_PKGS postgresql-server postgresql-contrib postgresql-upgrade && \ postgres -V | grep -qe "$POSTGRESQL_VERSION\." && echo "Found VERSION $POSTGRESQL_VERSION" && \ yum -y clean all --enablerepo='*' && \ localedef -f UTF-8 -i en_US en_US.UTF-8 && \ diff --git a/specs/multispec.yml b/specs/multispec.yml index e45b97c1..4a36adcd 100644 --- a/specs/multispec.yml +++ b/specs/multispec.yml @@ -74,8 +74,8 @@ specs: openshift_tags: "database,postgresql,postgresql{{ spec.short }},postgresql-{{ spec.short }}" redhat_component: "postgresql-{{ spec.short }}-container" img_name: "{{ spec.org }}/postgresql-{{ spec.short }}-{{ spec.prod }}" - pkgs: "postgresql{{ spec.short }}-server postgresql{{ spec.short }}-contrib glibc-locale-source xz" - check_pkgs: "postgresql-server-{{ spec.short }} postgresql-contrib-{{ spec.short }}" + pkgs: "postgresql{{ spec.short }}-server postgresql{{ spec.short }}-contrib postgresql{{ spec.short }}-upgrade" + check_pkgs: "postgresql-server postgresql-contrib postgresql-upgrade" version: "12": diff --git a/src/Dockerfile b/src/Dockerfile index 01eec376..ac6e25f6 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -56,15 +56,17 @@ COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions {{ spec.repo_enable_reason }} {% endif %} {% if spec.prod == "c10s" %} -RUN INSTALL_PKGS="rsync tar gettext-envsubst bind-utils nss_wrapper-libs {{ spec.pkgs }}" && \ - PSQL_PKGS={{ spec.pkgs }} && \ +RUN INSTALL_PKGS="rsync tar gettext-envsubst bind-utils nss_wrapper-libs glibc-locale-source xz" && \ + PSQL_PKGS="{{ spec.pkgs }}" && \ {% else %} RUN {{ spec.environment_setup }} INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper-libs {{ spec.pkgs }}" && \ {% endif %} {% if spec.version not in ["9.6", "10", "11"] %} INSTALL_PKGS="$INSTALL_PKGS pgaudit" && \ + {% if spec.prod != "c10s" %} INSTALL_PKGS="$INSTALL_PKGS procps-ng util-linux postgresql-upgrade" && \ + {% endif %} {% endif %} {% if spec.prod == "c10s" %} yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS $PSQL_PKGS && \