Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
18 changes: 18 additions & 0 deletions Dockerfile-15
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@ RUN nix profile install .#wal-g-3 && \

RUN nix store gc

WORKDIR /
####################
# setup-groonga
####################
FROM base as groonga

WORKDIR /nixpg

RUN nix profile install .#supabase-groonga && \
mkdir -p /tmp/groonga-plugins && \
cp -r /nix/var/nix/profiles/default/lib/groonga/plugins /tmp/groonga-plugins/

RUN nix store gc

WORKDIR /
# ####################
# # Download gosu for easy step-down from root
Expand Down Expand Up @@ -153,6 +167,7 @@ FROM gosu as production
RUN id postgres || (echo "postgres user does not exist" && exit 1)
# # Setup extensions
COPY --from=walg /tmp/wal-g /usr/local/bin/
COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins

# # Initialise configs
COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf
Expand Down Expand Up @@ -216,4 +231,7 @@ ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive
RUN mkdir -p /usr/share/postgresql/extension/ && \
ln -s /usr/lib/postgresql/bin/pgsodium_getkey.sh /usr/share/postgresql/extension/pgsodium_getkey && \
chmod +x /usr/lib/postgresql/bin/pgsodium_getkey.sh

ENV GRN_PLUGINS_DIR=/usr/lib/groonga/plugins

CMD ["postgres", "-D", "/etc/postgresql"]
18 changes: 18 additions & 0 deletions Dockerfile-17
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,20 @@ RUN nix profile install .#wal-g-3 && \

RUN nix store gc

WORKDIR /
####################
# setup-groonga
####################
FROM base as groonga

WORKDIR /nixpg

RUN nix profile install .#supabase-groonga && \
mkdir -p /tmp/groonga-plugins && \
cp -r /nix/var/nix/profiles/default/lib/groonga/plugins /tmp/groonga-plugins/

RUN nix store gc

WORKDIR /
# ####################
# # Download gosu for easy step-down from root
Expand Down Expand Up @@ -157,6 +171,7 @@ FROM gosu as production
RUN id postgres || (echo "postgres user does not exist" && exit 1)
# # Setup extensions
COPY --from=walg /tmp/wal-g /usr/local/bin/
COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins

# # Initialise configs
COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf
Expand Down Expand Up @@ -229,4 +244,7 @@ ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive
RUN mkdir -p /usr/share/postgresql/extension/ && \
ln -s /usr/lib/postgresql/bin/pgsodium_getkey.sh /usr/share/postgresql/extension/pgsodium_getkey && \
chmod +x /usr/lib/postgresql/bin/pgsodium_getkey.sh

ENV GRN_PLUGINS_DIR=/usr/lib/groonga/plugins

CMD ["postgres", "-D", "/etc/postgresql"]
17 changes: 17 additions & 0 deletions Dockerfile-orioledb-17
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,20 @@ RUN nix profile install .#wal-g-3 && \

RUN nix store gc

WORKDIR /
####################
# setup-groonga
####################
FROM base as groonga

WORKDIR /nixpg

RUN nix profile install .#supabase-groonga && \
mkdir -p /tmp/groonga-plugins && \
cp -r /nix/var/nix/profiles/default/lib/groonga/plugins /tmp/groonga-plugins/

RUN nix store gc

WORKDIR /
# ####################
# # Download gosu for easy step-down from root
Expand Down Expand Up @@ -157,6 +171,7 @@ FROM gosu as production
RUN id postgres || (echo "postgres user does not exist" && exit 1)
# # Setup extensions
COPY --from=walg /tmp/wal-g /usr/local/bin/
COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins

# # Initialise configs
COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf
Expand Down Expand Up @@ -235,4 +250,6 @@ RUN mkdir -p /usr/share/postgresql/extension/ && \
ln -s /usr/lib/postgresql/bin/pgsodium_getkey.sh /usr/share/postgresql/extension/pgsodium_getkey && \
chmod +x /usr/lib/postgresql/bin/pgsodium_getkey.sh

ENV GRN_PLUGINS_DIR=/usr/lib/groonga/plugins

CMD ["postgres", "-D", "/etc/postgresql"]
6 changes: 3 additions & 3 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.049-orioledb"
postgres17: "17.6.1.028"
postgres15: "15.14.1.028"
postgresorioledb-17: "17.5.1.048-orioledb-pgroonga-1"
postgres17: "17.6.1.027-pgroonga-1"
postgres15: "15.14.1.027-pgroonga-1"

# Non Postgres Extensions
pgbouncer_release: 1.19.0
Expand Down
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
nix/checks.nix
nix/config.nix
nix/devShells.nix
nix/ext
nix/fmt.nix
nix/hooks.nix
nix/nixpkgs.nix
Expand Down
54 changes: 28 additions & 26 deletions nix/checks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
psql_15 = self'.packages."psql_15/bin";
psql_17 = self'.packages."psql_17/bin";
psql_orioledb-17 = self'.packages."psql_orioledb-17/bin";
pgroonga = self'.packages."psql_15/exts/pgroonga";
inherit (self.supabase) defaults;
};
in
Expand Down Expand Up @@ -68,9 +67,36 @@
'';
};

# Get the major version for filtering
majorVersion =
let
version = builtins.trace "pgpkg.version is: ${pgpkg.version}" pgpkg.version;
isOrioledbMatch = builtins.match "^17_[0-9]+$" version != null;
isSeventeenMatch = builtins.match "^17[.][0-9]+$" version != null;
result =
if isOrioledbMatch then
"orioledb-17"
else if isSeventeenMatch then
"17"
else
"15";
in
builtins.trace "Major version result: ${result}" result;

# Select the appropriate pgroonga package for this PostgreSQL version
pgroonga = self'.packages."psql_${majorVersion}/exts/pgroonga-all";

pgPort =
if (majorVersion == "17") then
"5535"
else if (majorVersion == "15") then
"5536"
else
"5537";

# Use the shared setup but with a test-specific name
start-postgres-server-bin = pkgs-lib.makePostgresDevSetup {
inherit pkgs;
inherit pkgs pgroonga;
name = "start-postgres-server-test";
extraSubstitutions = {
PGSODIUM_GETKEY = "${getkey-script}/bin/pgsodium-getkey";
Expand Down Expand Up @@ -116,33 +142,9 @@
in
pkgs.lib.filterAttrs (name: _: isValidFile name) files;

# Get the major version for filtering
majorVersion =
let
version = builtins.trace "pgpkg.version is: ${pgpkg.version}" pgpkg.version;
isOrioledbMatch = builtins.match "^17_[0-9]+$" version != null;
isSeventeenMatch = builtins.match "^17[.][0-9]+$" version != null;
result =
if isOrioledbMatch then
"orioledb-17"
else if isSeventeenMatch then
"17"
else
"15";
in
builtins.trace "Major version result: ${result}" result; # Trace the result # For "15.8"

# Filter SQL test files
filteredSqlTests = filterTestFiles majorVersion ./tests/sql;

pgPort =
if (majorVersion == "17") then
"5535"
else if (majorVersion == "15") then
"5536"
else
"5537";

# Convert filtered tests to a sorted list of basenames (without extension)
testList = pkgs.lib.mapAttrsToList (
name: _: builtins.substring 0 (pkgs.lib.stringLength name - 4) name
Expand Down
11 changes: 0 additions & 11 deletions nix/ext/default.nix

This file was deleted.

95 changes: 0 additions & 95 deletions nix/ext/pgroonga.nix

This file was deleted.

Loading