Skip to content

Commit fa05170

Browse files
committed
feat: wip refactor to pg 17 for orioledb
1 parent 9ae9c9f commit fa05170

File tree

12 files changed

+47
-39
lines changed

12 files changed

+47
-39
lines changed

.github/workflows/ami-release-nix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
#- develop
77
#- release/*
8-
- sam/oriole16
8+
- sam/oriole17
99
paths:
1010
- '.github/workflows/ami-release-nix.yml'
1111
- 'common-nix.vars.pkr.hcl'

ansible/tasks/stage2-setup-postgres.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@
88
block:
99
- name: Check if psql_version is psql_orioledb-16
1010
set_fact:
11-
is_psql_oriole_16: "{{ psql_version == 'psql_orioledb-16' }}"
11+
is_psql_oriole: "{{ psql_version in ['psql_orioledb-16', 'psql_orioledb-17'] }}"
1212

1313
- name: Remove specified extensions from postgresql.conf if oriole-16 build
1414
ansible.builtin.command:
1515
cmd: >
1616
sed -i 's/ timescaledb,//g'
1717
/etc/postgresql/postgresql.conf
18-
when: is_psql_oriole_16 and stage2_nix
18+
when: is_psql_oriole and stage2_nix
1919
become: yes
2020

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

2929
- name: Install Postgres from nix binary cache
@@ -224,15 +224,15 @@
224224
block:
225225
- name: Check if psql_version is psql_orioledb-16
226226
set_fact:
227-
is_psql_oriole_16: "{{ psql_version == 'psql_orioledb-16' }}"
227+
is_psql_oriole: "{{ psql_version == 'psql_orioledb-16' }}"
228228

229229
- name: Recursively create symbolic links and set permissions for the contrib/postgis-* dir
230230
shell: >
231231
sudo mkdir -p /usr/lib/postgresql/share/postgresql/contrib && \
232232
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 {} + \
233233
&& chown -R postgres:postgres "/usr/lib/postgresql/share/postgresql/contrib/"
234234
become: yes
235-
when: stage2_nix and not is_psql_oriole_16
235+
when: stage2_nix and not is_psql_oriole
236236

237237
- name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql/timezonesets to /usr/lib/postgresql/share/postgresql/timeszonesets
238238
file:

ansible/tasks/test-image.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@
6767
block:
6868
- name: Check if psql_version is psql_orioledb-16
6969
set_fact:
70-
is_psql_oriole_16: "{{ psql_version == 'psql_orioledb-16' }}"
70+
is_psql_oriole: "{{ psql_version in ['psql_orioledb-16', 'psql_orioledb-17'] }}"
7171

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

7979
- name: Remove specified extension files from extensions directory
@@ -86,14 +86,14 @@
8686
- '*plv8*.sql'
8787
- '*pgvector*.sql'
8888
register: files_to_remove
89-
when: is_psql_oriole_16
89+
when: is_psql_oriole
9090

9191
- name: Delete matched extension files
9292
ansible.builtin.file:
9393
path: "{{ item.path }}"
9494
state: absent
9595
loop: "{{ files_to_remove.files }}"
96-
when: is_psql_oriole_16
96+
when: is_psql_oriole
9797
become: yes
9898

9999

ansible/vars.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ async_mode: true
55
postgres_major:
66
#- "15"
77
#- "16"
8-
- "orioledb-16"
8+
- "orioledb-17"
99

1010
# Full version strings for each major version
1111
# TOD PR uncomment these lines
1212
postgres_release:
1313
#postgres15: "15.8.1.003-staging-5"
1414
#postgres16: "16.3.1.000-staging-5"
15-
postgresorioledb-16: "orioledb-16.3.1.000-staging-12"
15+
#postgresorioledb-16: "orioledb-16.3.1.000-staging-12"
16+
postgresorioledb-17: "orioledb-17.0.1.000-staging-1"
1617

1718
# Non Postgres Extensions
1819
pgbouncer_release: "1.19.0"

docker/nix/build_nix.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"
1010
#no nix flake check on oriole yet
1111
nix build .#psql_15/bin -o psql_15
1212
nix build .#psql_16/bin -o psql_16
13-
nix build .#psql_orioledb-16/bin -o psql_orioledb_16
13+
#nix build .#psql_orioledb-16/bin -o psql_orioledb_16
14+
nix build .#psql_orioledb-17/bin -o psql_orioledb_17
1415
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15
1516
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_16
1617
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_16

flake.nix

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@
160160
orioledbExtensions = orioleFilteredExtensions ++ [ ./nix/ext/orioledb.nix ];
161161

162162
getPostgresqlPackage = version:
163-
if version == "orioledb_16"
164-
then pkgs.postgresql."postgresql_orioledb-16"
165-
else pkgs.postgresql."postgresql_${version}";
163+
pkgs.postgresql."postgresql_${version}";
166164
# Create a 'receipt' file for a given postgresql package. This is a way
167165
# of adding a bit of metadata to the package, which can be used by other
168166
# tools to inspect what the contents of the install are: the PSQL
@@ -202,7 +200,7 @@
202200
makeOurPostgresPkgs = version:
203201
let
204202
postgresql = getPostgresqlPackage version;
205-
extensionsToUse = if version == "orioledb-16"
203+
extensionsToUse = if (builtins.elem version ["orioledb-16" "orioledb-17"])
206204
then orioledbExtensions
207205
else ourExtensions;
208206
in map (path: pkgs.callPackage path { inherit postgresql; }) extensionsToUse;
@@ -277,7 +275,8 @@
277275
postgresVersions = {
278276
psql_15 = makePostgres "15";
279277
psql_16 = makePostgres "16";
280-
psql_orioledb-16 = makePostgres "orioledb-16" ;
278+
#psql_orioledb-16 = makePostgres "orioledb-16" ;
279+
psql_orioledb-17 = makePostgres "orioledb-17" ;
281280
};
282281

