From e9b6b345c829a0c11fe3489b343a57f1508cc3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Fei?= Date: Tue, 27 May 2025 16:54:39 +0200 Subject: [PATCH 1/3] chore: remove barman-cloud MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Niccolò Fei --- .github/workflows/build-commitfest.yml | 4 ++-- .github/workflows/build.yml | 6 +++--- .github/workflows/continuous-delivery.yml | 2 +- .github/workflows/reusable-e2e.yml | 5 ++++- Dockerfile | 12 ++---------- defaults.json | 2 +- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-commitfest.yml b/.github/workflows/build-commitfest.yml index 3fd6fc8..f0fb8fc 100644 --- a/.github/workflows/build-commitfest.yml +++ b/.github/workflows/build-commitfest.yml @@ -100,7 +100,7 @@ jobs: commitFestURL="https://commitfest.postgresql.org/patch/${commitFestPatchID}" images="${{ needs.build-pg.outputs.images }}" images_list="$(echo $images | tr ' ' '\n' | sed 's/^/https:\/\//')" - standardImage="$(echo $images | tr ' ' '\n' | grep standard)" + minimalImage="$(echo $images | tr ' ' '\n' | grep minimal)" echo "# Commitfest Image Build summary" >> $GITHUB_STEP_SUMMARY echo "**Commitfest Patch URL**: [$commitFestPatchID]($commitFestURL)" >> $GITHUB_STEP_SUMMARY @@ -116,7 +116,7 @@ jobs: echo "metadata:" >> $GITHUB_STEP_SUMMARY echo " name: commitfest-$commitFestPatchID" >> $GITHUB_STEP_SUMMARY echo "spec:" >> $GITHUB_STEP_SUMMARY - echo " imageName: $standardImage" >> $GITHUB_STEP_SUMMARY + echo " imageName: $minimalImage" >> $GITHUB_STEP_SUMMARY echo " instances: 3" >> $GITHUB_STEP_SUMMARY echo " storage:" >> $GITHUB_STEP_SUMMARY echo " size: 1Gi" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77d4388..220e830 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -98,13 +98,13 @@ jobs: pg_major="${{ needs.build-pg.outputs.pg_major }}" images="${{ needs.build-pg.outputs.images }}" images_list="$(echo $images | tr ' ' '\n' | sed 's/^/https:\/\//')" - standardImage="$(echo $images | tr ' ' '\n' | grep standard)" + minimalImage="$(echo $images | tr ' ' '\n' | grep minimal)" echo "# PostgreSQL Image Build summary" >> $GITHUB_STEP_SUMMARY echo "Here's the list of Container Images that have been built:" >> $GITHUB_STEP_SUMMARY echo "$images_list" >> $GITHUB_STEP_SUMMARY - echo "## CloudNativePG Cluster definition (example using the standard image)" >> $GITHUB_STEP_SUMMARY + echo "## CloudNativePG Cluster definition (example using the minimal image)" >> $GITHUB_STEP_SUMMARY echo "You can create a cluster in CloudNativePG running this image:" >> $GITHUB_STEP_SUMMARY echo "\`\`\`sh" >> $GITHUB_STEP_SUMMARY echo "(cat <> $GITHUB_STEP_SUMMARY @@ -113,7 +113,7 @@ jobs: echo "metadata:" >> $GITHUB_STEP_SUMMARY echo " name: pg-$pg_major-build" >> $GITHUB_STEP_SUMMARY echo "spec:" >> $GITHUB_STEP_SUMMARY - echo " imageName: $standardImage" >> $GITHUB_STEP_SUMMARY + echo " imageName: $minimalImage" >> $GITHUB_STEP_SUMMARY echo " instances: 3" >> $GITHUB_STEP_SUMMARY echo " storage:" >> $GITHUB_STEP_SUMMARY echo " size: 1Gi" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index 91d7ef3..c65d8b6 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -82,7 +82,7 @@ jobs: - name: Generated images id: images run: | - echo "PG_IMAGE=$(echo '${{ steps.build.outputs.metadata }}' | jq -r '.["standard"].["image.name"]' | grep -oP '[^,]*\d{12}[^,]*')" >> $GITHUB_ENV + echo "PG_IMAGE=$(echo '${{ steps.build.outputs.metadata }}' | jq -r '.["minimal"].["image.name"]' | grep -oP '[^,]*\d{12}[^,]*')" >> $GITHUB_ENV call-reusable-e2e: if: github.event_name == 'schedule' diff --git a/.github/workflows/reusable-e2e.yml b/.github/workflows/reusable-e2e.yml index 81b0218..2e6f0f2 100644 --- a/.github/workflows/reusable-e2e.yml +++ b/.github/workflows/reusable-e2e.yml @@ -146,11 +146,14 @@ jobs: docker push $E2E_PRE_ROLLING_UPDATE_IMG echo "E2E_PRE_ROLLING_UPDATE_IMG=$E2E_PRE_ROLLING_UPDATE_IMG" >> $GITHUB_ENV - - name: Setting up default versions + - name: Setting up defaults run: | # Update pkg/versions/versions.go sed -i '/DefaultImageName *=/s@".*"@"'"${{ inputs.postgres_img }}"'"@' pkg/versions/versions.go + # Exlude backup/recovery tests + FEATURE_TYPE="${{ env.FEATURE_TYPE }},!backup-restore" + - name: Run Kind End-to-End tests run: make e2e-test-kind diff --git a/Dockerfile b/Dockerfile index b084496..e449e1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,6 @@ RUN apt-get update && \ gnupg \ dirmngr \ ca-certificates \ - locales-all \ ssl-cert \ libnss-wrapper \ libgssapi-krb5-2 \ @@ -127,16 +126,9 @@ FROM build-layer AS standard # make install USE_PGXS=1 PG_CONFIG=/usr/lib/postgresql/$PG_MAJOR/bin/pg_config && \ # rm -rf /usr/src/pgaudit -# Install barman-cloud +# Install all locales RUN apt-get update && \ - /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && \ - apt-get install -y --no-install-recommends \ - python3-pip \ - python3-psycopg2 \ - python3-setuptools \ - && \ - pip3 install --break-system-packages --upgrade pip && \ - pip3 install --break-system-packages barman[cloud,azure,google,snappy,zstandard,lz4]==3.13.2 + apt-get install -y --no-install-recommends locales-all RUN apt-get purge -y --auto-remove $(cat /build-deps.txt) && \ rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/* diff --git a/defaults.json b/defaults.json index 67f09b3..47ba3f3 100644 --- a/defaults.json +++ b/defaults.json @@ -1,5 +1,5 @@ { - "PG_IMAGE": "ghcr.io/cloudnative-pg/postgresql-trunk:18-standard-bookworm", + "PG_IMAGE": "ghcr.io/cloudnative-pg/postgresql-trunk:18-minimal-bookworm", "PG_MAJOR": 18, "CNPG_BRANCH": "main", "TEST_DEPTH": 4, From 215e5360ecc38e018557f7654a73db1d653afddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Fei?= Date: Thu, 5 Jun 2025 14:12:59 +0200 Subject: [PATCH 2/3] chore: fix env variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Niccolò Fei --- .github/workflows/reusable-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-e2e.yml b/.github/workflows/reusable-e2e.yml index 2e6f0f2..1a354ab 100644 --- a/.github/workflows/reusable-e2e.yml +++ b/.github/workflows/reusable-e2e.yml @@ -152,7 +152,7 @@ jobs: sed -i '/DefaultImageName *=/s@".*"@"'"${{ inputs.postgres_img }}"'"@' pkg/versions/versions.go # Exlude backup/recovery tests - FEATURE_TYPE="${{ env.FEATURE_TYPE }},!backup-restore" + echo "FEATURE_TYPE=${{ env.FEATURE_TYPE }},!backup-restore" >> $GITHUB_ENV - name: Run Kind End-to-End tests run: make e2e-test-kind From f73db70eaf2e9386013785773d93524c550b7472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Fei?= Date: Fri, 6 Jun 2025 12:56:59 +0200 Subject: [PATCH 3/3] fix: properly define FEATURE_TYPE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Niccolò Fei --- .github/workflows/reusable-e2e.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-e2e.yml b/.github/workflows/reusable-e2e.yml index 1a354ab..e573b26 100644 --- a/.github/workflows/reusable-e2e.yml +++ b/.github/workflows/reusable-e2e.yml @@ -152,7 +152,11 @@ jobs: sed -i '/DefaultImageName *=/s@".*"@"'"${{ inputs.postgres_img }}"'"@' pkg/versions/versions.go # Exlude backup/recovery tests - echo "FEATURE_TYPE=${{ env.FEATURE_TYPE }},!backup-restore" >> $GITHUB_ENV + if [ -z "${{ env.FEATURE_TYPE }}" ]; then + echo "FEATURE_TYPE=!backup-restore" >> $GITHUB_ENV + else + echo "FEATURE_TYPE=${{ env.FEATURE_TYPE }},!backup-restore" >> $GITHUB_ENV + fi - name: Run Kind End-to-End tests run: make e2e-test-kind