Skip to content

Commit 2f6b03c

Browse files
authored
refactor: Remove wal-g v3 and simplify build (#1937)
* refactor: Remove wal-g v3 and simplify build - Removes the `wal-g-3` Nix package definition and all associated build/installation steps from Dockerfiles and Ansible playbooks. - Standardizes on `wal-g-2` as the sole WAL-G version used, simplifying the build process and reducing complexity. - Cleans up related checks and package definitions in Nix. * chore: Add wal-g nix garbage collection - Executes `nix-collect-garbage -d` after installing wal-g via nix profile. - This ensures cleanup of the Nix store, freeing up disk space. * chore: Update apt cache for Pgbouncer dependencies Removes `cache_valid_time: 3600` from the apt task for Pgbouncer dependencies. This ensures that `apt update` is executed every time the playbook runs, guaranteeing the system fetches the latest package lists before installing Pgbouncer and its dependencies. This prevents potential installation failures caused by an outdated package cache. * chore: Update PostgreSQL release versions Removes the `-INDATA257` suffix from the PostgreSQL release version strings in `ansible/vars.yml`. This aligns the versions closer to standard upstream releases.
1 parent a7327e0 commit 2f6b03c

File tree

9 files changed

+4
-73
lines changed

9 files changed

+4
-73
lines changed

Dockerfile-15

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,6 @@ RUN bash -c 'source /usr/local/bin/apt-update-fallback.sh && apt_update_with_fal
159159

160160
ENV PGDATA=/var/lib/postgresql/data
161161

162-
####################
163-
# setup-wal-g.yml
164-
####################
165-
FROM base as walg
166-
ARG wal_g_release
167-
WORKDIR /nixpg
168-
169-
RUN nix profile install .#wal-g-3 && \
170-
ln -s /nix/var/nix/profiles/default/bin/wal-g-3 /tmp/wal-g
171-
172-
RUN nix store gc
173-
174162
WORKDIR /
175163
####################
176164
# setup-groonga
@@ -215,7 +203,6 @@ RUN gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys $GOSU_GPG_KEY &&
215203
FROM gosu as production
216204
RUN id postgres || (echo "postgres user does not exist" && exit 1)
217205
# # Setup extensions
218-
COPY --from=walg /tmp/wal-g /usr/local/bin/
219206
COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins
220207

221208
# # Initialise configs

Dockerfile-17

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,6 @@ RUN bash -c 'source /usr/local/bin/apt-update-fallback.sh && apt_update_with_fal
163163

164164
ENV PGDATA=/var/lib/postgresql/data
165165

166-
####################
167-
# setup-wal-g.yml
168-
####################
169-
FROM base as walg
170-
ARG wal_g_release
171-
172-
WORKDIR /nixpg
173-
174-
RUN nix profile install .#wal-g-3 && \
175-
ln -s /nix/var/nix/profiles/default/bin/wal-g-3 /tmp/wal-g
176-
177-
RUN nix store gc
178-
179166
WORKDIR /
180167
####################
181168
# setup-groonga
@@ -220,7 +207,6 @@ RUN gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys $GOSU_GPG_KEY &&
220207
FROM gosu as production
221208
RUN id postgres || (echo "postgres user does not exist" && exit 1)
222209
# # Setup extensions
223-
COPY --from=walg /tmp/wal-g /usr/local/bin/
224210
COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins
225211

226212
# # Initialise configs

Dockerfile-orioledb-17

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,6 @@ RUN bash -c 'source /usr/local/bin/apt-update-fallback.sh && apt_update_with_fal
163163

164164
ENV PGDATA=/var/lib/postgresql/data
165165

166-
####################
167-
# setup-wal-g.yml
168-
####################
169-
FROM base as walg
170-
ARG wal_g_release
171-
172-
WORKDIR /nixpg
173-
174-
RUN nix profile install .#wal-g-3 && \
175-
ln -s /nix/var/nix/profiles/default/bin/wal-g-3 /tmp/wal-g
176-
177-
RUN nix store gc
178-
179166
WORKDIR /
180167
####################
181168
# setup-groonga
@@ -220,7 +207,6 @@ RUN gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys $GOSU_GPG_KEY &&
220207
FROM gosu as production
221208
RUN id postgres || (echo "postgres user does not exist" && exit 1)
222209
# # Setup extensions
223-
COPY --from=walg /tmp/wal-g /usr/local/bin/
224210
COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins
225211

226212
# # Initialise configs

ansible/tasks/setup-pgbouncer.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
- libsystemd-dev
99
- pkg-config
1010
update_cache: true
11-
cache_valid_time: 3600
1211

1312
- name: PgBouncer - download latest release
1413
ansible.builtin.get_url:

ansible/tasks/setup-wal-g.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,6 @@
3838
cmd: sudo -u ubuntu bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix-collect-garbage -d"
3939
become: true
4040

41-
- name: Install wal-g 3 from nix binary cache
42-
ansible.builtin.shell:
43-
cmd: sudo -u wal-g bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#wal-g-3"
44-
become: true
45-
46-
- name: nix collect garbage
47-
ansible.builtin.shell:
48-
cmd: sudo -u ubuntu bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix-collect-garbage -d"
49-
become: true
50-
51-
- name: Create symlink for wal-g-3 from Nix profile to /usr/local/bin
52-
ansible.builtin.file:
53-
dest: '/usr/local/bin/wal-g-v3'
54-
force: true
55-
src: '/home/wal-g/.nix-profile/bin/wal-g-3'
56-
state: 'link'
57-
become: true
58-
5941
- name: Create symlink to make wal-g-v2 the default wal-g
6042
ansible.builtin.file:
6143
dest: '/usr/local/bin/wal-g'

ansible/vars.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ postgres_major:
1010

1111
# Full version strings for each major version
1212
postgres_release:
13-
postgresorioledb-17: "17.6.0.014-orioledb-INDATA257"
14-
postgres17: "17.6.1.057-INDATA257"
15-
postgres15: "15.14.1.057-INDATA257"
13+
postgresorioledb-17: "17.6.0.014-orioledb"
14+
postgres17: "17.6.1.057"
15+
postgres15: "15.14.1.057"
1616

1717
# Non Postgres Extensions
1818
pgbouncer_release: 1.19.0

nix/checks.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@
391391
);
392392
inherit (self'.packages)
393393
wal-g-2
394-
wal-g-3
395394
dbmate-tool
396395
packer
397396
pg_regress

nix/packages/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
sync-exts-versions = pkgs.callPackage ./sync-exts-versions.nix { inherit (inputs') nix-editor; };
6969
trigger-nix-build = pkgs.callPackage ./trigger-nix-build.nix { };
7070
update-readme = pkgs.callPackage ./update-readme.nix { };
71-
inherit (pkgs.callPackage ./wal-g.nix { }) wal-g-2 wal-g-3;
71+
inherit (pkgs.callPackage ./wal-g.nix { }) wal-g-2;
7272
inherit (pkgs.cargo-pgrx)
7373
cargo-pgrx_0_11_3
7474
cargo-pgrx_0_12_6

nix/packages/wal-g.nix

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,4 @@ in
7777
vendorHash = "sha256-BbQuY6r30AkxlCZjY8JizaOrqEBdv7rIQet9KQwYB/g=";
7878
majorVersion = "2";
7979
};
80-
81-
# wal-g v3.0.5
82-
wal-g-3 = walGCommon {
83-
version = "3.0.5";
84-
sha256 = "sha256-wVr0L2ZXMuEo6tc2ajNzPinVQ8ZVzNOSoaHZ4oFsA+U=";
85-
vendorHash = "sha256-YDLAmRfDl9TgbabXj/1rxVQ052NZDg3IagXVTe5i9dw=";
86-
majorVersion = "3";
87-
};
8880
}

0 commit comments

Comments
 (0)