Skip to content

Commit

Permalink
add hypopg extension
Browse files Browse the repository at this point in the history
Signed-off-by: Piyush Raj <[email protected]>
  • Loading branch information
PiyushRaj927 committed Feb 25, 2024
1 parent 7fd3328 commit a036964
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ jobs:
psql -c "INSERT INTO test_geometry_table (geom) VALUES (ST_GeomFromText('POINT(0 0)', 4326));"
psql -c "SELECT * FROM test_geometry_table;"
echo "Test HypoPG Extension"
psql -c "CREATE EXTENSION hypopg;"
psql -c "CREATE TABLE hypo AS SELECT id, 'line ' || id AS val FROM generate_series(1,10000) id;"
psql -c "EXPLAIN SELECT * FROM hypo WHERE id = 1;"
break
fi
sleep 1
Expand Down
38 changes: 37 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,40 @@ RUN set -eux \
# clean
&& cd / \
&& rm -rf /usr/src/postgis \
&& apk del .fetch-deps .build-deps
&& apk del .fetch-deps .build-deps


# Adding hypo_pg
ARG HYPOPG_VERSION

RUN set -ex \
&& cd /tmp\
&& apk add --no-cache --virtual .hypopg-deps \
ca-certificates \
openssl \
tar \
&& apk add --no-cache --virtual .hypopg-build-deps \
autoconf \
automake \
g++ \
clang15 \
llvm15 \
libtool \
libxml2-dev \
make \
perl \
&& wget -O hypopg.tar.gz "https://github.com/HypoPG/hypopg/archive/refs/tags/${HYPOPG_VERSION}.tar.gz" \
&& mkdir -p /tmp/hypopg \
&& tar \
--extract \
--file hypopg.tar.gz \
--directory /tmp/hypopg \
--strip-components 1 \
&& cd /tmp/hypopg \
&& make \
&& make install \
# clean
&& cd / \
&& rm /tmp/hypopg.tar.gz \
&& rm -rf /tmp/hypopg \
&& apk del .hypopg-deps .hypopg-build-deps
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
HYPOPG_VERSION=1.4.0
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 )
Expand All @@ -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 HYPOPG_VERSION=$(HYPOPG_VERSION)


default: image
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- [x] [PgCron ](https://github.com/citusdata/pg_cron)
- [x] [PostGIS](https://postgis.net)
- [ ] [Citus](https://www.citusdata.com/)

- [x] [HypoPG](https://github.com/HypoPG/hypopg)
## Releases
- [Versioning Policy](./docs/version-policy.md)

Expand Down
49 changes: 49 additions & 0 deletions bitnami/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,55 @@ RUN set -eux \
/tmp/* \
/var/tmp/*

# Adding hypopg
ARG HYPOPG_VERSION

RUN set -e \
&& cd /tmp\
&& apt-get update \
&& apt-get install -y \
ca-certificates \
openssl \
tar \
autoconf \
automake \
g++ \
clang \
llvm \
libtool \
libxml2-dev \
make \
perl \
wget \
&& wget -O hypopg.tar.gz "https://github.com/HypoPG/hypopg/archive/refs/tags/${HYPOPG_VERSION}.tar.gz" \
&& mkdir -p /tmp/hypopg \
&& tar \
--extract \
--file hypopg.tar.gz \
--directory /tmp/hypopg \
--strip-components 1 \
&& cd /tmp/hypopg \
&& make \
&& make install \
# clean
&& cd / \
&& rm /tmp/hypopg.tar.gz \
&& rm -rf /tmp/hypopg \
&& apt-get autoremove --purge -y \
autoconf \
automake \
g++ \
clang \
llvm \
make \
perl \
wget \
&& apt-get clean -y \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*

USER 1001

ENTRYPOINT [ "/opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh" ]
Expand Down
4 changes: 3 additions & 1 deletion bitnami/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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
HYPOPG_VERSION=1.4.0
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 )
Expand All @@ -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 HYPOPG_VERSION=$(HYPOPG_VERSION)


default: image
Expand Down

0 comments on commit a036964

Please sign in to comment.