Skip to content

Commit

Permalink
add pg_jobmon and pg_partman extensions
Browse files Browse the repository at this point in the history
Signed-off-by: Piyush Raj <[email protected]>
  • Loading branch information
PiyushRaj927 committed Mar 11, 2024
1 parent 66be9e0 commit c7b101b
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ jobs:
echo "Test pgautofailover Extension"
psql -c "CREATE EXTENSION pgautofailover CASCADE;"
psql -c "SELECT pgautofailover.formation_settings();"
echo "Test pg_jobmon Extension"
psql -c " CREATE SCHEMA jobmon;"
psql -c "CREATE EXTENSION pg_jobmon SCHEMA jobmon cascade;"
echo "Test pg_partman Extension"
psql -c "CREATE SCHEMA partman;"
psql -c "CREATE EXTENSION pg_partman SCHEMA partman;"
break
fi
sleep 1
Expand Down
74 changes: 73 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,76 @@ RUN set -eux \
# clean
&& cd / \
&& rm -rf /tmp/postgresql-hll-${POSTGRES_HLL_VERSION} /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip \
&& apk del .postgresql-hll-build-deps
&& apk del .postgresql-hll-build-deps

# Install pg_jobmon
ARG PG_JOBMON_VERSION
RUN set -e \
\
&& apk add --no-cache --virtual .pg_jobmon-deps \
ca-certificates \
openssl \
tar \
\
&& cd /tmp\
&& wget -O pg_jobmon.tar.gz "https://github.com/omniti-labs/pg_jobmon/archive/v$PG_JOBMON_VERSION.tar.gz" \
&& mkdir -p /tmp/pg_jobmon \
&& tar \
--extract \
--file pg_jobmon.tar.gz \
--directory /tmp/pg_jobmon \
--strip-components 1 \
\
&& apk add --no-cache --virtual .pg_jobmon-build-deps \
autoconf \
automake \
g++ \
clang15 \
llvm15 \
libtool \
libxml2-dev \
make \
perl \
&& cd /tmp/pg_jobmon \
&& ls -alh . \
&& make \
&& make install \
&& cd / \
&& apk del .pg_jobmon-deps .pg_jobmon-build-deps \
&& rm -rf /tmp/pg_jobmon \
&& rm /tmp/pg_jobmon.tar.gz

# Adding pg_partman
ARG PG_PARTMAN_VERSION

RUN set -e \
&& cd /tmp\
&& apk add --no-cache --virtual .pg_partman-deps \
ca-certificates \
openssl \
tar \
&& apk add --no-cache --virtual .pg_partman-build-deps \
autoconf \
automake \
g++ \
clang15 \
llvm15 \
libtool \
libxml2-dev \
make \
perl \
&& wget -O pg_partman.tar.gz "https://github.com/pgpartman/pg_partman/archive/v$PG_PARTMAN_VERSION.tar.gz" \
&& mkdir -p /tmp/pg_partman \
&& tar \
--extract \
--file pg_partman.tar.gz \
--directory /tmp/pg_partman \
--strip-components 1 \
&& cd /tmp/pg_partman \
&& make \
&& make install \
# clean
&& cd / \
&& rm /tmp/pg_partman.tar.gz \
&& rm -rf /tmp/pg_partman \
&& apk del .pg_partman-deps .pg_partman-build-deps
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ CITUS_VERSION=12.1.0
PG_REPACK_VERSION=1.5.0
PG_AUTO_FAILOVER_VERSION=2.1
POSTGRES_HLL_VERSION=2.18
PG_JOBMON_VERSION=1.4.1
PG_PARTMAN_VERSION=5.0.1
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 @@ -36,9 +38,12 @@ DOCKER_BUILD_ARGS = --build-arg TS_VERSION=$(TS_VERSION) \
--build-arg PG_CRON_VERSION=$(PG_CRON_VERSION) \
--build-arg PG_REPACK_VERSION=$(PG_REPACK_VERSION)\
--build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \
--build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION)\
--build-arg CITUS_VERSION=$(CITUS_VERSION) \
--build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_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)



default: image
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
- [x] [Citus](https://www.citusdata.com/)
- [x] [Pg Repack](https://github.com/reorg/pg_repack)
- [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)


## Releases
- [Versioning Policy](./docs/version-policy.md)

Expand Down
88 changes: 88 additions & 0 deletions bitnami/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,94 @@ RUN apt-get update \
/tmp/* \
/var/tmp/*

# Install pg_jobmon
ARG PG_JOBMON_VERSION
RUN set -ex \
&& apt-get update \
&& apt-get install -y \
ca-certificates \
openssl \
tar \
wget \
autoconf \
automake \
g++ \
clang \
llvm \
libtool \
libxml2-dev \
make \
perl \
\
&& cd /tmp\
&& wget -O pg_jobmon.tar.gz "https://github.com/omniti-labs/pg_jobmon/archive/v$PG_JOBMON_VERSION.tar.gz" \
&& mkdir -p /tmp/pg_jobmon \
&& tar \
--extract \
--file pg_jobmon.tar.gz \
--directory /tmp/pg_jobmon \
--strip-components 1 \
\
&& cd /tmp/pg_jobmon \
&& make \
&& make install \
&& cd / \
&& apt-get autoremove --purge -y \
wget \
autoconf \
automake \
clang \
llvm \
make \
perl \
&& apt-get clean -y \
&& rm -rf /tmp/pg_jobmon \
&& rm /tmp/pg_jobmon.tar.gz

# Adding pg_partman
ARG PG_PARTMAN_VERSION

RUN set -ex \
&& cd /tmp\
&& apt-get update \
&& apt-get install -y \
ca-certificates \
openssl \
tar \
autoconf \
automake \
g++ \
wget \
clang \
llvm \
libtool \
libxml2-dev \
make \
perl \
&& wget -O pg_partman.tar.gz "https://github.com/pgpartman/pg_partman/archive/v$PG_PARTMAN_VERSION.tar.gz" \
&& mkdir -p /tmp/pg_partman \
&& tar \
--extract \
--file pg_partman.tar.gz \
--directory /tmp/pg_partman \
--strip-components 1 \
&& cd /tmp/pg_partman \
&& make \
&& make install \
# clean
&& cd / \
&& apt-get autoremove --purge -y \
wget \
autoconf \
automake \
clang \
llvm \
make \
perl \
&& apt-get clean -y \
&& rm /tmp/pg_partman.tar.gz \
&& rm -rf /tmp/pg_partman

USER 1001

ENTRYPOINT [ "/opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh" ]
Expand Down
11 changes: 8 additions & 3 deletions bitnami/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ POSTGIS_VERSION=3.4.2
CITUS_VERSION=12.1.0
PG_REPACK_VERSION=1.5.0
POSTGRES_HLL_VERSION=2.18
PG_JOBMON_VERSION=1.4.1
PG_PARTMAN_VERSION=5.0.1
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 @@ -31,11 +33,14 @@ 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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) \
--build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \
--build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION)\
--build-arg PG_REPACK_VERSION=$(PG_REPACK_VERSION) \
--build-arg CITUS_VERSION=$(CITUS_VERSION) \
--build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_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)


default: image

Expand Down

0 comments on commit c7b101b

Please sign in to comment.