Skip to content

Commit

Permalink
improve bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
ImreSamu committed Oct 8, 2023
1 parent 3d1f61b commit 9788504
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 25 deletions.
37 changes: 34 additions & 3 deletions 13-3.4-bundle/bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 34 additions & 3 deletions 14-3.4-bundle/bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 34 additions & 3 deletions 15-3.4-bundle/bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 28 additions & 3 deletions 16-3.4-bundle/bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 39 additions & 4 deletions Dockerfile.bundle.template
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ ARG PGIS_V1_TIMESCALEDB_REPOSITORY=https://github.com/timescale/timescaledb.git
ARG PGIS_V1_TIMESCALEDB_CHECKOUT={{ .[env.variant].TIMESCALEDB_CHECKOUT }}
ARG PGIS_V1_TIMESCALEDB_CHECKOUT_SHA1={{ .[env.variant].TIMESCALEDB_CHECKOUT_SHA1 }}

ARG PGIS_V1_PG_HINT_PLAN_REPOSITORY=https://github.com/ossc-db/pg_hint_plan.git
ARG PGIS_V1_PG_HINT_PLAN_CHECKOUT={{ .[env.variant].PG_HINT_PLAN_CHECKOUT }}
ARG PGIS_V1_PG_HINT_PLAN_CHECKOUT_SHA1={{ .[env.variant].PG_HINT_PLAN_CHECKOUT_SHA1 }}

FROM ${PGIS_V1_BASE_IMAGE} AS builder

RUN set -ex \
Expand Down Expand Up @@ -57,6 +61,8 @@ RUN set -ex \
libkrb5-dev \
# pgsql-http
libcurl4-gnutls-dev \
# hydra (columnar)
liblz4-dev \
# pgsql-gzip
zlib1g-dev \
# sqlite_fdw
Expand All @@ -82,6 +88,10 @@ ARG PGIS_V1_TIMESCALEDB_REPOSITORY
ARG PGIS_V1_TIMESCALEDB_CHECKOUT
ARG PGIS_V1_TIMESCALEDB_CHECKOUT_SHA1

ARG PGIS_V1_PG_HINT_PLAN_REPOSITORY
ARG PGIS_V1_PG_HINT_PLAN_CHECKOUT
ARG PGIS_V1_PG_HINT_PLAN_CHECKOUT_SHA1

RUN set -ex \
&& mkdir -p /pgsql-gzip \
&& cd pgsql-gzip \
Expand Down Expand Up @@ -185,14 +195,39 @@ RUN git clone --depth 1 https://github.com/NikolayS/postgres_dba.git \
&& cd postgres_dba \
&& rm -rf .git

{{ if env.version | startswith("16") then ( -}}
# PG16 + hydra not supperted https://github.com/hydradatabase/hydra
{{ ) else ( -}}
# add add https://github.com/hydradatabase/hydra
RUN git clone --depth 1 https://github.com/hydradatabase/hydra \
&& cd hydra/columnar \
&& git checkout main \
&& ./configure \
&& make -j$(nproc) \
&& make install
{{ ) end -}}


# install pg_hint_plan
RUN set -ex \
&& mkdir pg_hint_plan \
&& cd pg_hint_plan \
&& git init \
&& git remote add origin ${PGIS_V1_PG_HINT_PLAN_REPOSITORY} \
&& git fetch --depth 1 origin ${PGIS_V1_PG_HINT_PLAN_CHECKOUT} \
&& git checkout FETCH_HEAD \
# Verify that the commit hash matches the known good one
&& if [ "$(git rev-parse HEAD)" != "$PGIS_V1_PG_HINT_PLAN_CHECKOUT_SHA1" ]; then exit 1; fi \
&& make -j$(nproc) \
&& make install

#TODO: add https://github.com/hydradatabase/hydra
#TODO: add:
# https://github.com/powa-team/pg_qualstats
# https://github.com/darold/pgtt
# https://github.com/apache/arrow-flight-sql-postgresql
# https://github.com/neondatabase/pg_embedding/
# pgrust ; "pg-graphql
# https://github.com/kelvich/pg_tiktoken
# pgrx + https://github.com/kelvich/pg_tiktoken
#
# --------------------------------------------------------------

Expand Down Expand Up @@ -335,10 +370,10 @@ RUN set -eux; \
cp -v /usr/share/postgresql/postgresql.conf.sample /usr/share/postgresql/postgresql.conf.sample.orig; \
{{ if env.version | startswith("16") then ( -}}
# add MobilityDB requirements; ( TimescaleDB not yet supported on pg16 )
echo "shared_preload_libraries = 'postgis-3,pg_cron,pg_stat_statements'" >> /usr/share/postgresql/postgresql.conf.sample; \
echo "shared_preload_libraries = 'pg_hint_plan,postgis-3,pg_cron,pg_stat_statements'" >> /usr/share/postgresql/postgresql.conf.sample; \
{{ ) else ( -}}
# add MobilityDB and TimescaleDB requirements
echo "shared_preload_libraries = 'postgis-3,timescaledb,pg_cron,pg_stat_statements'" >> /usr/share/postgresql/postgresql.conf.sample; \
echo "shared_preload_libraries = 'pg_hint_plan,postgis-3,timescaledb,pg_cron,pg_stat_statements'" >> /usr/share/postgresql/postgresql.conf.sample; \
{{ ) end -}}
# MobilityDB recomendation
echo "max_locks_per_transaction = 128" >> /usr/share/postgresql/postgresql.conf.sample; \
Expand Down
Loading

0 comments on commit 9788504

Please sign in to comment.