Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
wal-g: Use pre-built aarch64 binary, rather than building from source.
Alex Vandiver89f20140c0e6
diff --git a/puppet/zulip/manifests/common.pp b/puppet/zulip/manifests/common.ppindex 6f504b2bf4a..cfc8e302f8c 100644--- a/puppet/zulip/manifests/common.pp+++ b/puppet/zulip/manifests/common.pp@@ -76,13 +76,11 @@ class zulip::common {# https://github.com/wal-g/wal-g/releases'wal-g' => {- 'version' => '2.0.1',- 'sha256' => {- 'amd64' => '2640cb9110e802bf971efdc9b7a35515af7757e06693bf5c81bd4915d8d42b9c',- # aarch64 builds from source, below+ 'version' => '2.0.1',+ 'sha256' => {+ 'amd64' => '2640cb9110e802bf971efdc9b7a35515af7757e06693bf5c81bd4915d8d42b9c',+ 'aarch64' => '9782bd6f4f08ec26d0f2f5f8fd8f9531e4fe39f14ef5f764cbec08e93da2bbcc',},- # This is a Git commit hash, not a sha256sum, for when building from source.- 'git_commit_id' => 'b7d53dd74d92dd92dce224190361ad0607d680e2',},### zulip_ops packagesdiff --git a/puppet/zulip/manifests/wal_g.pp b/puppet/zulip/manifests/wal_g.ppindex a644e85211d..07556d22d4c 100644--- a/puppet/zulip/manifests/wal_g.pp+++ b/puppet/zulip/manifests/wal_g.pp@@ -2,52 +2,19 @@#class zulip::wal_g {$wal_g_version = $zulip::common::versions['wal-g']['version']- $wal_g_binary_hash = $zulip::common::versions['wal-g']['sha256'][$::os['architecture']]- $wal_g_commit_id = $zulip::common::versions['wal-g']['git_commit_id']$bin = "/srv/zulip-wal-g-${wal_g_version}"- if $wal_g_binary_hash != undef {- # We have a binary for this arch- $package = "wal-g-pg-ubuntu-20.04-${zulip::common::goarch}"- # This tarball contains only a single file, which is extracted as $bin- zulip::external_dep { 'wal-g':- version => $wal_g_version,- url => "https://github.com/wal-g/wal-g/releases/download/v${wal_g_version}/${package}.tar.gz",- tarball_prefix => $package,- before => File['/usr/local/bin/wal-g'],- }- } else {- include zulip::golang- $source_dir = "/srv/zulip-wal-g-src-${wal_g_version}"- exec { 'clone wal-g':- command => "git clone https://github.com/wal-g/wal-g.git --branch v${wal_g_version} ${source_dir}",- cwd => '/srv',- creates => $source_dir,- require => Package['git'],- }- exec { 'compile wal-g':- command => "${::zulip_scripts_path}/lib/build-wal-g ${wal_g_version} ${wal_g_commit_id}",- environment => ["GOBIN=${zulip::golang::dir}/bin"],- cwd => $source_dir,- creates => $bin,- require => [- Zulip::External_Dep['golang'],- Exec['clone wal-g'],- ],- timeout => 600,- before => File['/usr/local/bin/wal-g'],- }- tidy { '/srv/zulip-wal-g-*':- path => '/srv/',- recurse => 1,- rmdirs => true,- matches => 'zulip-wal-g-*',- require => Exec['compile wal-g'],- }+ $package = "wal-g-pg-ubuntu-20.04-${zulip::common::goarch}"+ # This tarball contains only a single file, which is extracted as $bin+ zulip::external_dep { 'wal-g':+ version => $wal_g_version,+ url => "https://github.com/wal-g/wal-g/releases/download/v${wal_g_version}/${package}.tar.gz",+ tarball_prefix => $package,}file { '/usr/local/bin/wal-g':- ensure => link,- target => $bin,+ ensure => link,+ target => $bin,+ require => Zulip::External_Dep['wal-g'],}# We used to install versions into /usr/local/bin/wal-g-VERSION,# until we moved to using Zulip::External_Dep which places them indiff --git a/scripts/lib/build-wal-g b/scripts/lib/build-wal-gdeleted file mode 100755index 4e037245cb3..00000000000--- a/scripts/lib/build-wal-g+++ /dev/null@@ -1,35 +0,0 @@-#!/usr/bin/env bash--set -eux--apt-get install -y \- liblzo2-dev \- libbrotli-dev \- libsodium-dev \- build-essential \- gcc \- cmake \- libc-dev--tmpdir="$(mktemp -d)"-trap 'rm -r "$tmpdir"' EXIT--export GOCACHE="$tmpdir/cache"-export GOPATH="$tmpdir/build"--src_dir="/srv/zulip-wal-g-src-$1"-dst="/srv/zulip-wal-g-$1"--cd "$src_dir"--if [ "$(git rev-parse HEAD)" != "$2" ]; then- echo "Commit tag has changed; expected $2, got $(git rev-parse HEAD)"- exit 1-fi--export PATH="$PATH:$GOBIN"-export USE_LZO=1-export USE_LIBSODIUM=1-make deps pg_build--mv "main/pg/wal-g" "$dst"