Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
cdc6452
feat: build and flake check of pg 16.3 with exts/wrappers
samrose Oct 7, 2024
91ec362
pg_partman test 15/16 compat
olirice Oct 7, 2024
0321dfa
merge sql interface test
olirice Oct 7, 2024
aa5dd9a
tests: build test and cache both versions
samrose Oct 7, 2024
65fdc5d
chore: run checks individually
samrose Oct 7, 2024
f10881b
pg 15 and 16 packer/ansible/ghactions (#1268)
samrose Oct 10, 2024
7f7730e
chore: rm dead code
samrose Oct 10, 2024
3454b62
chore: resolve versions from ansible/vars.yml instead of packer file
samrose Oct 15, 2024
d576b01
feat: WIP orioledb 16
samrose Oct 15, 2024
ce43530
feat: intro into CI building psql16 bundle oriole version
samrose Oct 15, 2024
b6fdd11
test: working through build compat for oriole
samrose Oct 16, 2024
859cbca
working orioledb build
samrose Oct 17, 2024
a4b4998
fix: update value
samrose Oct 17, 2024
6336dba
Merge branch 'develop' into sam/oriole16
samrose Oct 17, 2024
8c13a58
chore: cut staging only release for oriole16
samrose Oct 17, 2024
07117e3
narrow down to just oriole staging ami here
samrose Oct 17, 2024
9f4b869
Merge branch 'develop' into sam/oriole16
samrose Oct 17, 2024
2ea1e90
fix: make sure name lines up with gh action convention
samrose Oct 17, 2024
c7f68df
fix: get correct naming convention in here too for oriole bundle
samrose Oct 17, 2024
870f591
chore: bump to cut release
samrose Oct 17, 2024
d483a07
fix: make sure src and debug builds available for oriole too
samrose Oct 17, 2024
5e69b00
chore: bump to staging release
samrose Oct 17, 2024
b62e770
fix: when oriole16 rm timescale from supautils conf
samrose Oct 17, 2024
889dc70
fix: also remove from postgresql conf
samrose Oct 18, 2024
a67d8e1
fix: find all instances and remove in this condition for tiemscaledb
samrose Oct 18, 2024
67382a6
fix: maybe broke pgsodium with too many spaces
samrose Oct 18, 2024
c08b661
fix: create a symlink for missing path
samrose Oct 18, 2024
59b44b6
fix: try a more universal way to deactivate pgsodium at this stage
samrose Oct 18, 2024
f961371
chore: when oriole16 rm timescale plv8 postgis pgvector pgrouting
samrose Oct 18, 2024
a8f1a6b
fix: more handling of oriole16 differences
samrose Oct 18, 2024
c35fa68
chore more oriole16 handling
samrose Oct 18, 2024
d1e06d4
fix: refine sed regex
samrose Oct 18, 2024
304aa68
fix: also cond rm actual files
samrose Oct 18, 2024
55b9763
fix: correct dir
samrose Oct 18, 2024
292327e
chore: bump to release
samrose Oct 18, 2024
32163be
feat: parse and handle oropledb-16 in start-server
samrose Oct 21, 2024
e1c199c
feat: start-client for oriole16
samrose Oct 21, 2024
6a5648b
wip for orioledb push to build on linux
samrose Oct 22, 2024
049010a
fix: running server
samrose Oct 22, 2024
c2e2801
chore: consolidate nix code that handles building of postgres versions
samrose Oct 23, 2024
1cd2063
fix: update name for bundle
samrose Oct 23, 2024
0e23e7d
chore: small cleanup
samrose Oct 24, 2024
f6cbbe7
Merge branch 'develop' into sam/oriole16
samrose Oct 24, 2024
9d48e50
chore: bump version release
samrose Oct 24, 2024
25e1b3b
Merge branch 'develop' into sam/oriole16
samrose Oct 24, 2024
fed90a0
chore: cleanup names
samrose Oct 24, 2024
9b078d0
chore: correct names
samrose Oct 24, 2024
bc2b4cc
fix: var name
samrose Oct 24, 2024
12dc397
fix: one more var name
samrose Oct 24, 2024
73944e1
chore: bump to release
samrose Oct 24, 2024
9ae9c9f
fix: reformatting metadata for clikchouse dep as git was not able to …
samrose Oct 24, 2024
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
5 changes: 3 additions & 2 deletions .github/workflows/ami-release-nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: Release AMI Nix
on:
push:
branches:
- develop
- release/*
#- develop
#- release/*
- sam/oriole16
paths:
- '.github/workflows/ami-release-nix.yml'
- 'common-nix.vars.pkr.hcl'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
push:
branches:
- develop
pull_request:
#TODO PR uncomment this line
#pull_request:
workflow_dispatch:

jobs:
Expand Down
55 changes: 46 additions & 9 deletions ansible/tasks/stage2-setup-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,33 @@
# shell: |
# sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install nixpkgs#openjdk11"
# It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task

- name: Check psql_version and modify supautils.conf and postgresql.conf if necessary
block:
- name: Check if psql_version is psql_orioledb-16
set_fact:
is_psql_oriole_16: "{{ psql_version == 'psql_orioledb-16' }}"

- name: Remove specified extensions from postgresql.conf if oriole-16 build
ansible.builtin.command:
cmd: >
sed -i 's/ timescaledb,//g'
/etc/postgresql/postgresql.conf
when: is_psql_oriole_16 and stage2_nix
become: yes

- name: Remove specified extensions from supautils.conf if oriole-16 build
ansible.builtin.command:
cmd: >
sed -i 's/ timescaledb,//g; s/ vector,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g'
/etc/postgresql-custom/supautils.conf
when: is_psql_oriole_16 and stage2_nix
become: yes

- name: Install Postgres from nix binary cache
become: yes
shell: |
sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{psql_version}}/bin"
#TODO (samrose) switch pg_prove sourcing to develop branch once PR is merged
when: stage2_nix

- name: Install pg_prove from nix binary cache
Expand Down Expand Up @@ -198,13 +220,19 @@
recurse: yes
when: stage2_nix

- name: Recursively create symbolic links and set permissions for the contrib/postgis-* dir
shell: >
sudo mkdir -p /usr/lib/postgresql/share/postgresql/contrib && \
sudo find /var/lib/postgresql/.nix-profile/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do sudo ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \
&& chown -R postgres:postgres "/usr/lib/postgresql/share/postgresql/contrib/"
become: yes
when: stage2_nix
- name: Check psql_version and run postgis linking if not oriole-16
block:
- name: Check if psql_version is psql_orioledb-16
set_fact:
is_psql_oriole_16: "{{ psql_version == 'psql_orioledb-16' }}"

- name: Recursively create symbolic links and set permissions for the contrib/postgis-* dir
shell: >
sudo mkdir -p /usr/lib/postgresql/share/postgresql/contrib && \
sudo find /var/lib/postgresql/.nix-profile/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do sudo ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \
&& chown -R postgres:postgres "/usr/lib/postgresql/share/postgresql/contrib/"
become: yes
when: stage2_nix and not is_psql_oriole_16

- name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql/timezonesets to /usr/lib/postgresql/share/postgresql/timeszonesets
file:
Expand Down Expand Up @@ -239,8 +267,17 @@
line: pgsodium.getkey_script= '{{ pg_bindir }}/pgsodium_getkey.sh'
when: stage2_nix

#TODO PR may need to remove this.
- name: Create symbolic link for pgsodium_getkey script
file:
src: "/usr/lib/postgresql/bin/pgsodium_getkey.sh"
dest: "/usr/lib/postgresql/share/postgresql/extension/pgsodium_getkey"
state: link
become: yes
when: stage2_nix

- name: Append GRN_PLUGINS_DIR to /etc/environment.d/postgresql.env
ansible.builtin.lineinfile:
path: /etc/environment.d/postgresql.env
line: 'GRN_PLUGINS_DIR=/var/lib/postgresql/.nix-profile/lib/groonga/plugins'
become: yes
become: yes
47 changes: 46 additions & 1 deletion ansible/tasks/test-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,22 @@
- libtap-parser-sourcehandler-pgtap-perl
when: debpkg_mode

# - name: Temporarily disable PG Sodium references in config
# become: yes
# become_user: postgres
# shell:
# cmd: sed -i.bak -e "s/pg_net,\ pgsodium,\ timescaledb/pg_net,\ timescaledb/g" -e "s/pgsodium.getkey_script=/#pgsodium.getkey_script=/g" /etc/postgresql/postgresql.conf
# when: debpkg_mode or stage2_nix

- name: Temporarily disable PG Sodium references in config
become: yes
become_user: postgres
shell:
cmd: sed -i.bak -e "s/pg_net,\ pgsodium,\ timescaledb/pg_net,\ timescaledb/g" -e "s/pgsodium.getkey_script=/#pgsodium.getkey_script=/g" /etc/postgresql/postgresql.conf
cmd: >
sed -i.bak
-e 's/\(shared_preload_libraries = '\''.*\)pgsodium,\(.*'\''\)/\1\2/'
-e 's/pgsodium.getkey_script=/#pgsodium.getkey_script=/'
/etc/postgresql/postgresql.conf
when: debpkg_mode or stage2_nix

- name: Start Postgres Database to load all extensions.
Expand Down Expand Up @@ -52,6 +63,40 @@
failed_when: retval.rc != 0
when: debpkg_mode or stage2_nix

- name: Check psql_version and modify migrations if orioe-16
block:
- name: Check if psql_version is psql_orioledb-16
set_fact:
is_psql_oriole_16: "{{ psql_version == 'psql_orioledb-16' }}"

- name: Remove specified extensions from SQL file
ansible.builtin.command:
cmd: >
sed -i '/\\ir.*\(timescaledb\|postgis\|pgrouting\|plv8\|pgvector\).*\.sql/d' /tmp/migrations/tests/extensions/test.sql
when: is_psql_oriole_16
become: yes

- name: Remove specified extension files from extensions directory
ansible.builtin.find:
paths: /tmp/migrations/tests/extensions
patterns:
- '*timescaledb*.sql'
- '*postgis*.sql'
- '*pgrouting*.sql'
- '*plv8*.sql'
- '*pgvector*.sql'
register: files_to_remove
when: is_psql_oriole_16

- name: Delete matched extension files
ansible.builtin.file:
path: "{{ item.path }}"
state: absent
loop: "{{ files_to_remove.files }}"
when: is_psql_oriole_16
become: yes


- name: Run migrations tests
shell: /usr/bin/pg_prove -U supabase_admin -h localhost -d postgres -v tests/test.sql
register: retval
Expand Down
14 changes: 7 additions & 7 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ supabase_internal: true
ebssurrogate_mode: true
async_mode: true

# postgresql_major: "15"
# postgresql_release: "15.1"
# postgresql_release_checksum: sha256:ea2cf059a85882654b989acd07edc121833164a30340faee0d3615cf7058e66c
postgres_major:
- "15"
- "16"
#- "15"
#- "16"
- "orioledb-16"

# Full version strings for each major version
# TOD PR uncomment these lines
postgres_release:
postgres15: "15.8.1.004"
postgres16: "16.3.1.010"
#postgres15: "15.8.1.003-staging-5"
#postgres16: "16.3.1.000-staging-5"
postgresorioledb-16: "orioledb-16.3.1.000-staging-12"

# Non Postgres Extensions
pgbouncer_release: "1.19.0"
Expand Down
3 changes: 3 additions & 0 deletions docker/nix/build_nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ if [ -d "/workspace" ]; then
fi
nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_15 -L --no-link
nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_16 -L --no-link
#no nix flake check on oriole yet
nix build .#psql_15/bin -o psql_15
nix build .#psql_16/bin -o psql_16
nix build .#psql_orioledb-16/bin -o psql_orioledb_16
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_16
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_16
Loading
Loading