-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
109 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 +1,6 @@ | ||
[package] | ||
name = "pg_tier" | ||
version = "0.0.2" | ||
version = "0.0.3" | ||
edition = "2021" | ||
|
||
[lib] | ||
|
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: '3.2' | ||
|
||
services: | ||
postgres: | ||
restart: always | ||
image: quay.io/tembo/tier-pg:latest | ||
ports: | ||
- 5432:5432 | ||
environment: | ||
- POSTGRES_PASSWORD=postgres |
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
FROM postgres:15.4-bookworm as builder | ||
|
||
ARG PGTIER_VER=0.0.3 | ||
ARG PGRX_VER=0.11.3 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
ca-certificates \ | ||
clang \ | ||
curl \ | ||
gcc \ | ||
git \ | ||
libssl-dev \ | ||
make \ | ||
pkg-config \ | ||
postgresql-server-dev-15 \ | ||
automake \ | ||
bison \ | ||
build-essential \ | ||
ccache \ | ||
cmake \ | ||
flex \ | ||
g++ \ | ||
libboost-all-dev \ | ||
libcurl4-openssl-dev \ | ||
libevent-dev \ | ||
libprotobuf-dev \ | ||
libprotoc-dev \ | ||
libreadline-dev \ | ||
libssl-dev \ | ||
libtool \ | ||
libxml2-dev \ | ||
libxml2-utils \ | ||
libxslt-dev \ | ||
protobuf-compiler \ | ||
xsltproc \ | ||
zlib1g-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Clone and build AWS SDK for C++ | ||
RUN git clone https://github.com/aws/aws-sdk-cpp.git && \ | ||
cd aws-sdk-cpp && \ | ||
git checkout 1.9.263 && \ | ||
git submodule update --init --recursive && \ | ||
mkdir build && cd build && \ | ||
cmake -DBUILD_ONLY="s3;core;config;sts;cognito-identity;transfer;identity-management" -DAUTORUN_UNIT_TESTS=OFF -DCMAKE_CXX_FLAGS=-Wno-error=deprecated-declarations .. && \ | ||
make -j$(nproc) && \ | ||
make install && \ | ||
cd ../../ && rm -rf aws-sdk-cpp | ||
|
||
# Clone and build Apache Arrow | ||
RUN git clone https://github.com/apache/arrow.git && \ | ||
cd arrow && \ | ||
git checkout apache-arrow-7.0.1 && \ | ||
cd cpp && \ | ||
mkdir build && cd build && \ | ||
cmake -DARROW_PARQUET=ON -DARROW_S3=ON -DARROW_WITH_SNAPPY=ON .. && \ | ||
make -j$(nproc) && \ | ||
make install && \ | ||
cd ../../ && rm -rf arrow | ||
|
||
# Clone and build parquet_s3_fdw | ||
RUN git clone https://github.com/pgspider/parquet_s3_fdw.git && \ | ||
cd parquet_s3_fdw && \ | ||
git checkout v1.1.0 \ | ||
make install PG_CONFIG=$(which pg_config) | ||
|
||
WORKDIR /pg_tier | ||
|
||
# Install Rust dependencies | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
RUN $HOME/.cargo/bin/rustup default stable | ||
|
||
# install pgrx | ||
RUN $HOME/.cargo/bin/cargo install cargo-pgrx --version=$PGRX_VER --locked | ||
|
||
# init pgrx with postgres | ||
RUN $HOME/.cargo/bin/cargo pgrx init --pg15 $(which pg_config) | ||
|
||
# install pg_tier | ||
RUN git clone https://github.com/tembo-io/pg_tier.git && \ | ||
cd pg_tier && git fetch origin v$PGTIER_VER && \ | ||
git checkout v$PGTIER_VER && \ | ||
$HOME/.cargo/bin/cargo pgrx install --pg-config=$(which pg_config) && \ | ||
cd .. && rm -rf pg_tier | ||
|
||
FROM postgres:15.4-bookworm | ||
|
||
COPY --from=builder /usr/share/postgresql/15/extension /usr/share/postgresql/15/extension | ||
COPY --from=builder /usr/lib/postgresql/15/lib /usr/lib/postgresql/15/lib | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y ca-certificates | ||
|
||
USER postgres | ||
CMD ["postgres"] |