-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tembo_parquet_s3_fdw.git to Analytics (#81)
In order to the data warehouse stack into Analytics, add Tembo's fork of `tembo_parquet_s3_fdw` to the Analytics stack as required by support pg_tier. Build the extension in its on `FROM` target and just copy its files, to avoid installing unnecessary dependencies. Exclude Postgres 17 from the build, since `parquet_s3_fdw` doesn't support it yet, and the Analytics stack depends on on Hydra columnar anyway, and it doesn't support Postgres 17, either. Also remove pg_duckdb, as it is now available as a Trunk extension.
- Loading branch information
Showing
2 changed files
with
40 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,50 @@ | ||
ARG PG_VERSION=16 | ||
ARG TAG=c19d507 | ||
ARG TAG=86080de | ||
|
||
FROM quay.io/tembo/standard-cnpg:${PG_VERSION}-${TAG} | ||
FROM quay.io/tembo/standard-cnpg:${PG_VERSION}-${TAG} AS build | ||
USER root | ||
|
||
WORKDIR / | ||
WORKDIR /work | ||
|
||
# Install build dependencies for parquet_s3_fdw and its dependent libraries | ||
RUN apt-get update && apt-get install -y \ | ||
git \ | ||
g++ \ | ||
automake \ | ||
bison \ | ||
build-essential \ | ||
ccache \ | ||
cmake \ | ||
ninja-build \ | ||
flex \ | ||
git \ | ||
libboost-all-dev \ | ||
libcurl4-openssl-dev \ | ||
libevent-dev \ | ||
libprotobuf-dev \ | ||
libprotoc-dev \ | ||
libreadline-dev \ | ||
libssl-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Clone and build parquet_s3_fdw | ||
RUN git clone https://github.com/duckdb/duckdb && \ | ||
cd duckdb && \ | ||
GEN=ninja make | ||
|
||
RUN git clone https://github.com/duckdb/pg_duckdb.git && \ | ||
cd pg_duckdb && \ | ||
make install | ||
libtool \ | ||
libxml2-dev \ | ||
libxml2-utils \ | ||
libxslt-dev \ | ||
pkg-config \ | ||
protobuf-compiler \ | ||
xsltproc \ | ||
zlib1g-dev | ||
|
||
# Clone and build Tembo's fork of parquet_s3_fdw (required for pg_tier). | ||
RUN git clone https://github.com/tembo-io/tembo_parquet_s3_fdw.git \ | ||
&& (cd tembo_parquet_s3_fdw && git checkout v1.1.4) \ | ||
&& make -C tembo_parquet_s3_fdw USE_PGXS=1 install DESTDIR="$PWD/target" | ||
|
||
# Copy the files to the final image. | ||
FROM quay.io/tembo/standard-cnpg:${PG_VERSION}-${TAG} | ||
USER root | ||
COPY --from=build /work/target/./ / | ||
|
||
# cache all extensions | ||
RUN set -eux; \ | ||
cp -r $(pg_config --pkglibdir)/* /tmp/pg_pkglibdir; \ | ||
cp -r $(pg_config --sharedir)/* /tmp/pg_sharedir; | ||
|
||
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH | ||
|
||
# Revert the postgres user to id 26 | ||
RUN usermod -u 26 postgres | ||
USER 26 |