From d12e65abed0cacafb8cf74f74be8be9b979b46b5 Mon Sep 17 00:00:00 2001 From: Polina Bungina <27892524+hughcapet@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:10:52 +0300 Subject: [PATCH] Install wal-g from a precompiled bin (#1006) - decrease build time - fix the problem of missing brotli compression type after upgrade to WAL-G v3 --- .../build_scripts/dependencies.sh | 38 ++++++------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/postgres-appliance/build_scripts/dependencies.sh b/postgres-appliance/build_scripts/dependencies.sh index c3bbf4ca6..07385379c 100644 --- a/postgres-appliance/build_scripts/dependencies.sh +++ b/postgres-appliance/build_scripts/dependencies.sh @@ -18,36 +18,22 @@ MAKEFLAGS="-j $(grep -c ^processor /proc/cpuinfo)" export MAKEFLAGS ARCH="$(dpkg --print-architecture)" +# We want to remove all libgdal30 debs except one that is for current architecture. +printf "shopt -s extglob\nrm /builddeps/!(*_%s.deb)" "$ARCH" | bash -s + echo -e 'APT::Install-Recommends "0";\nAPT::Install-Suggests "0";' > /etc/apt/apt.conf.d/01norecommend apt-get update apt-get install -y curl ca-certificates -apt-get install -y software-properties-common gpg-agent -add-apt-repository ppa:longsleep/golang-backports -apt-get update -apt-get install -y golang-go liblzo2-dev brotli libsodium-dev git make cmake gcc libc-dev -go version - -git clone -b "$WALG_VERSION" --recurse-submodules https://github.com/wal-g/wal-g.git -cd /wal-g -go get -v -t -d ./... -go mod vendor - -bash link_brotli.sh - -sed -i -e 's/1.0.17/1.0.18/g' link_libsodium.sh -sed -i -e "s/download\/\$LIBSODIUM_VERSION/download\/\$LIBSODIUM_VERSION-RELEASE/g" link_libsodium.sh - -bash link_libsodium.sh - -export USE_LIBSODIUM=1 -export USE_LZO=1 -make pg_build - -# We want to remove all libgdal30 debs except one that is for current architecture. -printf "shopt -s extglob\nrm /builddeps/!(*_%s.deb)" "$ARCH" | bash -s - mkdir /builddeps/wal-g -cp /wal-g/main/pg/wal-g /builddeps/wal-g/ +if [ "$ARCH" = "amd64" ]; then + PKG_NAME='wal-g-pg-ubuntu-20.04-amd64' +else + PKG_NAME='wal-g-pg-ubuntu20.04-aarch64' +fi + +curl -sL "https://github.com/wal-g/wal-g/releases/download/$WALG_VERSION/$PKG_NAME.tar.gz" \ + | tar -C /builddeps/wal-g -xz +mv "/builddeps/wal-g/$PKG_NAME" /builddeps/wal-g/wal-g