Skip to content

chore: bump PostgREST to v13.0.2 #1633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion ansible/manifest-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
get_url:
url: "https://github.com/PostgREST/postgrest/releases/download/v{{ postgrest_release }}/postgrest-v{{ postgrest_release }}-ubuntu-aarch64.tar.xz"
dest: /tmp/postgrest-{{ postgrest_release }}-arm64.tar.xz
checksum: "{{ postgrest_arm_release_checksum }}"
checksum: "{{ postgrest_release_checksum }}"
timeout: 60

- name: Download adminapi archive
Expand Down
72 changes: 11 additions & 61 deletions ansible/tasks/setup-postgrest.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,18 @@
- name: PostgREST - system user
user: name=postgrest

- name: PostgREST - add Postgres PPA gpg key
apt_key:
url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
state: present

- name: PostgREST - add Postgres PPA
apt_repository:
repo: "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg {{ postgresql_major }}"
state: present

- name: PostgREST - update apt cache
apt:
update_cache: yes

# libpq is a C library that enables user programs to communicate with
# the PostgreSQL database server.
- name: PostgREST - system dependencies
apt:
pkg:
- libpq5
- libnuma-dev

- name: PostgREST - remove Postgres PPA gpg key
apt_key:
url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
state: absent

- name: PostgREST - remove Postgres PPA
apt_repository:
repo: "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg {{ postgresql_major }}"
state: absent

- name: postgis - ensure dependencies do not get autoremoved
- name: PostgREST - install from nix postgrest flakes
become: yes
shell: |
set -e
apt-mark manual libpq5*
apt-mark manual libnuma*
apt-mark auto libnuma*-dev

- name: PostgREST - download ubuntu binary archive (arm)
get_url:
url: "https://github.com/PostgREST/postgrest/releases/download/v{{ postgrest_release }}/postgrest-v{{ postgrest_release }}-ubuntu-aarch64.tar.xz"
dest: /tmp/postgrest.tar.xz
checksum: "{{ postgrest_arm_release_checksum }}"
timeout: 60
when: platform == "arm64"

- name: PostgREST - download ubuntu binary archive (x86)
get_url:
url: "https://github.com/PostgREST/postgrest/releases/download/v{{ postgrest_release }}/postgrest-v{{ postgrest_release }}-linux-static-x64.tar.xz"
dest: /tmp/postgrest.tar.xz
checksum: "{{ postgrest_x86_release_checksum }}"
timeout: 60
when: platform == "amd64"

- name: PostgREST - unpack archive in /opt
unarchive:
remote_src: yes
src: /tmp/postgrest.tar.xz
dest: /opt
owner: postgrest
mode: '0755'
sudo -u postgrest bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install --accept-flake-config github:postgrest/postgrest/v{{ postgrest_release }}"
when: stage2_nix

- name: Create symlink for PostgREST from Nix profile to /opt
ansible.builtin.file:
src: /home/postgrest/.nix-profile/bin/postgrest
dest: /opt/postgrest
state: link
force: yes # This will replace existing file/symlink if it exists

- name: create directories
file:
Expand Down
16 changes: 7 additions & 9 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@ postgres_major:

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.0.1.092-orioledb"
postgres17: "17.4.1.042"
postgres15: "15.8.1.099"
postgresorioledb-17: "17.0.1.092-orioledb-pgrst13"
postgres17: "17.4.1.042-pgrst13"
postgres15: "15.8.1.099-pgrst13"

# Non Postgres Extensions
pgbouncer_release: "1.19.0"
pgbouncer_release_checksum: sha256:af0b05e97d0e1fd9ad45fe00ea6d2a934c63075f67f7e2ccef2ca59e3d8ce682

# to get these use
# wget https://github.com/PostgREST/postgrest/releases/download/v12.2.3/postgrest-v12.2.3-ubuntu-aarch64.tar.xz -q -O- | sha1sum
# wget https://github.com/PostgREST/postgrest/releases/download/v12.2.3/postgrest-v12.2.3-linux-static-x64.tar.xz -q -O- | sha1sum
postgrest_release: "12.2.3"
postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9
postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05
# to get the checksum use
# wget https://github.com/PostgREST/postgrest/releases/download/v13.0.2/postgrest-v13.0.2-ubuntu-aarch64.tar.xz -q -O- | sha1sum
postgrest_release: "13.0.2"
postgrest_release_checksum: sha1:ea184ea392544b8374c1c21bbe278f55959ae62a

gotrue_release: 2.175.0
gotrue_release_checksum: sha1:4e2a41e08936195daf443c60201691c1bd991709
Expand Down
4 changes: 2 additions & 2 deletions scripts/nix-provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function install_packages {

function install_nix() {
sudo su -c "curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
--extra-conf \"substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com\" \
--extra-conf \"trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\" " -s /bin/bash root
--extra-conf \"substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com https://postgrest.cachix.org\" \
--extra-conf \"trusted-public-keys = postgrest.cachix.org-1:icgW4R15fz1+LqvhPjt4EnX/r19AaqxiVV+1olwlZtI= nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\" " -s /bin/bash root
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh

}
Expand Down
3 changes: 3 additions & 0 deletions testinfra/test_ami_nix.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ def gzip_then_base64_encode(s: str) -> str:
sleep(5)
instance.reload()

print('---------------- InstanceID: ----------------')
print('---------------- ', instance.id)

# Create single SSH connection
ssh = get_ssh_connection(
instance.public_ip_address,
Expand Down