Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pg_ivm to the base hydra image #67

Merged
merged 1 commit into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add pg_ivm to the base hydra image
  • Loading branch information
JerrySievert committed Apr 5, 2023
commit 4c4739b79570826f57ec0e76f40445c146474921
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ RUN set -eux; \
COPY --from=s3 /lib/* /s3_lib/
RUN cp -r /s3_lib/* /usr/lib/$(uname -m)-linux-gnu/

# ivm ext
COPY --from=ivm /pg_ivm /

# columnar ext
COPY --from=columnar /pg_ext /

Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.spilo
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ RUN set -eux; \
COPY --from=s3_14 /lib/* /s3_lib/
RUN cp -r /s3_lib/* /usr/lib/$(uname -m)-linux-gnu/

# ivm ext
COPY --from=ivm_13 /pg_ivm /
COPY --from=ivm_14 /pg_ivm /

# columnar ext
COPY --from=columnar_13 /pg_ext /
COPY --from=columnar_14 /pg_ext /
Expand Down
43 changes: 43 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ target "postgres" {
mysql = "target:mysql_${POSTGRES_BASE_VERSION}"
multicorn = "target:multicorn_${POSTGRES_BASE_VERSION}"
s3 = "target:s3_${POSTGRES_BASE_VERSION}"
ivm = "target:ivm_${POSTGRES_BASE_VERSION}"
}

args = {
Expand Down Expand Up @@ -80,6 +81,8 @@ target "spilo" {
multicorn_14 = "target:multicorn_14"
s3_13 = "target:s3_spilo_13"
s3_14 = "target:s3_spilo_14"
ivm_13 = "target:ivm_13"
ivm_14 = "target:ivm_14"
}

args = {
Expand Down Expand Up @@ -325,3 +328,43 @@ target "columnar_14" {
cache-to = ["type=local,dest=tmp/bake_cache/columnar_14"]
cache-from = ["type=local,src=tmp/bake_cache/columnar_14"]
}

target "ivm" {
inherits = ["shared"]
context = "third-party/ivm"
target = "output"

args = {
PGSQL_IVM_TAG = "v1.5.1"
}
}

target "ivm_13" {
inherits = ["ivm"]

contexts = {
postgres_base = "docker-image://postgres:13"
}

args = {
POSTGRES_BASE_VERSION = 13
}

cache-to = ["type=local,dest=tmp/bake_cache/ivm_13"]
cache-from = ["type=local,src=tmp/bake_cache/ivm_13"]
}

target "ivm_14" {
inherits = ["ivm"]

contexts = {
postgres_base = "docker-image://postgres:14"
}

args = {
POSTGRES_BASE_VERSION = 14
}

cache-to = ["type=local,dest=tmp/bake_cache/ivm_14"]
cache-from = ["type=local,src=tmp/bake_cache/ivm_14"]
}
19 changes: 19 additions & 0 deletions third-party/ivm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ubuntu:22.04 as setup

ARG PGSQL_IVM_TAG
ARG POSTGRES_BASE_VERSION=13

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install gnupg postgresql-common git -y
RUN sh /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get upgrade -y && apt-get install lsb-release gcc make libssl-dev autoconf pkg-config postgresql-${POSTGRES_BASE_VERSION} postgresql-server-dev-${POSTGRES_BASE_VERSION} libcurl4-gnutls-dev liblz4-dev libzstd-dev -y

FROM setup as builder

RUN git clone https://github.com/sraoss/pg_ivm --branch ${PGSQL_IVM_TAG} --single-branch && \
cd pg_ivm && \
DESTDIR=/pg_ivm make && \
DESTDIR=/pg_ivm make install

FROM scratch as output

COPY --from=builder /pg_ivm /pg_ivm