Skip to content

Commit 880eaba

Browse files
Merge pull request #33 from jayanth-kumar-morem/main
2 parents e7ff00c + de4fa5d commit 880eaba

5 files changed

Lines changed: 76 additions & 10 deletions

File tree

.github/workflows/smoke-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ jobs:
7171
psql -c "INSERT INTO test_geometry_table (geom) VALUES (ST_GeomFromText('POINT(0 0)', 4326));"
7272
psql -c "SELECT * FROM test_geometry_table;"
7373
74+
psql -c "CREATE EXTENSION zombodb;"
75+
psql -c "SELECT * FROM pg_extension WHERE extname = 'zombodb';"
76+
7477
break
7578
fi
7679
sleep 1

Dockerfile

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ RUN apk add --no-cache --virtual .build-deps \
8787
krb5-dev \
8888
libc-dev \
8989
llvm15 \
90-
clang \
9190
make \
9291
cmake \
92+
clang15 \
9393
util-linux-dev \
9494
&& git clone --branch v0.4.1 https://github.com/pgvector/pgvector.git \
9595
&& cd /pgvector \
@@ -141,8 +141,8 @@ RUN set -eux \
141141
&& if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \
142142
set -eux ; \
143143
export GEOS_ALPINE_VER=3.11 ; \
144-
export GDAL_ALPINE_VER=3.5 ; \
145-
export PROJ_ALPINE_VER=9.1 ; \
144+
export GDAL_ALPINE_VER=3.6.4-r4 ; \
145+
export PROJ_ALPINE_VER=9.2.0-r0 ; \
146146
elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \
147147
set -eux ; \
148148
export GEOS_ALPINE_VER=3.8 ; \
@@ -184,6 +184,7 @@ RUN set -eux \
184184
autoconf \
185185
automake \
186186
clang-dev \
187+
clang15 \
187188
cunit-dev \
188189
file \
189190
g++ \
@@ -194,6 +195,7 @@ RUN set -eux \
194195
libtool \
195196
libxml2-dev \
196197
llvm-dev \
198+
llvm15 \
197199
make \
198200
pcre-dev \
199201
perl \
@@ -226,3 +228,32 @@ RUN set -eux \
226228
&& cd / \
227229
&& rm -rf /usr/src/postgis \
228230
&& apk del .fetch-deps .build-deps
231+
232+
ENV RUSTFLAGS="-C target-feature=-crt-static"
233+
ARG PG_VER
234+
RUN apk add --no-cache --virtual .zombodb-build-deps \
235+
git \
236+
curl \
237+
bash \
238+
ruby-dev \
239+
ruby-etc \
240+
musl-dev \
241+
make \
242+
gcc \
243+
coreutils \
244+
util-linux-dev \
245+
musl-dev \
246+
openssl-dev \
247+
clang15 \
248+
tar \
249+
&& gem install --no-document fpm \
250+
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \
251+
&& PATH=$HOME/.cargo/bin:$PATH \
252+
&& cargo install cargo-pgrx --version 0.8.3 \
253+
&& cargo pgrx init --${PG_VER}=$(which pg_config) \
254+
&& git clone https://github.com/zombodb/zombodb.git \
255+
&& cd ./zombodb \
256+
&& cargo pgrx install --release \
257+
&& cd .. \
258+
&& rm -rf ./zombodb \
259+
&& apk del .zombodb-build-deps

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ default: image
5757
touch .build_$(TS_VERSION)_$(PG_VER)_oss
5858

5959
.build_$(TS_VERSION)_$(PG_VER): Dockerfile
60-
docker build --build-arg PG_VERSION=$(PG_VER_NUMBER) --build-arg TS_VERSION=$(TS_VERSION) --build-arg PREV_IMAGE=$(PREV_IMAGE) --build-arg CITUS_VERSION=$(CITUS_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) .
60+
docker build --build-arg PG_VERSION=$(PG_VER_NUMBER) --build-arg TS_VERSION=$(TS_VERSION) --build-arg PREV_IMAGE=$(PREV_IMAGE) --build-arg CITUS_VERSION=$(CITUS_VERSION) --build-arg PG_VER=$(PG_VER) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) .
6161
touch .build_$(TS_VERSION)_$(PG_VER)
6262

6363
image: .build_$(TS_VERSION)_$(PG_VER)

bitnami/Dockerfile

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,7 @@ RUN set -ex \
122122
"${HOME}/.cache" \
123123
/var/lib/apt/lists/* \
124124
/tmp/* \
125-
/var/tmp/* \
126-
\
127-
# Update shared_preload_libraries
128-
&& sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb'/g" /opt/bitnami/postgresql/conf/postgresql.conf
125+
/var/tmp/*
129126

130127
# Add PostGIS Extension
131128
ARG POSTGIS_MAJOR
@@ -145,6 +142,41 @@ RUN apt-get update \
145142
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
146143
&& rm -rf /var/lib/apt/lists/*
147144

145+
# Install zombodb extension
146+
RUN apt-get update -y -qq --fix-missing \
147+
&& apt-get install -y wget gnupg \
148+
&& echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" >> /etc/apt/sources.list \
149+
&& echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list \
150+
&& wget --quiet -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
151+
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 \
152+
&& apt update \
153+
&& apt-get update -y --fix-missing \
154+
&& apt-get install -y git curl clang-14 llvm-14 gcc make build-essential libz-dev zlib1g-dev strace pkg-config lsb-release wget software-properties-common gnupg libreadline-dev libgdbm-dev libssl1.0-dev \
155+
&& wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz \
156+
&& tar -xzvf openssl-1.0.2l.tar.gz \
157+
&& cd openssl-1.0.2l \
158+
&& ./config \
159+
&& make install \
160+
&& ln -sf /usr/local/ssl/bin/openssl `which openssl` \
161+
&& mkdir ruby \
162+
&& cd ruby \
163+
&& wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz \
164+
&& tar xvfz ruby-2.3.0.tar.gz \
165+
&& cd ruby-2.3.0 \
166+
&& ./configure --with-openssl-dir=/usr/include/openssl-1.0 \
167+
&& make -j64 \
168+
&& make install \
169+
&& gem install --no-document fpm \
170+
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
171+
&& export PATH="/.cargo/bin:$PATH" \
172+
&& export PGRX_HOME="/.pgrx/" \
173+
&& mkdir -p $PGRX_HOME \
174+
&& cargo install cargo-pgrx --version 0.8.3 \
175+
&& cargo pgrx init --pg${PG_MAJOR}=/opt/bitnami/postgresql/bin/pg_config \
176+
&& git clone https://github.com/zombodb/zombodb.git \
177+
&& cd zombodb \
178+
&& export PATH="/.cargo/bin:$PATH" && cargo pgrx install --release
179+
148180
USER 1001
149181

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

bitnami/timescaledb-bitnami-entrypoint.sh

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

0 commit comments

Comments
 (0)