Skip to content

Commit c60626a

Browse files
committed
add zombodb extension
Signed-off-by: Piyush Raj <piyushraj92739@gmail.com>
1 parent 7fd3328 commit c60626a

File tree

6 files changed

+80
-6
lines changed

6 files changed

+80
-6
lines changed

Dockerfile

+30-1
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,33 @@ RUN set -eux \
200200
# clean
201201
&& cd / \
202202
&& rm -rf /usr/src/postgis \
203-
&& apk del .fetch-deps .build-deps
203+
&& apk del .fetch-deps .build-deps
204+
205+
ENV RUSTFLAGS="-C target-feature=-crt-static target-cpu=native target-cpu=native link-arg=-fuse-ld=lld"
206+
ARG ZOMBODB_VERSION
207+
RUN apk add --no-cache --virtual .zombodb-build-deps \
208+
git \
209+
curl \
210+
bash \
211+
ruby-dev \
212+
ruby-etc \
213+
musl-dev \
214+
make \
215+
gcc \
216+
coreutils \
217+
util-linux-dev \
218+
musl-dev \
219+
openssl-dev \
220+
clang15 \
221+
tar \
222+
&& gem install --no-document fpm \
223+
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \
224+
&& PATH=$HOME/.cargo/bin:$PATH \
225+
&& cargo install cargo-pgrx --version 0.9.3 \
226+
&& cargo pgrx init --pg${PG_VERSION}=$(which pg_config) \
227+
&& git clone --depth 1 --branch ${ZOMBODB_VERSION} https://github.com/zombodb/zombodb.git \
228+
&& cd ./zombodb \
229+
&& cargo pgrx install --release \
230+
&& cd .. \
231+
&& rm -rf ./zombodb \
232+
&& apk del .zombodb-build-deps

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-)
77
TS_VERSION=2.13.0
88
PG_CRON_VERSION=v1.6.0
99
POSTGIS_VERSION=3.4.1
10+
ZOMBODB_VERSION=v3000.2.3
1011
PREV_TS_VERSION=$(shell wget --quiet -O - https://raw.githubusercontent.com/timescale/timescaledb/${TS_VERSION}/version.config | grep update_from_version | sed -e 's!update_from_version = !!')
1112
PREV_TS_IMAGE="timescale/timescaledb:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)$(PREV_EXTRA)"
1213
PREV_IMAGE=$(shell if docker pull $(PREV_TS_IMAGE) >/dev/null; then echo "$(PREV_TS_IMAGE)"; else echo "postgres:$(PG_VER_NUMBER)-alpine"; fi )
@@ -30,7 +31,8 @@ DOCKER_BUILD_ARGS = --build-arg TS_VERSION=$(TS_VERSION) \
3031
--build-arg PG_VERSION=$(PG_VER_NUMBER) \
3132
--build-arg PREV_IMAGE=$(PREV_IMAGE) \
3233
--build-arg PG_CRON_VERSION=$(PG_CRON_VERSION) \
33-
--build-arg POSTGIS_VERSION=$(POSTGIS_VERSION)
34+
--build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \
35+
--build-arg ZOMBODB_VERSION=$(ZOMBODB_VERSION)
3436

3537

3638
default: image

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- [x] [TimescaleDB](https://github.com/timescale/timescaledb)
88
- [x] [PgCron ](https://github.com/citusdata/pg_cron)
99
- [x] [PostGIS](https://postgis.net)
10+
- [x] [ZomboDB](https://github.com/zombodb/zombodb)
1011
- [ ] [Citus](https://www.citusdata.com/)
1112

1213
## Releases

bitnami/Dockerfile

+40
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,46 @@ RUN set -eux \
208208
/tmp/* \
209209
/var/tmp/*
210210

211+
# Install zombodb extension
212+
ARG PG_MAJOR
213+
ENV RUSTFLAGS="-C target-cpu=native target-cpu=native link-arg=-fuse-ld=lld"
214+
RUN apt-get update -y -qq --fix-missing \
215+
&& apt-get install -y wget gnupg \
216+
&& echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" >> /etc/apt/sources.list \
217+
&& echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list \
218+
&& wget --quiet -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
219+
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 \
220+
&& apt update \
221+
&& apt-get update -y --fix-missing \
222+
&& apt-get install -y git curl clang-14 llvm-14 gcc make build-essential libz-dev zlib1g-dev pkg-config libreadline-dev libgdbm-dev libssl1.0-dev \
223+
&& wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz \
224+
&& tar -xzvf openssl-1.0.2l.tar.gz \
225+
&& cd openssl-1.0.2l \
226+
&& ./config \
227+
&& make install \
228+
&& ln -sf /usr/local/ssl/bin/openssl `which openssl` \
229+
&& mkdir ruby \
230+
&& cd ruby \
231+
&& wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz \
232+
&& tar xvfz ruby-2.3.0.tar.gz \
233+
&& cd ruby-2.3.0 \
234+
&& ./configure --with-openssl-dir=/usr/include/openssl-1.0 \
235+
&& make -j64 \
236+
&& make install \
237+
&& gem install --no-document fpm \
238+
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
239+
&& export PATH="/.cargo/bin:$PATH" \
240+
&& export PGRX_HOME="/.pgrx/" \
241+
&& mkdir -p $PGRX_HOME \
242+
&& cargo install cargo-pgrx --version 0.9.3 \
243+
&& cargo pgrx init --pg${PG_MAJOR}=/opt/bitnami/postgresql/bin/pg_config \
244+
&& git clone --depth 1 --branch ${ZOMBODB_VERSION} https://github.com/zombodb/zombodb.git \
245+
&& cd zombodb \
246+
&& export PATH="/.cargo/bin:$PATH" && cargo pgrx install --release \
247+
&& cd / \
248+
&& apt-get autoremove --purge -y git curl clang-14 gcc make build-essential wget \
249+
&& rm -rf .cargo .gem openssl-1.0.2l .rustup openssl-1.0.2l.tar.gz
250+
211251
USER 1001
212252

213253
ENTRYPOINT [ "/opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh" ]

bitnami/Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ PG_VER=pg15
66
PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-)
77
PG_CRON_VERSION=v1.6.0
88
TS_VERSION=2.13.0
9-
POSTGIS_VERSION=3.4.1
9+
POSTGIS_VERSION=3.4.1
10+
ZOMBODB_VERSION=v3000.2.3
1011
PREV_TS_VERSION=$(shell wget --quiet -O - https://raw.githubusercontent.com/timescale/timescaledb/${TS_VERSION}/version.config | grep update_from_version | sed -e 's!update_from_version = !!')
1112
PREV_TS_IMAGE="timescale/timescaledb:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)-bitnami"
1213
PREV_IMAGE=$(shell if docker pull $(PREV_TS_IMAGE) >/dev/null; then echo "$(PREV_TS_IMAGE)"; else echo "bitnami/postgresql:$(PG_VER_NUMBER)"; fi )
@@ -27,7 +28,8 @@ DOCKER_BUILD_ARGS = --build-arg PG_VERSION=$(PG_VER_NUMBER) \
2728
--build-arg TS_VERSION=$(TS_VERSION) \
2829
--build-arg PREV_IMAGE=$(PREV_IMAGE) \
2930
--build-arg PG_CRON_VERSION=$(PG_CRON_VERSION) \
30-
--build-arg POSTGIS_VERSION=$(POSTGIS_VERSION)
31+
--build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \
32+
--build-arg ZOMBODB_VERSION=$(ZOMBODB_VERSION)
3133

3234

3335
default: image

bitnami/timescaledb-bitnami-entrypoint.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# shared preload list, or else it gets overwritten.
55
if [ -z "$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" ]
66
then
7-
POSTGRESQL_SHARED_PRELOAD_LIBRARIES="timescaledb,pg_cron"
7+
POSTGRESQL_SHARED_PRELOAD_LIBRARIES="timescaledb,pg_cron,zombodb"
88
else
9-
POSTGRESQL_SHARED_PRELOAD_LIBRARIES="$POSTGRESQL_SHARED_PRELOAD_LIBRARIES,timescaledb,pg_cron"
9+
POSTGRESQL_SHARED_PRELOAD_LIBRARIES="$POSTGRESQL_SHARED_PRELOAD_LIBRARIES,timescaledb,pg_cron,zombodb"
1010
fi
1111
export POSTGRESQL_SHARED_PRELOAD_LIBRARIES
1212

0 commit comments

Comments
 (0)