diff --git a/Dockerfile b/Dockerfile index 0d37a6ca..db89f6c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -200,4 +200,35 @@ RUN set -eux \ # clean && cd / \ && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps \ No newline at end of file + && apk del .fetch-deps .build-deps + +ENV RUSTFLAGS="-C target-feature=-crt-static" +ARG ZOMBODB_VERSION +ARG PG_VERSION +# RUN echo ${PG_VERSION} && exit 1 +RUN apk add --no-cache --virtual .zombodb-build-deps \ + git \ + curl \ + bash \ + ruby-dev \ + ruby-etc \ + musl-dev \ + make \ + gcc \ + coreutils \ + util-linux-dev \ + musl-dev \ + openssl-dev \ + clang15 \ + tar \ + && gem install --no-document fpm \ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \ + && PATH=$HOME/.cargo/bin:$PATH \ + && cargo install cargo-pgrx --version 0.9.3 \ + && cargo pgrx init --pg${PG_VERSION}=$(which pg_config) \ + && git clone --depth 1 --branch ${ZOMBODB_VERSION} https://github.com/zombodb/zombodb.git \ + && cd ./zombodb \ + && cargo pgrx install --release \ + && cd .. \ + && rm -rf ./zombodb \ + && apk del .zombodb-build-deps \ No newline at end of file diff --git a/Makefile b/Makefile index 67fbd6d2..e89fbe74 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=2.13.0 PG_CRON_VERSION=v1.6.0 POSTGIS_VERSION=3.4.1 +ZOMBODB_VERSION=v3000.2.3 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 = !!') PREV_TS_IMAGE="timescale/timescaledb:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)$(PREV_EXTRA)" 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) \ --build-arg PG_VERSION=$(PG_VER_NUMBER) \ --build-arg PREV_IMAGE=$(PREV_IMAGE) \ --build-arg PG_CRON_VERSION=$(PG_CRON_VERSION) \ - --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) + --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ + --build-arg ZOMBODB_VERSION=$(ZOMBODB_VERSION) default: image diff --git a/README.md b/README.md index ccebfbae..8f759106 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ - [x] [TimescaleDB](https://github.com/timescale/timescaledb) - [x] [PgCron ](https://github.com/citusdata/pg_cron) - [x] [PostGIS](https://postgis.net) +- [x] [ZomboDB](https://github.com/zombodb/zombodb) - [ ] [Citus](https://www.citusdata.com/) ## Releases diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index 873fa036..60b87336 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -208,6 +208,46 @@ RUN set -eux \ /tmp/* \ /var/tmp/* +# Install zombodb extension +ARG PG_MAJOR +ENV RUSTFLAGS="-C target-cpu=native target-cpu=native link-arg=-fuse-ld=lld" +RUN apt-get update -y -qq --fix-missing \ + && apt-get install -y wget gnupg \ + && echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" >> /etc/apt/sources.list \ + && echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list \ + && wget --quiet -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ + && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 \ + && apt update \ + && apt-get update -y --fix-missing \ + && 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 \ + && wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz \ + && tar -xzvf openssl-1.0.2l.tar.gz \ + && cd openssl-1.0.2l \ + && ./config \ + && make install \ + && ln -sf /usr/local/ssl/bin/openssl `which openssl` \ + && mkdir ruby \ + && cd ruby \ + && wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz \ + && tar xvfz ruby-2.3.0.tar.gz \ + && cd ruby-2.3.0 \ + && ./configure --with-openssl-dir=/usr/include/openssl-1.0 \ + && make -j64 \ + && make install \ + && gem install --no-document fpm \ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ + && export PATH="/.cargo/bin:$PATH" \ + && export PGRX_HOME="/.pgrx/" \ + && mkdir -p $PGRX_HOME \ + && cargo install cargo-pgrx --version 0.9.3 \ + && cargo pgrx init --pg${PG_MAJOR}=/opt/bitnami/postgresql/bin/pg_config \ + && git clone --depth 1 --branch ${ZOMBODB_VERSION} https://github.com/zombodb/zombodb.git \ + && cd zombodb \ + && export PATH="/.cargo/bin:$PATH" && cargo pgrx install --release \ + && cd / \ + && apt-get autoremove --purge -y git curl clang-14 gcc make build-essential wget \ + && rm -rf .cargo .gem openssl-1.0.2l .rustup openssl-1.0.2l.tar.gz + USER 1001 ENTRYPOINT [ "/opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh" ] diff --git a/bitnami/Makefile b/bitnami/Makefile index 66d58dec..f05131ca 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -6,7 +6,8 @@ PG_VER=pg15 PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) PG_CRON_VERSION=v1.6.0 TS_VERSION=2.13.0 -POSTGIS_VERSION=3.4.1 +POSTGIS_VERSION=3.4.1 +ZOMBODB_VERSION=v3000.2.3 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 = !!') PREV_TS_IMAGE="timescale/timescaledb:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)-bitnami" 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) \ --build-arg TS_VERSION=$(TS_VERSION) \ --build-arg PREV_IMAGE=$(PREV_IMAGE) \ --build-arg PG_CRON_VERSION=$(PG_CRON_VERSION) \ - --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) + --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ + --build-arg ZOMBODB_VERSION=$(ZOMBODB_VERSION) default: image diff --git a/bitnami/timescaledb-bitnami-entrypoint.sh b/bitnami/timescaledb-bitnami-entrypoint.sh index 4ea4cfe1..fad5b873 100755 --- a/bitnami/timescaledb-bitnami-entrypoint.sh +++ b/bitnami/timescaledb-bitnami-entrypoint.sh @@ -4,9 +4,9 @@ # shared preload list, or else it gets overwritten. if [ -z "$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" ] then - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="timescaledb,pg_cron" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="timescaledb,pg_cron,zombodb" else - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="$POSTGRESQL_SHARED_PRELOAD_LIBRARIES,timescaledb,pg_cron" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="$POSTGRESQL_SHARED_PRELOAD_LIBRARIES,timescaledb,pg_cron,zombodb" fi export POSTGRESQL_SHARED_PRELOAD_LIBRARIES