From d2ca5811e3a9e8acbc23e22ceae9cf2a0a21b145 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Wed, 11 Dec 2024 12:21:48 -0600 Subject: [PATCH] Add pg_repack extension Our solutions engineers and some customers would like to have this extension available. We are using a commit instead of a tagged release because pg_repack maintainers have not tagged a release which contains the commit that allows us to run pg_repack as a non-superuser. Closes: https://github.com/neondatabase/cloud/issues/18890 Link: https://github.com/reorg/pg_repack/pull/431#issuecomment-2536715481 Signed-off-by: Tristan Partin --- compute/compute-node.Dockerfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/compute/compute-node.Dockerfile b/compute/compute-node.Dockerfile index 33d2a10285216..3c9a46bba6078 100644 --- a/compute/compute-node.Dockerfile +++ b/compute/compute-node.Dockerfile @@ -1168,6 +1168,29 @@ RUN case "${PG_VERSION}" in \ make BUILD_TYPE=release -j $(getconf _NPROCESSORS_ONLN) install && \ echo 'trusted = true' >> /usr/local/pgsql/share/extension/pg_mooncake.control +######################################################################################### +# +# Layer "pg_repack" +# compile pg_repack extension +# +######################################################################################### + +FROM build-deps AS pg-repack-build +ARG PG_VERSION +COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/ + +# pg_repack has not created a new tag with following commit, yet. +ENV PG_REPACK_VERSION=85b64c6d4f599b2988343c4e7121acab505c9006 +ENV PATH="/usr/local/pgsql/bin/:$PATH" + +RUN git clone --depth 1 https://github.com/reorg/pg_repack.git pg_repack-src && \ + cd pg_repack-src && \ + git checkout "${PG_REPACK_VERSION}" && \ + make -j $(getconf _NPROCESSORS_ONLN) && \ + make -j $(getconf _NPROCESSORS_ONLN) install && \ + echo 'trusted = true' >> /usr/local/pgsql/share/extension/pg_repack.control + + ######################################################################################### # # Layer "neon-pg-ext-build" @@ -1213,6 +1236,7 @@ COPY --from=pg-anon-pg-build /usr/local/pgsql/ /usr/local/pgsql/ COPY --from=pg-ivm-build /usr/local/pgsql/ /usr/local/pgsql/ COPY --from=pg-partman-build /usr/local/pgsql/ /usr/local/pgsql/ COPY --from=pg-mooncake-build /usr/local/pgsql/ /usr/local/pgsql/ +COPY --from=pg-repack-build /usr/local/pgsql/ /usr/local/pgsql/ COPY pgxn/ pgxn/ RUN make -j $(getconf _NPROCESSORS_ONLN) \