Skip to content

Commit

Permalink
Update WAL-G to v1.1 (#588)
Browse files Browse the repository at this point in the history
WAL-G has a new stable release that game out a few days ago.

https://github.com/wal-g/wal-g/releases/tag/v1.1

This commit does the following:

* Updates the Dockerfile to use the new v1.1 release.
* Adds the new Azure functionality provided in this release.
* Adds compatibility with v1.0+ to clone_with_wale.py
  • Loading branch information
apeschel authored Aug 26, 2021
1 parent 2096200 commit 9f07dc5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
14 changes: 13 additions & 1 deletion ENVIRONMENT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,19 @@ In case of S3, `wal-e` is used for backups and `wal-g` for restore.

- **USE_WALG_BACKUP**: (optional) Enforce using `wal-g` instead of `wal-e` for backups (Boolean)
- **USE_WALG_RESTORE**: (optional) Enforce using `wal-g` instead of `wal-e` for restores (Boolean)
- **WALG_AZ_PREFIX**: (optional) the azure prefix to store WAL backups at in the format azure://test-container/walg-folder.

- **WALG_DELTA_MAX_STEPS**, **WALG_DELTA_ORIGIN**, **WALG_DOWNLOAD_CONCURRENCY**, **WALG_UPLOAD_CONCURRENCY**, **WALG_UPLOAD_DISK_CONCURRENCY**: (optional) configuration options for wal-g.
- **WALG_S3_CA_CERT_FILE**: (optional) TLS CA certificate for wal-g (see [wal-g configuration](https://github.com/wal-g/wal-g#configuration))
- **WALG_SSH_PREFIX**: (optional) the ssh prefix to store WAL backups at in the format ssh://host.example.com/path/to/backups/ See `Wal-g <https://github.com/wal-g/wal-g#configuration>`__ documentation for details.

Azure Specific WAL-G Configuration
`````

For more inforamation on the Azure specific options, refer to https://github.com/wal-g/wal-g/blob/master/docs/STORAGES.md#azure

- **WALG_AZ_PREFIX**: Enables Azure Backups. The azure prefix to store WAL backups at in the format azure://test-container/walg-folder.
- **AZURE_STORAGE_ACCOUNT**
- **AZURE_STORAGE_ACCESS_KEY**
- **AZURE_STORAGE_SAS_TOKEN**
- **WALG_AZURE_BUFFER_SIZE**
- **WALG_AZURE_MAX_BUFFERS**
6 changes: 4 additions & 2 deletions postgres-appliance/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
# Install patroni, wal-e and wal-g
ENV PATRONIVERSION=2.1.1
ENV WALE_VERSION=1.1.1
ENV WALG_VERSION=v0.2.19
ENV WALG_VERSION=v1.1
RUN export DEBIAN_FRONTEND=noninteractive \
&& set -ex \
&& BUILD_PACKAGES="python3-pip python3-wheel python3-dev git patchutils binutils" \
Expand All @@ -365,8 +365,10 @@ RUN export DEBIAN_FRONTEND=noninteractive \
\
&& if [ "$DEMO" != "true" ]; then \
EXTRAS=",etcd,consul,zookeeper,aws" \
&& curl -sL https://github.com/wal-g/wal-g/releases/download/$WALG_VERSION/wal-g.linux-amd64.tar.gz \
&& DISTRIB_RELEASE=$(sed -n 's/DISTRIB_RELEASE=//p' /etc/lsb-release) \
&& curl -sL https://github.com/wal-g/wal-g/releases/download/$WALG_VERSION/wal-g-pg-ubuntu-$DISTRIB_RELEASE-amd64.tar.gz \
| tar -C /usr/local/bin -xz \
&& mv /usr/local/bin/wal-g-pg-ubuntu-$DISTRIB_RELEASE-amd64 /usr/local/bin/wal-g \
&& strip /usr/local/bin/wal-g \
&& apt-get install -y python3-etcd python3-consul python3-kazoo python3-meld3 \
python3-boto python3-gevent python3-greenlet python3-cachetools \
Expand Down
3 changes: 3 additions & 0 deletions postgres-appliance/bootstrap/clone_with_wale.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def fix_output(output):
for line in output.decode('utf-8').splitlines():
if not started:
started = re.match(r'^name\s+last_modified\s+', line)
started = re.match(r'^name\s+last_modified\s+', line) or re.match(r'^name\s+modified\s+', line)
if started:
line = line.replace(' modified ', ' last_modified ')
if started:
yield '\t'.join(line.split())

Expand Down
3 changes: 2 additions & 1 deletion postgres-appliance/scripts/configure_spilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,8 @@ def write_wale_environment(placeholders, prefix, overwrite):
s3_names = ['WALE_S3_PREFIX', 'WALG_S3_PREFIX', 'AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY',
'WALE_S3_ENDPOINT', 'AWS_ENDPOINT', 'AWS_REGION', 'AWS_INSTANCE_PROFILE',
'WALG_S3_SSE_KMS_ID', 'WALG_S3_SSE', 'WALG_DISABLE_S3_SSE', 'AWS_S3_FORCE_PATH_STYLE']
azure_names = ['WALG_AZ_PREFIX', 'AZURE_STORAGE_ACCOUNT', 'AZURE_STORAGE_ACCESS_KEY']
azure_names = ['WALG_AZ_PREFIX', 'AZURE_STORAGE_ACCOUNT', 'AZURE_STORAGE_ACCESS_KEY',
'AZURE_STORAGE_SAS_TOKEN', 'WALG_AZURE_BUFFER_SIZE', 'WALG_AZURE_MAX_BUFFERS']
gs_names = ['WALE_GS_PREFIX', 'WALG_GS_PREFIX', 'GOOGLE_APPLICATION_CREDENTIALS']
swift_names = ['WALE_SWIFT_PREFIX', 'SWIFT_AUTHURL', 'SWIFT_TENANT', 'SWIFT_TENANT_ID', 'SWIFT_USER',
'SWIFT_USER_ID', 'SWIFT_USER_DOMAIN_NAME', 'SWIFT_USER_DOMAIN_ID', 'SWIFT_PASSWORD',
Expand Down

0 comments on commit 9f07dc5

Please sign in to comment.