From 592ca9db46818577f306b8ed25512929138a3be3 Mon Sep 17 00:00:00 2001 From: elvizlai Date: Thu, 16 Jan 2025 09:46:18 +0800 Subject: [PATCH] feat: anon --- pg/Dockerfile-15 | 8 ++++++++ pg/dev.md | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/pg/Dockerfile-15 b/pg/Dockerfile-15 index 9563231..6a65a29 100644 --- a/pg/Dockerfile-15 +++ b/pg/Dockerfile-15 @@ -24,6 +24,7 @@ ARG SP_VAULT=0.2.9 ARG ZOMBODB=3000.2.7 ARG PARADEDB=0.14.0 ARG PG_ANALYTICS=0.3.0 +ARG PG_ANON=2.0.0 ARG PGVECTOR=0.8.0 ARG PG_CRON=1.6.4 ARG PG_IVM=1.9 @@ -151,6 +152,13 @@ RUN sudo apt-get install -y --no-install-recommends \ && 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' \ +# pg_anonymizer https://gitlab.com/dalibo/postgresql_anonymizer + && git clone --branch ${PG_ANON} https://gitlab.com/dalibo/postgresql_anonymizer.git /tmp/pg_anonymizer \ + && cd /tmp/pg_anonymizer \ + && cargo install -j$(nproc) cargo-pgrx --version $(cat Cargo.toml | grep "pgrx = " | sed 's/pgrx = //g' | sed 's/"//g') \ + && PGRX_HOME=/var/lib/postgresql/.pgrx cargo pgrx init "--pg${PG_MAJOR}=/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config" \ + && PGRX_HOME=/var/lib/postgresql/.pgrx make extension PG_CONFIG=/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config PGVER="pg${PG_MAJOR}" \ + && sudo bash -c 'CARGO_HOME=/tmp/cargo RUSTUP_HOME=/tmp/rustup PATH=$CARGO_HOME/bin:$PATH PGRX_HOME=/var/lib/postgresql/.pgrx PG_MAJOR=15 make install PG_CONFIG=/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config PGVER="pg${PG_MAJOR}"' \ # vector https://github.com/pgvector/pgvector/tags && git clone -b v${PGVECTOR} https://github.com/pgvector/pgvector /tmp/pgvector \ && cd /tmp/pgvector \ diff --git a/pg/dev.md b/pg/dev.md index f7abf63..ee9edd3 100644 --- a/pg/dev.md +++ b/pg/dev.md @@ -16,6 +16,7 @@ export SP_VAULT=0.2.9 export ZOMBODB=3000.2.7 export PARADEDB=0.14.0 export PG_ANALYTICS=0.3.0 +export PG_ANON=2.0.0 export PGVECTOR=0.8.0 export PG_CRON=1.6.4 export PG_IVM=1.9 @@ -87,6 +88,14 @@ cd /tmp/pg_analytics cargo pgrx install --release +git clone --branch ${PG_ANON} https://gitlab.com/dalibo/postgresql_anonymizer.git /tmp/pg_anonymizer +cd /tmp/pg_anonymizer +cargo install -j$(nproc) cargo-pgrx --version $(cat Cargo.toml | grep "pgrx = " | sed 's/pgrx = //g' | sed 's/"//g') +PGRX_HOME=/var/lib/postgresql/.pgrx cargo pgrx init "--pg${PG_MAJOR}=/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config" +PGRX_HOME=/var/lib/postgresql/.pgrx make extension PG_CONFIG=/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config PGVER="pg${PG_MAJOR}" +PGRX_HOME=/var/lib/postgresql/.pgrx make install PG_CONFIG=/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config PGVER="pg${PG_MAJOR}" + + cp /usr/include/postgresql/15/server/pg_config.h /usr/include/postgresql/ # repmgr https://github.com/EnterpriseDB/repmgr