From d87b0be061d1e0bfa7f6fa80642615bfa475f2fe Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Wed, 6 Jul 2022 07:36:57 +0200 Subject: [PATCH 1/3] gitaly: Stop installing PgBouncer Gitaly is using PgBouncer in its CI pipelines to verify that Praefect works alright with this proxy for Postgres. While it was initially using the PgBouncer binary directly, the project has since migrate to set up PgBouncer as a service via a separate image in 0e5953177 (ci: Tie in PgBouncer as a service, 2021-12-03). Since then the PgBouncer executable is not needed anymore in the image used by Gitaly. Stop installing PgBouncer and remove the architecture we have to build and install it. --- .gitlab/ci/gitaly.images.yml | 1 - Dockerfile.custom | 7 ------- README.md | 1 - scripts/install-pgbouncer | 18 ------------------ scripts/lib/custom-docker-build | 14 -------------- scripts/lib/custom-docker.sh | 6 ++---- 6 files changed, 2 insertions(+), 45 deletions(-) delete mode 100755 scripts/install-pgbouncer diff --git a/.gitlab/ci/gitaly.images.yml b/.gitlab/ci/gitaly.images.yml index 867c21c..856a7de 100644 --- a/.gitlab/ci/gitaly.images.yml +++ b/.gitlab/ci/gitaly.images.yml @@ -10,5 +10,4 @@ gitaly: RUBY: ['2.7', '3.0'] GOLANG: ['1.17', '1.18'] GIT: ['2.33'] - PGBOUNCER: ['1.14', ''] POSTGRESQL: ['11', '12', '13'] # We only use the postgresql-client diff --git a/Dockerfile.custom b/Dockerfile.custom index 90065f6..9adc458 100644 --- a/Dockerfile.custom +++ b/Dockerfile.custom @@ -79,12 +79,6 @@ ARG BUILDX_DOWNLOAD_SHA256 RUN if [ -n "$BUILDX_VERSION" ]; then /scripts/install-buildx $BUILDX_VERSION $BUILDX_DOWNLOAD_SHA256; fi -# PgBouncer -ARG PGBOUNCER_VERSION -ARG PGBOUNCER_DOWNLOAD_SHA256 - -RUN if [ -n "$PGBOUNCER_VERSION" ] ; then /scripts/install-pgbouncer $PGBOUNCER_VERSION $PGBOUNCER_DOWNLOAD_SHA256; fi - # Bazelisk ARG BAZELISK_VERSION ARG BAZELISK_DOWNLOAD_SHA256 @@ -127,7 +121,6 @@ ENV RUBY_VERSION=${RUBY_VERSION} \ POSTGRES_VERSION=${POSTGRES_VERSION} \ GRAPHISMAGICK_VERSION=${GRAPHISMAGICK_VERSION} \ DOCKER_VERSION=${DOCKER_VERSION} \ - PGBOUNCER_VERSION=${PGBOUNCER_VERSION} \ BAZELISK_VERSION=${BAZELISK_VERSION} \ GCLOUD_VERSION=${GCLOUD_VERSION} \ KUBECTL_VERSION=${KUBECTL_VERSION} \ diff --git a/README.md b/README.md index 3036baf..1a0c778 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,6 @@ options are: 1. `graphicsmagick` 1. `lfs` 1. `node` -1. `pgbouncer` 1. `postgresql` 1. `ruby` 1. `yarn` diff --git a/scripts/install-pgbouncer b/scripts/install-pgbouncer deleted file mode 100755 index 9c7c35f..0000000 --- a/scripts/install-pgbouncer +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -xeuo pipefail - -PGBOUNCER_VERSION=${1} -PGBOUNCER_DOWNLOAD_SHA256=${2} -PGBOUNCER_DOWNLOAD_URL="https://pgbouncer.github.io/downloads/files/$PGBOUNCER_VERSION/pgbouncer-$PGBOUNCER_VERSION.tar.gz" - -curl -o pgbouncer.tar.gz -fsSL $PGBOUNCER_DOWNLOAD_URL \ - && echo "${PGBOUNCER_DOWNLOAD_SHA256} pgbouncer.tar.gz" | sha256sum -c - \ - && tar xfz pgbouncer.tar.gz \ - && rm -f pgbouncer.tar.gz \ - && cd pgbouncer-${PGBOUNCER_VERSION} \ - && ./configure --prefix=/usr/local \ - && make \ - && cp pgbouncer /usr/local/bin \ - && cd .. \ - && rm -rf pgbouncer-${PGBOUNCER_VERSION} diff --git a/scripts/lib/custom-docker-build b/scripts/lib/custom-docker-build index e045d4a..a5056d6 100755 --- a/scripts/lib/custom-docker-build +++ b/scripts/lib/custom-docker-build @@ -172,19 +172,6 @@ function print_graphicsmagick_args() { printf -- "--build-arg GRAPHISMAGICK_DOWNLOAD_SHA256=%s " "$GRAPHISMAGICK_DOWNLOAD_SHA256" } -function print_pgbouncer_args() { - case "$1" in - 1.14) - PGBOUNCER_VERSION=1.14.0 - PGBOUNCER_DOWNLOAD_SHA256=a0c13d10148f557e36ff7ed31793abb7a49e1f8b09aa2d4695d1c28fa101fee7 - ;; - *) echo "Unknown pgbouncer version $1"; exit 1; - esac - - printf -- "--build-arg PGBOUNCER_VERSION=%s " "$PGBOUNCER_VERSION" - printf -- "--build-arg PGBOUNCER_DOWNLOAD_SHA256=%s " "$PGBOUNCER_DOWNLOAD_SHA256" -} - function print_bazelisk_args() { case "$1" in 1.9.0) @@ -340,7 +327,6 @@ function parse_arguments() { YARN) print_yarn_args $version ;; POSTGRESQL) print_postgres_args $version ;; GRAPHICSMAGICK) print_graphicsmagick_args $version ;; - PGBOUNCER) print_pgbouncer_args $version ;; BAZELISK) print_bazelisk_args $version ;; GCLOUD) print_gcloud_args $version ;; KUBECTL) print_kubectl_args $version ;; diff --git a/scripts/lib/custom-docker.sh b/scripts/lib/custom-docker.sh index 57ddc8e..b64a877 100644 --- a/scripts/lib/custom-docker.sh +++ b/scripts/lib/custom-docker.sh @@ -2,7 +2,7 @@ # various variable operations used in this script. PATH_TOOLS=(OS RUBY GOLANG NODE POSTGRESQL) -TAG_TOOLS=(BUNDLER RUBYGEMS GIT LFS CHROME YARN GRAPHICSMAGICK PGBOUNCER BAZELISK DOCKER BUILDX GCLOUD KUBECTL HELM) +TAG_TOOLS=(BUNDLER RUBYGEMS GIT LFS CHROME YARN GRAPHICSMAGICK BAZELISK DOCKER BUILDX GCLOUD KUBECTL HELM) # Generate the docker image path using the components that were specified via # variables. @@ -11,7 +11,6 @@ TAG_TOOLS=(BUNDLER RUBYGEMS GIT LFS CHROME YARN GRAPHICSMAGICK PGBOUNCER BAZELIS # RUBY: 2.7 # GOLANG: 1.16 # GIT: 2.33 -# PGBOUNCER: 1.14 # POSTGRESQL: 11 # With the above variables, this function will return # `debian-bullseye-ruby-2.7-golang-1.16-postgresql-11` @@ -46,10 +45,9 @@ function get_image_path() { # RUBY: 2.7 # GOLANG: 1.16 # GIT: 2.33 -# PGBOUNCER: 1.14 # POSTGRESQL: 11 # For that job, this function will return -# `git-2.33-pgbouncer-1.14` +# `git-2.33` function get_image_tag() { local tag tag="" From 2e13e8067c127a5a8afb7808c84ec97ef0310261 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Wed, 6 Jul 2022 07:37:33 +0200 Subject: [PATCH 2/3] gitaly: Remove Postgres client from Gitaly images We're currently building Gitaly images with three different Postgres versions. Ultimately though, Gitaly doesn't need Postgres installed in its images at all: the Postgres server is tied in as a service, and the only CI job that uses the the Postgres client is using a different image anyway. One part that had been using the Postgres client in the past was the logic to wait for Postgres to come up. But this has been migrated to instead rely on the health-checking logic provided by CI services in f89ffa3dc (ci: Stop waiting for Postgres manually, 2022-06-14) Stop installing Postgres in Gitaly images to reduce the number of images built. --- .gitlab/ci/gitaly.images.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab/ci/gitaly.images.yml b/.gitlab/ci/gitaly.images.yml index 856a7de..cf4c1d2 100644 --- a/.gitlab/ci/gitaly.images.yml +++ b/.gitlab/ci/gitaly.images.yml @@ -10,4 +10,3 @@ gitaly: RUBY: ['2.7', '3.0'] GOLANG: ['1.17', '1.18'] GIT: ['2.33'] - POSTGRESQL: ['11', '12', '13'] # We only use the postgresql-client From 54aeca330831758c18881203b10dae10fa2884fd Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Wed, 6 Jul 2022 07:41:28 +0200 Subject: [PATCH 3/3] gitaly: Update Git version to v2.36.0 Update the Git version to v2.36.0. While Gitaly doesn't rely on the Git version at all anymore, it feels like the right thing to do to update it to something more current than v2.33.0. --- .gitlab/ci/gitaly.images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/ci/gitaly.images.yml b/.gitlab/ci/gitaly.images.yml index cf4c1d2..315f338 100644 --- a/.gitlab/ci/gitaly.images.yml +++ b/.gitlab/ci/gitaly.images.yml @@ -9,4 +9,4 @@ gitaly: - OS: ['debian:bullseye'] RUBY: ['2.7', '3.0'] GOLANG: ['1.17', '1.18'] - GIT: ['2.33'] + GIT: ['2.36']