Skip to content

Commit

Permalink
chore: move static ext configs to base template
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Jul 3, 2024
1 parent af52029 commit 241f542
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 43 deletions.
6 changes: 0 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,6 @@ RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccac
# Create debian package
RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc

####################
# 21-auto_explain.yml
####################

####################
# 22-pg_jsonschema.yml
####################
Expand Down Expand Up @@ -937,10 +933,8 @@ RUN sed -i \
-e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \
-e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
-e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \
echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \
echo "pgsodium.getkey_script= '/usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
useradd --create-home --shell /bin/bash wal-g -G postgres && \
mkdir -p /etc/postgresql-custom && \
chown postgres:postgres /etc/postgresql-custom
Expand Down
2 changes: 2 additions & 0 deletions ansible/files/postgresql_config/postgresql.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -774,4 +774,6 @@ include = '/etc/postgresql-custom/read-replica.conf'
#------------------------------------------------------------------------------

# Add settings for extensions here
auto_explain.log_min_duration = 10s
cron.database_name = 'postgres'
safeupdate.enabled = off
7 changes: 0 additions & 7 deletions ansible/tasks/postgres-extensions/04-pg_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@
target: install
become: yes

- name: pg_cron - set cron.database_name
become: yes
lineinfile:
path: /etc/postgresql/postgresql.conf
state: present
line: cron.database_name = 'postgres'

- name: pg_cron - cleanup
file:
state: absent
Expand Down
7 changes: 0 additions & 7 deletions ansible/tasks/postgres-extensions/21-auto_explain.yml

This file was deleted.

14 changes: 0 additions & 14 deletions ansible/tasks/setup-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
apt-get update
apt-get install -y --no-install-recommends /tmp/extensions/*.deb
- name: pg_cron - set cron.database_name
become: yes
lineinfile:
path: /etc/postgresql/postgresql.conf
state: present
line: cron.database_name = 'postgres'

- name: pgsodium - determine postgres bin directory
shell: pg_config --bindir
register: pg_bindir_output
Expand All @@ -31,13 +24,6 @@
# script is expected to be placed by finalization tasks for different target platforms
line: pgsodium.getkey_script= '{{ pg_bindir }}/pgsodium_getkey.sh'

- name: auto_explain - set auto_explain.log_min_duration
become: yes
lineinfile:
path: /etc/postgresql/postgresql.conf
state: present
line: auto_explain.log_min_duration = 10s

# supautils
- name: supautils - add supautils to session_preload_libraries
become: yes
Expand Down
3 changes: 0 additions & 3 deletions ansible/tasks/setup-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@
- name: Install pg_stat_monitor
import_tasks: tasks/postgres-extensions/20-pg_stat_monitor.yml

- name: Install auto_explain
import_tasks: tasks/postgres-extensions/21-auto_explain.yml

- name: Install vault
import_tasks: tasks/postgres-extensions/23-vault.yml

Expand Down
6 changes: 0 additions & 6 deletions docker/orioledb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,6 @@ RUN --mount=type=cache,target=/ccache,from=public.ecr.aws/supabase/postgres:ccac
# Create debian package
RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --nodoc

####################
# 21-auto_explain.yml
####################

####################
# 22-pg_jsonschema.yml
####################
Expand Down Expand Up @@ -1033,10 +1029,8 @@ RUN sed -i \
-e "s|#max_wal_size = 1GB|max_wal_size = 8GB|g" \
-e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \
-e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \
echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \
echo "pgsodium.getkey_script= '/usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
echo "orioledb.main_buffers = 1GB" >> /etc/postgresql/postgresql.conf && \
echo "orioledb.undo_buffers = 256MB" >> /etc/postgresql/postgresql.conf && \
useradd --create-home --shell /bin/bash wal-g -G postgres && \
Expand Down

0 comments on commit 241f542

Please sign in to comment.