Skip to content

Commit

Permalink
add hypopg extension
Browse files Browse the repository at this point in the history
Signed-off-by: Piyush Raj <piyushraj92739@gmail.com>
  • Loading branch information
PiyushRaj927 committed Mar 11, 2024
1 parent f7f2115 commit 6d5535e
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ jobs:
psql -c "CREATE SCHEMA partman;"
psql -c "CREATE EXTENSION pg_partman SCHEMA partman;"
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 @@ -390,4 +390,40 @@ RUN set -e \
&& cd / \
&& rm /tmp/pg_partman.tar.gz \
&& rm -rf /tmp/pg_partman \
&& apk del .pg_partman-deps .pg_partman-build-deps
&& apk del .pg_partman-deps .pg_partman-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
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ PG_AUTO_FAILOVER_VERSION=2.1
POSTGRES_HLL_VERSION=2.18
PG_JOBMON_VERSION=1.4.1
PG_PARTMAN_VERSION=5.0.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 Down Expand Up @@ -42,8 +43,8 @@ DOCKER_BUILD_ARGS = --build-arg TS_VERSION=$(TS_VERSION) \
--build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \
--build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION)\
--build-arg PG_JOBMON_VERSION=$(PG_JOBMON_VERSION) \
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION)

--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_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 @@ -13,7 +13,7 @@
- [x] [PgAutoFailover](https://github.com/hapostgres/pg_auto_failover)
- [x] [PgJobmon](https://github.com/omniti-labs/pg_jobmon)
- [x] [PgPartman](https://github.com/pgpartman/pg_partman)

- [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 @@ -427,6 +427,55 @@ RUN set -ex \
&& rm /tmp/pg_partman.tar.gz \
&& rm -rf /tmp/pg_partman

# 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 @@ -13,6 +13,7 @@ PG_REPACK_VERSION=1.5.0
POSTGRES_HLL_VERSION=2.18
PG_JOBMON_VERSION=1.4.1
PG_PARTMAN_VERSION=5.0.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 @@ -39,7 +40,8 @@ DOCKER_BUILD_ARGS = --build-arg PG_VERSION=$(PG_VER_NUMBER) \
--build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \
--build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION)\
--build-arg PG_JOBMON_VERSION=$(PG_JOBMON_VERSION) \
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION)
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION) \
--build-arg HYPOPG_VERSION=$(HYPOPG_VERSION)


default: image
Expand Down

0 comments on commit 6d5535e

Please sign in to comment.