283282
# Find the active PostgreSQL version
@@ -293,7 +292,8 @@
293292
};
294293
postgresql_15 = getPostgresqlPackage "15";
295294
postgresql_16 = getPostgresqlPackage "16";
296-
postgresql_orioledb-16 = getPostgresqlPackage "orioledb-16";
295+
#postgresql_orioledb-16 = getPostgresqlPackage "orioledb-16";
296+
postgresql_orioledb-17 = getPostgresqlPackage "orioledb-17";
297297
in
298298
postgresVersions //{
299299
supabase-groonga = supabase-groonga;
@@ -302,13 +302,14 @@
302302
# PostgreSQL versions.
303303
psql_15 = postgresVersions.psql_15;
304304
psql_16 = postgresVersions.psql_16;
305-
psql_orioledb-16 = postgresVersions.psql_orioledb-16;
305+
#psql_orioledb-16 = postgresVersions.psql_orioledb-16;
306+
psql_orioledb-17 = postgresVersions.psql_orioledb-17;
306307
sfcgal = sfcgal;
307308
pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP;
308-
inherit postgresql_15 postgresql_16 postgresql_orioledb-16;
309+
inherit postgresql_15 postgresql_16 postgresql_orioledb-17;
309310
postgresql_15_debug = if pkgs.stdenv.isLinux then postgresql_15.debug else null;
310311
postgresql_16_debug = if pkgs.stdenv.isLinux then postgresql_16.debug else null;
311-
postgresql_orioledb-16_debug = if pkgs.stdenv.isLinux then postgresql_orioledb-16.debug else null;
312+
postgresql_orioledb-17_debug = if pkgs.stdenv.isLinux then postgresql_orioledb-17.debug else null;
312313
postgresql_15_src = pkgs.stdenv.mkDerivation {
313314
pname = "postgresql-15-src";
314315
version = postgresql_15.version;
@@ -353,11 +354,11 @@
353354
platforms = platforms.all;
354355
};
355356
};
356-
postgresql_orioledb-16_src = pkgs.stdenv.mkDerivation {
357-
pname = "postgresql-16-src";
358-
version = postgresql_orioledb-16.version;
357+
postgresql_orioledb-17_src = pkgs.stdenv.mkDerivation {
358+
pname = "postgresql-17-src";
359+
version = postgresql_orioledb-17.version;
359360

360-
src = postgresql_16.src;
361+
src = postgresql_orioledb-17.src;
361362

362363
nativeBuildInputs = [ pkgs.bzip2 ];
363364

@@ -434,7 +435,7 @@
434435
--subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \
435436
--subst-var-by 'PSQL_CONF_FILE' $out/etc/postgresql/postgresql.conf \
436437
--subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' \
437-
--subst-var-by 'PSQLORIOLEDB16_BINDIR' '${basePackages.psql_orioledb-16.bin}' \
438+
--subst-var-by 'PSQLORIOLEDB17_BINDIR' '${basePackages.psql_orioledb-17.bin}' \
438439
--subst-var-by 'PGSODIUM_GETKEY' '${getkeyScript}' \
439440
--subst-var-by 'READREPL_CONF_FILE' "$out/etc/postgresql-custom/read-replica.conf" \
440441
--subst-var-by 'LOGGING_CONF_FILE' "$out/etc/postgresql-custom/logging.conf" \

nix/ext/orioledb.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ stdenv.mkDerivation rec {
66
src = fetchFromGitHub {
77
owner = "orioledb";
88
repo = "orioledb";
9-
rev = "bd8e32d0ebaafd0ea3ec3074233b65167f3b6fb7";
10-
sha256 = "sha256-bzH1SgPZ6q90HpqRsECY2XQPghEcd2Hg4X55G43unNo=";
9+
rev = "2861cf9091a92bcabbbbf1f4d15f8edff480fea1";
10+
sha256 = "";
1111
};
12-
version = "patches16_31";
12+
version = "patches17_3";
1313
buildInputs = [ curl libkrb5 postgresql python3 openssl ];
1414
buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=31";
1515
installPhase = ''

nix/postgresql/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ let
44
postgresql_15 = ./15.nix;
55
postgresql_16 = ./16.nix;
66
postgresql_orioledb-16 = ./orioledb-16.nix;
7+
postgresql_orioledb-17 = ./orioledb-17.nix;
78
};
89
mkAttributes = jitSupport:
910
self.lib.mapAttrs' (version: path:

nix/postgresql/generic.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ let
5151
inherit version;
5252
pname = pname + lib.optionalString jitSupport "-jit";
5353

54-
src = if (builtins.match "16_.*" version != null) then
54+
src = if (builtins.match "17_*" version != null) then
5555
fetchurl {
5656
url = "https://github.com/orioledb/postgres/archive/refs/tags/patches${version}.tar.gz";
5757
inherit hash;

nix/postgresql/orioledb-17.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import ./generic.nix {
2+
version = "17_3";
3+
hash = "";
4+
}

0 commit comments

Comments
 (0)