Skip to content

Commit

Permalink
add pg_jobmon and pg_partman extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
PiyushRaj927 committed Feb 24, 2024
1 parent 7fd3328 commit b4e9834
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ 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 pg_jobmon Extension"
psql -c " CREATE SCHEMA jobmon;"
psql -c "CREATE EXTENSION pg_jobmon SCHEMA jobmon cascade;"
echo "Test pg_partman Extension"
psql -U postgres <<EOF
CREATE SCHEMA partman;
CREATE EXTENSION pg_partman SCHEMA partman;
EOF
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 @@ -200,4 +200,76 @@ RUN set -eux \
# clean
&& cd / \
&& rm -rf /usr/src/postgis \
&& apk del .fetch-deps .build-deps
&& apk del .fetch-deps .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/$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/$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
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ 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
PG_JOBMON_VERSION=v1.4.1
PG_PARTMAN_VERSION=v5.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 @@ -30,7 +32,9 @@ 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 PG_JOBMON_VERSION=$(PG_JOBMON_VERSION) \
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION)


default: image
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- [x] [PgCron ](https://github.com/citusdata/pg_cron)
- [x] [PostGIS](https://postgis.net)
- [ ] [Citus](https://www.citusdata.com/)
- [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 @@ -208,6 +208,94 @@ RUN set -eux \
/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/$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/$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
6 changes: 5 additions & 1 deletion bitnami/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ 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
PG_JOBMON_VERSION=v1.4.1
PG_PARTMAN_VERSION=v5.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 @@ -27,7 +29,9 @@ 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 PG_JOBMON_VERSION=$(PG_JOBMON_VERSION) \
--build-arg PG_PARTMAN_VERSION=$(PG_PARTMAN_VERSION)


default: image
Expand Down

0 comments on commit b4e9834

Please sign in to comment.