Skip to content

Commit

Permalink
pg: add pg_search and pg_analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
elvizlai committed Jan 3, 2025
1 parent 39440b9 commit 9f98ce8
Show file tree
Hide file tree
Showing 8 changed files with 292 additions and 83 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/infra-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,6 @@ name: Infra DB
on: workflow_dispatch

jobs:
build-pg-14:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: "true"

# https://github.com/docker/login-action
- name: Log into docker hub
uses: docker/login-action@v2
with:
username: sdrzlyz
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build image
run: |
bash ./build.sh pg 14
build-pg-15:
runs-on: ubuntu-latest

Expand Down
41 changes: 28 additions & 13 deletions pg/Dockerfile-15
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ ARG PGROUTING=3.7.1
ARG TIMESCALE=2.17.2
ARG SP_VAULT=0.2.9
ARG ZOMBODB=3000.2.7
ARG PARADEDB=0.13.2
ARG PG_ANALYTICS=0.2.4
ARG PGVECTOR=0.8.0
ARG PG_MQ=1.5.0
ARG PG_HINT_PLAN=15_1_5_2
ARG PG_CRON=1.6.4
ARG PG_IVM=1.9
ARG PG_MQ=1.5.0
ARG PG_HINT_PLAN=15_1_5_2
ARG ORAFCE=4_14_1
ARG PGSQL_HTTP=1.6.1
ARG PGAUDIT=1.7.0
Expand Down Expand Up @@ -58,7 +60,7 @@ RUN sudo apt-get install -y --no-install-recommends \
git \
dpkg-dev \
gcc \
libc-dev \
libc6-dev \
make \
cmake \
wget \
Expand Down Expand Up @@ -136,20 +138,23 @@ RUN sudo apt-get install -y --no-install-recommends \
&& cargo install -j$(nproc) cargo-pgrx --version $(cat Cargo.toml | grep "pgrx = " | sed 's/pgrx = //g' | sed 's/"//g') \
&& cargo pgrx init --pg${PG_MAJOR}=$(which pg_config) \
&& sudo bash -c 'CARGO_HOME=/tmp/cargo RUSTUP_HOME=/tmp/rustup PATH=$CARGO_HOME/bin:$PATH PGRX_HOME=/var/lib/postgresql/.pgrx cargo pgrx install --release' \
# paradedb https://github.com/paradedb/paradedb
&& git clone -b v${PARADEDB} https://github.com/paradedb/paradedb /tmp/paradedb \
&& cd /tmp/paradedb \
&& PGRX_VERSION=$(cargo tree --depth 1 -i pgrx -p pg_search | head -n 1 | sed -E 's/.*v([0-9]+\.[0-9]+\.[0-9]+).*/\1/') \
&& echo "PGRX_VERSION=$PGRX_VERSION" \
&& cargo install --locked cargo-pgrx --version "${PGRX_VERSION}" \
&& cargo pgrx init "--pg${PG_MAJOR}=/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config" \
&& cd /tmp/paradedb/pg_search \
&& sudo bash -c 'CARGO_HOME=/tmp/cargo RUSTUP_HOME=/tmp/rustup PATH=$CARGO_HOME/bin:$PATH PGRX_HOME=/var/lib/postgresql/.pgrx PARADEDB_TELEMETRY=false cargo pgrx install --release --features icu' \
# pg_analytics https://github.com/paradedb/pg_analytics
&& git clone --branch v${PG_ANALYTICS} https://github.com/paradedb/pg_analytics /tmp/pg_analytics \
&& cd /tmp/pg_analytics \
&& sudo bash -c 'CARGO_HOME=/tmp/cargo RUSTUP_HOME=/tmp/rustup PATH=$CARGO_HOME/bin:$PATH PGRX_HOME=/var/lib/postgresql/.pgrx cargo pgrx install --release' \
# vector https://github.com/pgvector/pgvector/tags
&& git clone -b v${PGVECTOR} https://github.com/pgvector/pgvector /tmp/pgvector \
&& cd /tmp/pgvector \
&& make && sudo make install \
# pgmq https://github.com/tembo-io/pgmq
&& git clone -b v${PG_MQ} https://github.com/tembo-io/pgmq /tmp/pgmq \
&& cd /tmp/pgmq/pgmq-extension \
&& make && sudo make install \
# pg_hint_plan https://github.com/ossc-db/pg_hint_plan
&& wget -O /tmp/pg_hint_plan.tar.gz "https://github.com/ossc-db/pg_hint_plan/archive/REL${PG_HINT_PLAN}.tar.gz" \
&& mkdir -p /tmp/pg_hint_plan \
&& tar --extract --file /tmp/pg_hint_plan.tar.gz --directory /tmp/pg_hint_plan --strip-components 1 \
&& cd /tmp/pg_hint_plan \
&& make && sudo make install \
# pg_cron https://github.com/citusdata/pg_cron
&& wget -O /tmp/pg_cron.tar.gz "https://github.com/citusdata/pg_cron/archive/v${PG_CRON}.tar.gz" \
&& mkdir -p /tmp/pg_cron \
Expand All @@ -162,6 +167,16 @@ RUN sudo apt-get install -y --no-install-recommends \
&& tar -zxf /tmp/pg_ivm.tar.gz -C /tmp/pg_ivm --strip-components 1 \
&& cd /tmp/pg_ivm \
&& make && sudo make install \
# pgmq https://github.com/tembo-io/pgmq
&& git clone -b v${PG_MQ} https://github.com/tembo-io/pgmq /tmp/pgmq \
&& cd /tmp/pgmq/pgmq-extension \
&& make && sudo make install \
# pg_hint_plan https://github.com/ossc-db/pg_hint_plan
&& wget -O /tmp/pg_hint_plan.tar.gz "https://github.com/ossc-db/pg_hint_plan/archive/REL${PG_HINT_PLAN}.tar.gz" \
&& mkdir -p /tmp/pg_hint_plan \
&& tar --extract --file /tmp/pg_hint_plan.tar.gz --directory /tmp/pg_hint_plan --strip-components 1 \
&& cd /tmp/pg_hint_plan \
&& make && sudo make install \
# orafce https://github.com/orafce/orafce
&& wget -O /tmp/orafce.tar.gz "https://github.com/orafce/orafce/archive/VERSION_${ORAFCE}.tar.gz" \
&& mkdir -p /tmp/orafce \
Expand Down
45 changes: 30 additions & 15 deletions pg/Dockerfile-16
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ ARG PGROUTING=3.7.1
ARG TIMESCALE=2.17.2
ARG SP_VAULT=0.2.9
ARG ZOMBODB=3000.2.7
ARG PARADEDB=0.13.2
ARG PG_ANALYTICS=0.2.4
ARG PGVECTOR=0.8.0
ARG PG_MQ=1.5.0
ARG PG_HINT_PLAN=16_1_6_1
ARG PG_CRON=1.6.4
ARG PG_IVM=1.9
ARG PG_MQ=1.5.0
ARG PG_HINT_PLAN=16_1_6_1
ARG ORAFCE=4_14_1
ARG PGSQL_HTTP=1.6.1
ARG PGAUDIT=16.0
Expand Down Expand Up @@ -58,7 +60,7 @@ RUN sudo apt-get install -y --no-install-recommends \
git \
dpkg-dev \
gcc \
libc-dev \
libc6-dev \
make \
cmake \
wget \
Expand Down Expand Up @@ -129,27 +131,30 @@ RUN sudo apt-get install -y --no-install-recommends \
&& cd /tmp/age \
&& make && sudo make install \
# zombodb https://github.com/zombodb/zombodb
# && export CARGO_HOME=/tmp/cargo && export RUSTUP_HOME=/tmp/rustup && export PATH=$CARGO_HOME/bin:$PATH \
# && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \
&& export CARGO_HOME=/tmp/cargo && export RUSTUP_HOME=/tmp/rustup && export PATH=$CARGO_HOME/bin:$PATH \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \
# && git clone -b v${ZOMBODB} https://github.com/zombodb/zombodb /tmp/zombodb \
# && cd /tmp/zombodb \
# && cargo install -j$(nproc) cargo-pgrx --version $(cat Cargo.toml | grep "pgrx = " | sed 's/pgrx = //g' | sed 's/"//g') \
# && cargo pgrx init --pg${PG_MAJOR}=$(which pg_config) \
# && sudo bash -c 'CARGO_HOME=/tmp/cargo RUSTUP_HOME=/tmp/rustup PATH=$CARGO_HOME/bin:$PATH PGRX_HOME=/var/lib/postgresql/.pgrx cargo pgrx install --release' \
# paradedb https://github.com/paradedb/paradedb
&& git clone -b v${PARADEDB} https://github.com/paradedb/paradedb /tmp/paradedb \
&& cd /tmp/paradedb \
&& PGRX_VERSION=$(cargo tree --depth 1 -i pgrx -p pg_search | head -n 1 | sed -E 's/.*v([0-9]+\.[0-9]+\.[0-9]+).*/\1/') \
&& echo "PGRX_VERSION=$PGRX_VERSION" \
&& cargo install --locked cargo-pgrx --version "${PGRX_VERSION}" \
&& cargo pgrx init "--pg${PG_MAJOR}=/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config" \
&& cd /tmp/paradedb/pg_search \
&& sudo bash -c 'CARGO_HOME=/tmp/cargo RUSTUP_HOME=/tmp/rustup PATH=$CARGO_HOME/bin:$PATH PGRX_HOME=/var/lib/postgresql/.pgrx PARADEDB_TELEMETRY=false cargo pgrx install --release --features icu' \
# pg_analytics https://github.com/paradedb/pg_analytics
&& git clone --branch v${PG_ANALYTICS} https://github.com/paradedb/pg_analytics /tmp/pg_analytics \
&& cd /tmp/pg_analytics \
&& sudo bash -c 'CARGO_HOME=/tmp/cargo RUSTUP_HOME=/tmp/rustup PATH=$CARGO_HOME/bin:$PATH PGRX_HOME=/var/lib/postgresql/.pgrx cargo pgrx install --release' \
# vector https://github.com/pgvector/pgvector/tags
&& git clone -b v${PGVECTOR} https://github.com/pgvector/pgvector /tmp/pgvector \
&& cd /tmp/pgvector \
&& make && sudo make install \
# pgmq https://github.com/tembo-io/pgmq
&& git clone -b v${PG_MQ} https://github.com/tembo-io/pgmq /tmp/pgmq \
&& cd /tmp/pgmq/pgmq-extension \
&& make && sudo make install \
# pg_hint_plan https://github.com/ossc-db/pg_hint_plan
&& wget -O /tmp/pg_hint_plan.tar.gz "https://github.com/ossc-db/pg_hint_plan/archive/REL${PG_HINT_PLAN}.tar.gz" \
&& mkdir -p /tmp/pg_hint_plan \
&& tar --extract --file /tmp/pg_hint_plan.tar.gz --directory /tmp/pg_hint_plan --strip-components 1 \
&& cd /tmp/pg_hint_plan \
&& make && sudo make install \
# pg_cron https://github.com/citusdata/pg_cron
&& wget -O /tmp/pg_cron.tar.gz "https://github.com/citusdata/pg_cron/archive/v${PG_CRON}.tar.gz" \
&& mkdir -p /tmp/pg_cron \
Expand All @@ -162,6 +167,16 @@ RUN sudo apt-get install -y --no-install-recommends \
&& tar -zxf /tmp/pg_ivm.tar.gz -C /tmp/pg_ivm --strip-components 1 \
&& cd /tmp/pg_ivm \
&& make && sudo make install \
# pgmq https://github.com/tembo-io/pgmq
&& git clone -b v${PG_MQ} https://github.com/tembo-io/pgmq /tmp/pgmq \
&& cd /tmp/pgmq/pgmq-extension \
&& make && sudo make install \
# pg_hint_plan https://github.com/ossc-db/pg_hint_plan
&& wget -O /tmp/pg_hint_plan.tar.gz "https://github.com/ossc-db/pg_hint_plan/archive/REL${PG_HINT_PLAN}.tar.gz" \
&& mkdir -p /tmp/pg_hint_plan \
&& tar --extract --file /tmp/pg_hint_plan.tar.gz --directory /tmp/pg_hint_plan --strip-components 1 \
&& cd /tmp/pg_hint_plan \
&& make && sudo make install \
# orafce https://github.com/orafce/orafce
&& wget -O /tmp/orafce.tar.gz "https://github.com/orafce/orafce/archive/VERSION_${ORAFCE}.tar.gz" \
&& mkdir -p /tmp/orafce \
Expand Down
47 changes: 31 additions & 16 deletions pg/Dockerfile-17
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ ARG PGROUTING=3.7.1
ARG TIMESCALE=2.17.2
ARG SP_VAULT=0.2.9
ARG ZOMBODB=3000.2.7
ARG PARADEDB=0.13.2
ARG PG_ANALYTICS=0.2.4
ARG PGVECTOR=0.8.0
ARG PG_MQ=1.5.0
ARG PG_HINT_PLAN=17_1_7_0
ARG PG_CRON=1.6.4
ARG PG_IVM=1.9
ARG PG_MQ=1.5.0
ARG PG_HINT_PLAN=17_1_7_0
ARG ORAFCE=4_14_1
ARG PGSQL_HTTP=1.6.1
ARG PGAUDIT=17.0
Expand Down Expand Up @@ -81,7 +83,7 @@ RUN sudo apt-get install -y --no-install-recommends \
# citus https://github.com/citusdata/citus https://github.com/citusdata/docker/blob/master/Dockerfile
&& curl -s https://install.citusdata.com/community/deb.sh | sudo bash \
&& sudo apt-get install -y --no-install-recommends \
postgresql-$PG_MAJOR-citus-12.1=$CITUS.citus-1 \
#postgresql-$PG_MAJOR-citus-12.1=$CITUS.citus-1 \
# postgis https://github.com/postgis/postgis/tags https://github.com/postgis/docker-postgis/blob/master/17-3.5/Dockerfile
postgresql-$PG_MAJOR-postgis-3=$POSTGIS \
postgresql-$PG_MAJOR-postgis-3-scripts \
Expand Down Expand Up @@ -129,27 +131,30 @@ RUN sudo apt-get install -y --no-install-recommends \
&& cd /tmp/age \
&& make && sudo make install \
# zombodb https://github.com/zombodb/zombodb
# && export CARGO_HOME=/tmp/cargo && export RUSTUP_HOME=/tmp/rustup && export PATH=$CARGO_HOME/bin:$PATH \
# && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \
&& export CARGO_HOME=/tmp/cargo && export RUSTUP_HOME=/tmp/rustup && export PATH=$CARGO_HOME/bin:$PATH \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \
# && git clone -b v${ZOMBODB} https://github.com/zombodb/zombodb /tmp/zombodb \
# && cd /tmp/zombodb \
# && cargo install -j$(nproc) cargo-pgrx --version $(cat Cargo.toml | grep "pgrx = " | sed 's/pgrx = //g' | sed 's/"//g') \
# && cargo pgrx init --pg${PG_MAJOR}=$(which pg_config) \
# && sudo bash -c 'CARGO_HOME=/tmp/cargo RUSTUP_HOME=/tmp/rustup PATH=$CARGO_HOME/bin:$PATH PGRX_HOME=/var/lib/postgresql/.pgrx cargo pgrx install --release' \
# paradedb https://github.com/paradedb/paradedb
&& git clone -b v${PARADEDB} https://github.com/paradedb/paradedb /tmp/paradedb \
&& cd /tmp/paradedb \
&& PGRX_VERSION=$(cargo tree --depth 1 -i pgrx -p pg_search | head -n 1 | sed -E 's/.*v([0-9]+\.[0-9]+\.[0-9]+).*/\1/') \
&& echo "PGRX_VERSION=$PGRX_VERSION" \
&& cargo install --locked cargo-pgrx --version "${PGRX_VERSION}" \
&& cargo pgrx init "--pg${PG_MAJOR}=/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config" \
&& cd /tmp/paradedb/pg_search \
&& sudo bash -c 'CARGO_HOME=/tmp/cargo RUSTUP_HOME=/tmp/rustup PATH=$CARGO_HOME/bin:$PATH PGRX_HOME=/var/lib/postgresql/.pgrx PARADEDB_TELEMETRY=false cargo pgrx install --release --features icu' \
# pg_analytics https://github.com/paradedb/pg_analytics
&& git clone --branch v${PG_ANALYTICS} https://github.com/paradedb/pg_analytics /tmp/pg_analytics \
&& cd /tmp/pg_analytics \
&& sudo bash -c 'CARGO_HOME=/tmp/cargo RUSTUP_HOME=/tmp/rustup PATH=$CARGO_HOME/bin:$PATH PGRX_HOME=/var/lib/postgresql/.pgrx cargo pgrx install --release' \
# vector https://github.com/pgvector/pgvector/tags
&& git clone -b v${PGVECTOR} https://github.com/pgvector/pgvector /tmp/pgvector \
&& cd /tmp/pgvector \
&& make && sudo make install \
# pgmq https://github.com/tembo-io/pgmq
&& git clone -b v${PG_MQ} https://github.com/tembo-io/pgmq /tmp/pgmq \
&& cd /tmp/pgmq/pgmq-extension \
&& make && sudo make install \
# pg_hint_plan https://github.com/ossc-db/pg_hint_plan
&& wget -O /tmp/pg_hint_plan.tar.gz "https://github.com/ossc-db/pg_hint_plan/archive/REL${PG_HINT_PLAN}.tar.gz" \
&& mkdir -p /tmp/pg_hint_plan \
&& tar --extract --file /tmp/pg_hint_plan.tar.gz --directory /tmp/pg_hint_plan --strip-components 1 \
&& cd /tmp/pg_hint_plan \
&& make && sudo make install \
# pg_cron https://github.com/citusdata/pg_cron
&& wget -O /tmp/pg_cron.tar.gz "https://github.com/citusdata/pg_cron/archive/v${PG_CRON}.tar.gz" \
&& mkdir -p /tmp/pg_cron \
Expand All @@ -162,6 +167,16 @@ RUN sudo apt-get install -y --no-install-recommends \
&& tar -zxf /tmp/pg_ivm.tar.gz -C /tmp/pg_ivm --strip-components 1 \
&& cd /tmp/pg_ivm \
&& make && sudo make install \
# pgmq https://github.com/tembo-io/pgmq
&& git clone -b v${PG_MQ} https://github.com/tembo-io/pgmq /tmp/pgmq \
&& cd /tmp/pgmq/pgmq-extension \
&& make && sudo make install \
# pg_hint_plan https://github.com/ossc-db/pg_hint_plan
&& wget -O /tmp/pg_hint_plan.tar.gz "https://github.com/ossc-db/pg_hint_plan/archive/REL${PG_HINT_PLAN}.tar.gz" \
&& mkdir -p /tmp/pg_hint_plan \
&& tar --extract --file /tmp/pg_hint_plan.tar.gz --directory /tmp/pg_hint_plan --strip-components 1 \
&& cd /tmp/pg_hint_plan \
&& make && sudo make install \
# orafce https://github.com/orafce/orafce
&& wget -O /tmp/orafce.tar.gz "https://github.com/orafce/orafce/archive/VERSION_${ORAFCE}.tar.gz" \
&& mkdir -p /tmp/orafce \
Expand Down Expand Up @@ -217,7 +232,7 @@ RUN sudo apt-get install -y --no-install-recommends \
git \
dpkg-dev \
gcc \
libc-dev \
libc6-dev \
make \
cmake \
wget \
Expand Down
Loading

0 comments on commit 9f98ce8

Please sign in to comment.