Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ Requires=local-fs.target

[Service]
Type=oneshot
{% if qemu_mode is defined and qemu_mode %}
ExecStart=/opt/supabase-admin-agent/supabase-admin-agent --config /opt/supabase-admin-agent/config.yaml salt --apply --store-result --salt-archive configmainv3-main.tar.gz
User=root
Group=root
{% else %}
ExecStart=/opt/supabase-admin-agent/supabase-admin-agent --config /opt/supabase-admin-agent/config.yaml salt --apply --store-result
User=supabase-admin-agent
Group=supabase-admin-agent
{% endif %}
StandardOutput=journal
StandardError=journal
StateDirectory=supabase-admin-agent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@ Description=Run Supabase supabase-admin-agent salt on a schedule
Requires=supabase-admin-agent_salt.service

[Timer]
{# We're using a significantly lower frequency for triggering this agent on qemu images for the moment. Once we've performed additional validations re: the aggregate impact of running it more frequently, the frequency can be increased. #}
{% if qemu_mode is defined and qemu_mode %}
OnCalendar=*-*-* 0,6,12,18:00:00
RandomizedDelaySec={{ supabase_admin_agent_splay }}
AccuracySec=1h
OnBootSec=5m
Persistent=true
{% else %}
OnCalendar=*:0/10
# Random delay up to {{ supabase_admin_agent_splay }} seconds splay
RandomizedDelaySec={{ supabase_admin_agent_splay }}
AccuracySec=1s
Persistent=true
{% endif %}

[Install]
WantedBy=timers.target
1 change: 1 addition & 0 deletions ansible/qemu-vars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
supabase_admin_agent_splay_secs: 2h
7 changes: 7 additions & 0 deletions ansible/tasks/internal/supabase-admin-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
arch: "arm64"
when: platform == "arm64"

- name: install gpg explicitly for qemu artifacts
become: yes
apt:
pkg:
- gpg
when: qemu_mode is defined

- name: Download supabase-admin-agent archive
get_url:
url: "https://supabase-public-artifacts-bucket.s3.amazonaws.com/supabase-admin-agent/v{{ supabase_admin_agent_release }}/supabase-admin-agent-{{ supabase_admin_agent_release }}-linux-{{ arch }}.tar.gz"
Expand Down
8 changes: 4 additions & 4 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ postgres_major:

# Full version strings for each major version
postgres_release:
postgresorioledb-17: 17.5.1.030-orioledb
postgres17: 17.6.1.009
postgres15: 15.14.1.009
postgresorioledb-17: 17.5.1.031-orioledb
postgres17: 17.6.1.010
postgres15: 15.14.1.010

# Non Postgres Extensions
pgbouncer_release: 1.19.0
Expand Down Expand Up @@ -56,7 +56,7 @@ postgres_exporter_release_checksum:
adminapi_release: "0.92.1"
adminmgr_release: "0.32.1"
supabase_admin_agent_release: 1.4.38
supabase_admin_agent_splay: 30
supabase_admin_agent_splay: 30s

vector_x86_deb: https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_amd64.deb
vector_arm_deb: https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_arm64.deb
6 changes: 4 additions & 2 deletions ebssurrogate/scripts/qemu-bootstrap-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ EOF
--extra-vars "postgresql_version=postgresql_${POSTGRES_MAJOR_VERSION}" \
--extra-vars "postgresql_major_version=${POSTGRES_MAJOR_VERSION}" \
--extra-vars "postgresql_major=${POSTGRES_MAJOR_VERSION}" \
--extra-vars "psql_version=psql_${POSTGRES_MAJOR_VERSION}"
--extra-vars "psql_version=psql_${POSTGRES_MAJOR_VERSION}" \
--extra-vars @./ansible/qemu-vars.yml
}

function setup_postgesql_env {
Expand Down Expand Up @@ -101,7 +102,8 @@ EOF
--extra-vars "postgresql_version=postgresql_${POSTGRES_MAJOR_VERSION}" \
--extra-vars "postgresql_major_version=${POSTGRES_MAJOR_VERSION}" \
--extra-vars "postgresql_major=${POSTGRES_MAJOR_VERSION}" \
--extra-vars "psql_version=psql_${POSTGRES_MAJOR_VERSION}"
--extra-vars "psql_version=psql_${POSTGRES_MAJOR_VERSION}" \
--extra-vars @./ansible/qemu-vars.yml
}

function clean_legacy_things {
Expand Down