Skip to content

Commit

Permalink
chore: updates to run physical backups as a service (#1235)
Browse files Browse the repository at this point in the history
* chore: init commence-backup service

* chore: bump adminapi and adminmgr

* chore: bump version

* fix: provide correct filename
  • Loading branch information
dragarcia authored Oct 2, 2024
1 parent bc7155d commit 1bf8c05
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ansible/files/adminapi.sudoers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Cmnd_Alias PGBOUNCER = /bin/systemctl start pgbouncer.service, /bin/systemctl st
%adminapi ALL= NOPASSWD: /usr/bin/systemctl restart postgresql.service
%adminapi ALL= NOPASSWD: /usr/bin/systemctl show -p NRestarts postgresql.service
%adminapi ALL= NOPASSWD: /usr/bin/systemctl restart adminapi.service
%adminapi ALL= NOPASSWD: /usr/bin/systemctl is-active commence-backup.service
%adminapi ALL= NOPASSWD: /usr/bin/systemctl start commence-backup.service
%adminapi ALL= NOPASSWD: /bin/systemctl daemon-reload
%adminapi ALL= NOPASSWD: /bin/systemctl restart services.slice
%adminapi ALL= NOPASSWD: /usr/sbin/nft -f /etc/nftables/supabase_managed.conf
Expand Down
12 changes: 12 additions & 0 deletions ansible/files/commence-backup.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Async commence physical backup

[Service]
Type=simple
User=adminapi
ExecStart=/usr/bin/admin-mgr commence-backup --run-as-service true
Restart=no
OOMScoreAdjust=-1000

[Install]
WantedBy=multi-user.target
5 changes: 5 additions & 0 deletions ansible/tasks/internal/admin-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
src: files/adminapi.service.j2
dest: /etc/systemd/system/adminapi.service

- name: adminapi - create service file for commence backup process
template:
src: files/commence-backup.service.j2
dest: /etc/systemd/system/commence-backup.service

- name: UFW - Allow connections to adminapi ports
ufw:
rule: allow
Expand Down
4 changes: 2 additions & 2 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ postgres_exporter_release_checksum:
arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0
amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84

adminapi_release: 0.68.0
adminmgr_release: 0.22.1
adminapi_release: 0.71.1
adminmgr_release: 0.24.0

# Postgres Extensions
postgis_release: "3.3.2"
Expand Down
2 changes: 1 addition & 1 deletion common-nix.vars.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
postgres-version = "15.8.1.001"
postgres-version = "15.8.1.002"

0 comments on commit 1bf8c05

Please sign in to comment.