mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
wal-g: Use pre-built aarch64 binary, rather than building from source.
Starting with wal-g 2.0.1, they provide `aarch64` assets[^1].
Effectively revert d7b59c86ce, and use
the pre-built binary for `aarch64` rather than spend a bunch of space
and time having to build it from source.
[^1]: https://github.com/wal-g/wal-g/releases/tag/v2.0.1
This commit is contained in:
committed by
Alex Vandiver
parent
8f6f38c97c
commit
89f20140c0
@@ -76,13 +76,11 @@ class zulip::common {
|
|||||||
|
|
||||||
# https://github.com/wal-g/wal-g/releases
|
# https://github.com/wal-g/wal-g/releases
|
||||||
'wal-g' => {
|
'wal-g' => {
|
||||||
'version' => '2.0.1',
|
'version' => '2.0.1',
|
||||||
'sha256' => {
|
'sha256' => {
|
||||||
'amd64' => '2640cb9110e802bf971efdc9b7a35515af7757e06693bf5c81bd4915d8d42b9c',
|
'amd64' => '2640cb9110e802bf971efdc9b7a35515af7757e06693bf5c81bd4915d8d42b9c',
|
||||||
# aarch64 builds from source, below
|
'aarch64' => '9782bd6f4f08ec26d0f2f5f8fd8f9531e4fe39f14ef5f764cbec08e93da2bbcc',
|
||||||
},
|
},
|
||||||
# This is a Git commit hash, not a sha256sum, for when building from source.
|
|
||||||
'git_commit_id' => 'b7d53dd74d92dd92dce224190361ad0607d680e2',
|
|
||||||
},
|
},
|
||||||
|
|
||||||
### zulip_ops packages
|
### zulip_ops packages
|
||||||
|
|||||||
@@ -2,52 +2,19 @@
|
|||||||
#
|
#
|
||||||
class zulip::wal_g {
|
class zulip::wal_g {
|
||||||
$wal_g_version = $zulip::common::versions['wal-g']['version']
|
$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}"
|
$bin = "/srv/zulip-wal-g-${wal_g_version}"
|
||||||
|
|
||||||
if $wal_g_binary_hash != undef {
|
$package = "wal-g-pg-ubuntu-20.04-${zulip::common::goarch}"
|
||||||
# We have a binary for this arch
|
# This tarball contains only a single file, which is extracted as $bin
|
||||||
$package = "wal-g-pg-ubuntu-20.04-${zulip::common::goarch}"
|
zulip::external_dep { 'wal-g':
|
||||||
# This tarball contains only a single file, which is extracted as $bin
|
version => $wal_g_version,
|
||||||
zulip::external_dep { 'wal-g':
|
url => "https://github.com/wal-g/wal-g/releases/download/v${wal_g_version}/${package}.tar.gz",
|
||||||
version => $wal_g_version,
|
tarball_prefix => $package,
|
||||||
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'],
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
file { '/usr/local/bin/wal-g':
|
file { '/usr/local/bin/wal-g':
|
||||||
ensure => link,
|
ensure => link,
|
||||||
target => $bin,
|
target => $bin,
|
||||||
|
require => Zulip::External_Dep['wal-g'],
|
||||||
}
|
}
|
||||||
# We used to install versions into /usr/local/bin/wal-g-VERSION,
|
# We used to install versions into /usr/local/bin/wal-g-VERSION,
|
||||||
# until we moved to using Zulip::External_Dep which places them in
|
# until we moved to using Zulip::External_Dep which places them in
|
||||||
|
|||||||
@@ -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"
|
|
||||||
Reference in New Issue
Block a user