From e06d71582756ccb0e9cfec66ccf0c97c54c4961f Mon Sep 17 00:00:00 2001 From: Karun Agarwal <113603846+singhalkarun@users.noreply.github.com> Date: Mon, 10 Apr 2023 17:44:16 +0530 Subject: [PATCH 001/104] Update Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6be1eb76..3c444700 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ PG_VER=pg15 PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main 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 ) +PREV_TS_IMAGE="samagragovernance/postgres:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)$(PREV_EXTRA)" +PREV_IMAGE=$(shell if docker pull "$(PREV_TS_IMAGE)" >/dev/null 2>&1; then echo "$(PREV_TS_IMAGE)"; else echo "timescale/timescaledb:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)$(PREV_EXTRA)"; fi ) # Beta releases should not be tagged as latest, so BETA is used to track. BETA=$(findstring rc,$(TS_VERSION)) PLATFORM=linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 From 69f762d723e27987d3accef196dd5f233b0bc957 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Mon, 10 Apr 2023 22:00:35 +0530 Subject: [PATCH 002/104] Update README.md --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 41678219..8c1e2152 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,15 @@ -## Test on GitPod +### Test on GitPod [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ChakshuGautam/postgres-tsdb-vector-docker) -## Postgres +### Current and future supported versions - [x] [PgVector](https://github.com/pgvector/pgvector) - [x] [TimescaleDB](https://github.com/timescale/timescaledb) - [ ] [Citus](https://www.citusdata.com/) +- [ ] [PG Stats Statements](https://www.postgresql.org/docs/current/pgstatstatements.html) +- [ ] [PostGIS](https://postgis.net) +- [ ] [ZomboDB](https://github.com/zombodb/zombodb) +- [ ] [PLV8](https://github.com/plv8/plv8) +- [ ] [Pg Repack](https://github.com/reorg/pg_repack) Bootstrapped from [TimescaleDB](https://github.com/timescale/timescaledb-docker) From 451ca5c80c60053b242dc979102214ec335934f1 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Mon, 10 Apr 2023 22:25:25 +0530 Subject: [PATCH 003/104] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8c1e2152..640543e2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# WarpSQL + ### Test on GitPod [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ChakshuGautam/postgres-tsdb-vector-docker) From 7ff9c2e12168f6b547c6a5d77f46717aad05e4ae Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Mon, 10 Apr 2023 22:26:16 +0530 Subject: [PATCH 004/104] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 640543e2..73129c4f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # WarpSQL +Opinionated extensions to Postgres packaged as a single docker deployment. ### Test on GitPod [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ChakshuGautam/postgres-tsdb-vector-docker) From 33ec64ab0e2a090748f464c39172bdfcbc556d5a Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Mon, 10 Apr 2023 22:26:32 +0530 Subject: [PATCH 005/104] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 73129c4f..412a76e5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Opinionated extensions to Postgres packaged as a single docker deployment. ### Test on GitPod [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ChakshuGautam/postgres-tsdb-vector-docker) -### Current and future supported versions +### Current and future supported extensions - [x] [PgVector](https://github.com/pgvector/pgvector) - [x] [TimescaleDB](https://github.com/timescale/timescaledb) From 75c19ff79f7d2cee9c5a724164b72c8b07e88f01 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Mon, 10 Apr 2023 22:42:01 +0530 Subject: [PATCH 006/104] Update docker-compose.yml --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c249bd07..2141a4f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.6' services: timescaledb: container_name: timescaledb - image: timescaledev/timescaledb:main-pg15 + image: samagragovernance/postgres:latest-pg15 restart: always ports: - "5432:5432" @@ -32,4 +32,4 @@ services: ## uncomment next line to set an admin secret # HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey HASURA_GRAPHQL_MIGRATIONS_DISABLE_TRANSACTION: "true" - HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: /srv/console-assets \ No newline at end of file + HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: /srv/console-assets From 77f2f1539245dec01ab3e5841c134319779a2b6f Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Mon, 10 Apr 2023 22:48:03 +0530 Subject: [PATCH 007/104] Add compose example --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 412a76e5..9074a174 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,21 @@ Opinionated extensions to Postgres packaged as a single docker deployment. - [ ] [Pg Repack](https://github.com/reorg/pg_repack) Bootstrapped from [TimescaleDB](https://github.com/timescale/timescaledb-docker) + +### Usage with Compose + +```docker +version: '3.6' +services: + timescaledb: + container_name: timescaledb + image: samagragovernance/postgres:latest-pg15 + restart: always + ports: + - "5432:5432" + volumes: + - ./pgdata:/var/lib/postgresql/data + environment: + POSTGRES_USER: warpSQLUser + POSTGRES_PASSWORD: warpSQLPass +``` From e3fc1bff5e3a7210d612cf8ca911842ba9e3e1fc Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Mon, 10 Apr 2023 22:48:56 +0530 Subject: [PATCH 008/104] Fix yaml in example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9074a174..bbd6edb6 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Bootstrapped from [TimescaleDB](https://github.com/timescale/timescaledb-docker) ### Usage with Compose -```docker +```yaml version: '3.6' services: timescaledb: From a158c62074ba0b78141a545b85d0d5101959dad2 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Mon, 10 Apr 2023 22:49:42 +0530 Subject: [PATCH 009/104] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bbd6edb6..c9712aa5 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ Bootstrapped from [TimescaleDB](https://github.com/timescale/timescaledb-docker) ```yaml version: '3.6' services: - timescaledb: - container_name: timescaledb + warpsql: + container_name: warpsql image: samagragovernance/postgres:latest-pg15 restart: always ports: From 423472d16934a99f8d030ac58d67f091b7c04124 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Mon, 10 Apr 2023 23:08:10 +0530 Subject: [PATCH 010/104] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index c9712aa5..d7880269 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ Opinionated extensions to Postgres packaged as a single docker deployment. - [x] [PgVector](https://github.com/pgvector/pgvector) - [x] [TimescaleDB](https://github.com/timescale/timescaledb) - [ ] [Citus](https://www.citusdata.com/) -- [ ] [PG Stats Statements](https://www.postgresql.org/docs/current/pgstatstatements.html) - [ ] [PostGIS](https://postgis.net) - [ ] [ZomboDB](https://github.com/zombodb/zombodb) - [ ] [PLV8](https://github.com/plv8/plv8) From e612601aa55114e1d2ff48f0081fa8a73579e941 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Wed, 12 Apr 2023 18:06:13 +0530 Subject: [PATCH 011/104] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d7880269..67005821 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # WarpSQL -Opinionated extensions to Postgres packaged as a single docker deployment. +Opinionated extensions to Postgres packaged as a single docker deployment. Why install 10 DBs when you can can have everthing at once (maybe not everything). + +Certified as Indie Hacker's best friend!!! ### Test on GitPod [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ChakshuGautam/postgres-tsdb-vector-docker) From 1518ee0240c7d528d5f200d70fcf5856e366d6da Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Thu, 13 Apr 2023 23:26:35 +0530 Subject: [PATCH 012/104] warpsql: Add support for Citus extension 1. Update Dockerfile 2. Install Citus dependencies (curl, jq) 3. Add build dependencies for Citus (gcc, libc-dev, make, curl-dev, lz4-dev, libxslt-dev, libxml2-dev) 4. Download and install Citus with specified version 5. Remove build dependencies and cleanup temporary files after Citus installation Fixes: #3 --- Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Dockerfile b/Dockerfile index 78d8c632..9aca912d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,3 +93,38 @@ RUN apk add --no-cache --virtual .build-deps \ && ls \ && make \ && make install + +## Adding Citus + +# Install Citus dependencies +RUN apk add --no-cache --virtual .citus-deps \ + curl \ + jq + +# Install Citus +ARG CITUS_VERSION="11.2.0" +RUN set -ex \ + && apk add --no-cache --virtual .citus-build-deps \ + gcc \ + libc-dev \ + make \ + curl-dev \ + lz4-dev \ + zstd-dev \ + clang \ + krb5-dev \ + icu-dev \ + libxslt-dev \ + libxml2-dev \ + llvm15-dev \ + && CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" \ + && curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" \ + && tar -C /tmp -xvf /tmp/citus.tar.gz \ + && chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} \ + && cd /tmp/citus-${CITUS_VERSION} \ + && PATH="/usr/local/pgsql/bin:$PATH" ./configure \ + && make \ + && make install \ + && cd ~ \ + && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \ + && apk del .citus-deps .citus-build-deps From a2cfc9b1ea97601a2575596f5a02778ca153a44a Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Fri, 14 Apr 2023 00:17:14 +0530 Subject: [PATCH 013/104] warpsql: Update smoke tests 1. Add Citus extension smoke tests to GitHub Actions workflow 2. Update Bitnami entrypoint script to preload Citus extension 3. Test Citus extension and distributed table creation in smoke tests 4. Ensure logs are displayed for debugging purposes Fixes: #11 --- .github/workflows/smoke-test.yml | 10 ++++++++++ Dockerfile | 3 +++ bitnami/Dockerfile | 24 +++++++++++++++++++++-- bitnami/timescaledb-bitnami-entrypoint.sh | 8 ++++---- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index e5151234..8214ef9e 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -52,6 +52,16 @@ jobs: fi if psql -c "select 1" then + echo "Test Citus Extension" + psql -c "CREATE EXTENSION citus;" + psql -c "SELECT * FROM citus_version();" + + echo "Test Citus Distributed Table" + psql -c "CREATE TABLE test_distributed_table (id serial primary key, data text);" + psql -c "SELECT create_distributed_table('test_distributed_table', 'id');" + psql -c "INSERT INTO test_distributed_table (data) VALUES ('test data');" + psql -c "SELECT * FROM test_distributed_table;" + break fi sleep 1 diff --git a/Dockerfile b/Dockerfile index 9aca912d..ab6831ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,6 +73,9 @@ RUN set -ex \ && rm -rf /build \ && sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample +# Add Citus to shared_preload_libraries +RUN echo "shared_preload_libraries = 'citus,timescaledb'" >> /usr/local/share/postgresql/postgresql.conf.sample + # Adding PG Vector RUN cd /tmp diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index 1042b37a..7f8eb3ea 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -51,6 +51,7 @@ RUN set +o pipefail \ ARG PG_VERSION FROM bitnami/postgresql:${PG_VERSION} ARG PG_VERSION +ARG CITUS_VERSION="11.2.0" LABEL maintainer="Timescale https://www.timescale.com" @@ -89,6 +90,22 @@ RUN set -ex \ && cd build && make install \ && cd ~ \ \ + # Install Citus + && apt-get update \ + && apt-get install -y curl liblz4-dev libzstd-dev clang libkrb5-dev libicu-dev libxslt1-dev libxml2-dev llvm-dev libcurl4-openssl-dev \ + && CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" \ + && curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" \ + && tar -C /tmp -xvf /tmp/citus.tar.gz \ + && addgroup --system postgres \ + && adduser --system --ingroup postgres --home /opt/bitnami/postgresql --no-create-home postgres \ + && chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} \ + && cd /tmp/citus-${CITUS_VERSION} \ + && PATH="/opt/bitnami/postgresql/bin:$PATH" ./configure \ + && make \ + && make install \ + && cd ~ \ + && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \ + \ && apt-get autoremove --purge -y \ \ build-essential \ @@ -105,8 +122,11 @@ RUN set -ex \ "${HOME}/.cache" \ /var/lib/apt/lists/* \ /tmp/* \ - /var/tmp/* - + /var/tmp/* \ + \ + # Update shared_preload_libraries + && sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb'/g" /opt/bitnami/postgresql/conf/postgresql.conf + USER 1001 ENTRYPOINT [ "/opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh" ] diff --git a/bitnami/timescaledb-bitnami-entrypoint.sh b/bitnami/timescaledb-bitnami-entrypoint.sh index 62b94610..6b82dc10 100755 --- a/bitnami/timescaledb-bitnami-entrypoint.sh +++ b/bitnami/timescaledb-bitnami-entrypoint.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash -# We have to use the bitnami configuration variable to add timescaledb to -# shared preload list, or else it gets overwritten. +# We have to use the Bitnami configuration variable to add TimescaleDB and Citus to +# the shared preload list, or else it gets overwritten. if [ -z "$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" ] then - POSTGRESQL_SHARED_PRELOAD_LIBRARIES=timescaledb + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb" else - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="$POSTGRESQL_SHARED_PRELOAD_LIBRARIES,timescaledb" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" fi export POSTGRESQL_SHARED_PRELOAD_LIBRARIES From 8c03bc739ffc94058fb960ec022e8806ec9c62bd Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Thu, 20 Apr 2023 08:39:30 +0530 Subject: [PATCH 014/104] Update Status for Citus --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67005821..ed3e7388 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Certified as Indie Hacker's best friend!!! - [x] [PgVector](https://github.com/pgvector/pgvector) - [x] [TimescaleDB](https://github.com/timescale/timescaledb) -- [ ] [Citus](https://www.citusdata.com/) +- [x] [Citus](https://www.citusdata.com/) - [ ] [PostGIS](https://postgis.net) - [ ] [ZomboDB](https://github.com/zombodb/zombodb) - [ ] [PLV8](https://github.com/plv8/plv8) From f35e979f3ea10999ebdc2687bb5551d363fb7209 Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Thu, 20 Apr 2023 10:17:41 +0530 Subject: [PATCH 015/104] warpsql: Pass citus extension from makefile. 1. Removed harcoded CITUS_VERSION from both the Dockerfiles. 2. Passing the CITUS_VERSION from Makefile-s Fixes: #15 --- Dockerfile | 2 +- Makefile | 3 ++- bitnami/Dockerfile | 2 +- bitnami/Makefile | 5 +++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index ab6831ee..1200f63f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -105,7 +105,7 @@ RUN apk add --no-cache --virtual .citus-deps \ jq # Install Citus -ARG CITUS_VERSION="11.2.0" +ARG CITUS_VERSION RUN set -ex \ && apk add --no-cache --virtual .citus-build-deps \ gcc \ diff --git a/Makefile b/Makefile index 44059d44..99823471 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ NAME=postgres # Set ORG to timescale in the caller ORG=samagragovernance PG_VER=pg15 +CITUS_VERSION="11.2.0" PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main 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 = !!') @@ -54,7 +55,7 @@ default: image touch .build_$(TS_VERSION)_$(PG_VER)_oss .build_$(TS_VERSION)_$(PG_VER): Dockerfile - docker build --build-arg PG_VERSION=$(PG_VER_NUMBER) --build-arg TS_VERSION=$(TS_VERSION) --build-arg PREV_IMAGE=$(PREV_IMAGE) $(TAG) . + 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) $(TAG) . touch .build_$(TS_VERSION)_$(PG_VER) image: .build_$(TS_VERSION)_$(PG_VER) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index 7f8eb3ea..e60ce478 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -51,7 +51,7 @@ RUN set +o pipefail \ ARG PG_VERSION FROM bitnami/postgresql:${PG_VERSION} ARG PG_VERSION -ARG CITUS_VERSION="11.2.0" +ARG CITUS_VERSION LABEL maintainer="Timescale https://www.timescale.com" diff --git a/bitnami/Makefile b/bitnami/Makefile index dc4d5b85..33618f62 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -2,7 +2,8 @@ NAME=timescaledb # Default is to timescaledev to avoid unexpected push to the main repo # Set ORG to timescale in the caller ORG=timescaledev -PG_VER=pg12 +PG_VER=pg15 +CITUS_VERSION="11.2.0" PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main @@ -21,7 +22,7 @@ default: image .build_$(TS_VERSION)_$(PG_VER): Dockerfile test -n "$(TS_VERSION)" # TS_VERSION test -n "$(PREV_TS_VERSION)" # PREV_TS_VERSION - docker build -f ./Dockerfile --build-arg PG_VERSION=$(PG_VER_NUMBER) --build-arg TS_VERSION=$(TS_VERSION) --build-arg PREV_IMAGE=$(PREV_IMAGE) $(TAG) .. + docker build -f ./Dockerfile --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) $(TAG) .. touch .build_$(TS_VERSION)_$(PG_VER)-bitnami image: .build_$(TS_VERSION)_$(PG_VER) From b5d58e3d1d305c1b76f441b2f0809e0f7a3912fa Mon Sep 17 00:00:00 2001 From: Karun Agarwal <113603846+singhalkarun@users.noreply.github.com> Date: Sat, 22 Apr 2023 16:44:13 +0530 Subject: [PATCH 016/104] Enabled pg_stat_statements Added pg_stat_statements in shared_preload_libraries --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ab6831ee..4b02ffa1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,7 +74,7 @@ RUN set -ex \ && sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample # Add Citus to shared_preload_libraries -RUN echo "shared_preload_libraries = 'citus,timescaledb'" >> /usr/local/share/postgresql/postgresql.conf.sample +RUN echo "shared_preload_libraries = 'citus,timescaledb,pg_stat_statements'" >> /usr/local/share/postgresql/postgresql.conf.sample # Adding PG Vector From b072d3755e71b5ab5a1530e3668d1596de5326e1 Mon Sep 17 00:00:00 2001 From: ChakshuGautam Date: Tue, 25 Apr 2023 10:29:06 +0000 Subject: [PATCH 017/104] Add icon --- README.md | 4 +++- icon.jpeg | Bin 0 -> 43398 bytes 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 icon.jpeg diff --git a/README.md b/README.md index ed3e7388..5e3acff3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# WarpSQL +

+

WarpSQL!

+
Opinionated extensions to Postgres packaged as a single docker deployment. Why install 10 DBs when you can can have everthing at once (maybe not everything). Certified as Indie Hacker's best friend!!! diff --git a/icon.jpeg b/icon.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..2b0b72ef7fdfb1f000d73332847360a8da910de6 GIT binary patch literal 43398 zcmdqJc|4Ts|37{kTh=L!vcxFKmL#+YW64goN+Al#k|dObu_T)8gq&*ZOG1T6WnbE4 zr`=Z8Fk>Ce^1bdsr_=kK^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U&cd2>OcM{yc_>|EAkMthR{Hl-w*0R{>xV#UbRzj7q|Tw57cY; z?K4#`5e}xgJYfF5!H@MwAKCw|X77JE5c2DAFlb5i4;#XeM>3~SC(4@qa;s(Kru6VL zUHV=d510E^)!bUxcDdGV_TPbnv>)>0yZ+12;a>;*{}1;^v`na7oS2>y;*5K$58m9c z9b@N0$Bg$i%5cI?)0F~-CuU)z$QI4Fqi0xktW;TiAS_aM;%M%vc&)rnIYB4ZkEcUE zJO~G5gst)wrnST$%{+dmsrcZq3Q?kaCC@X?@Bl6_qgPlv(yt z%=+NOmIsq&FN8S0UEF6~-8n?L&ja-oIhIuk$KwYvtap9xdYFb@60wQ=;>)kp%kP{_58^-W^Cl)@Vzb8u0C9MOMD{ohJ%j@Q(S7$aS z-(2UiwUR&i>3A{WhWE4X_olC}p3C~CPWg^%8pPf@R|q^XDoa2k*|g3zj_zaJP`$3GZ?`#0;5DsIXhh3X=zU#wJL`57opj zmkc8W1jG$Nd^N-ZQ@^6BUFZ!i12sqiF@0JxG8&*uIxrXj%~_ER1noe`#YD$*!rlm+ zL$#f&K2T3L4dDBq$6vmp6`POzU1<#q+rpkd?elVHCgiuF?g@FW$S=i(AZdS29ma+R za!Fk4j-owp6c>+K>xb_aqI*7-5thA2Ot0<4^(Y>W1 zK`~J;K7nORFPQ;;(ps1ABV|QCp_wKpEg#D$Lt}!$fXyM2$7^^0ygF(f)a~W6tCbq; z4_7Q(|oPR?riv>`k4>yW=lC&yEV&5P9-^M?a#{MSYyEM_Fia5Rv2yr-_!an$ n`q-B@fqRhwJ5YN7L*GK=;^Eq?;*dMDp4m)?L0pLL&kz3xbDdkT literal 0 HcmV?d00001 From cf408faf3f2e48a005b1256203243e7894e64088 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Tue, 25 Apr 2023 16:01:51 +0530 Subject: [PATCH 018/104] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e3acff3..eb0ac387 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

-

WarpSQL!

+

WarpSQL!


Opinionated extensions to Postgres packaged as a single docker deployment. Why install 10 DBs when you can can have everthing at once (maybe not everything). From 1f1cbc1be2cbe9e72bed742ea30ae9ab2cccb82d Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Tue, 25 Apr 2023 16:10:14 +0530 Subject: [PATCH 019/104] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eb0ac387..e3e4d2aa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

-

WarpSQL!

+

WarpSQL


Opinionated extensions to Postgres packaged as a single docker deployment. Why install 10 DBs when you can can have everthing at once (maybe not everything). From 112a5857f85d5707edcb6cb6aa4c9daa712b5ffd Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Sat, 15 Apr 2023 13:28:00 +0530 Subject: [PATCH 020/104] WarpSQL: Add support and improvements for PostGIS extension 1. Added support for PostGIS extension 2. PG15_POSTGIS_3.1.0 --- Dockerfile | 41 +++++++++++++++++++++++++++++++++++++++++ Makefile | 3 ++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4d0b09c5..878b04a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -131,3 +131,44 @@ RUN set -ex \ && cd ~ \ && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \ && apk del .citus-deps .citus-build-deps + +## Adding PostGIS +# Install PostGIS dependencies +RUN apk add --no-cache --virtual .postgis-deps \ + geos-dev \ + gdal-dev \ + proj-dev \ + curl \ + json-c-dev \ + protobuf-c-dev + +# Install PostGIS +ARG POSTGIS_VERSION +RUN set -ex \ + && apk add --no-cache --virtual .postgis-build-deps \ + gcc \ + g++ \ + libc-dev \ + make \ + libxml2-dev \ + musl-dev \ + perl \ + clang \ + geos-dev \ + gdal-dev \ + proj-dev \ + protobuf-c-dev \ + llvm15-dev \ + json-c-dev \ + && POSTGIS_DOWNLOAD_URL="https://download.osgeo.org/postgis/source/postgis-${POSTGIS_VERSION}.tar.gz" \ + && curl -L -o /tmp/postgis.tar.gz "${POSTGIS_DOWNLOAD_URL}" \ + && tar -C /tmp -xvf /tmp/postgis.tar.gz \ + && chown -R postgres:postgres /tmp/postgis-${POSTGIS_VERSION} \ + && cd /tmp/postgis-${POSTGIS_VERSION} \ + && PATH="/usr/local/pgsql/bin:$PATH" ./configure \ + && make \ + && make install \ + && cd ~ \ + && rm -rf /tmp/postgis.tar.gz /tmp/postgis-${POSTGIS_VERSION} \ + && apk del .postgis-deps .postgis-build-deps + \ No newline at end of file diff --git a/Makefile b/Makefile index 99823471..8e1e9626 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ NAME=postgres ORG=samagragovernance PG_VER=pg15 CITUS_VERSION="11.2.0" +POSTGIS_VERSION=3.1.4 PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main 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 = !!') @@ -55,7 +56,7 @@ default: image touch .build_$(TS_VERSION)_$(PG_VER)_oss .build_$(TS_VERSION)_$(PG_VER): Dockerfile - 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) $(TAG) . + 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) $(TAG) . touch .build_$(TS_VERSION)_$(PG_VER) image: .build_$(TS_VERSION)_$(PG_VER) From 151b19524a9ba5032bce26ecfd6823d0b3ae761c Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Tue, 18 Apr 2023 13:44:33 +0530 Subject: [PATCH 021/104] WarpSQL: add PostGIS support to Bitnami Dockerfile and entrypoint 1. Update Dockerfile to install PostGIS dependencies and PostGIS extension 2. Modify timescaledb-bitnami-entrypoint.sh to include PostGIS in the shared preload libraries list --- bitnami/Dockerfile | 5 +++-- bitnami/Makefile | 3 ++- bitnami/timescaledb-bitnami-entrypoint.sh | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index e60ce478..3c2d8513 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -80,6 +80,7 @@ RUN set -ex \ make \ cmake \ wget \ + postgis \ && mkdir -p /build/ \ && git clone https://github.com/timescale/timescaledb /build/timescaledb \ \ @@ -125,8 +126,8 @@ RUN set -ex \ /var/tmp/* \ \ # Update shared_preload_libraries - && sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb'/g" /opt/bitnami/postgresql/conf/postgresql.conf - + && sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb,postgis'/g" /opt/bitnami/postgresql/conf/postgresql.conf + USER 1001 ENTRYPOINT [ "/opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh" ] diff --git a/bitnami/Makefile b/bitnami/Makefile index 33618f62..cbaf4359 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -4,6 +4,7 @@ NAME=timescaledb ORG=timescaledev PG_VER=pg15 CITUS_VERSION="11.2.0" +POSTGIS_VERSION=3.1.4 PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main @@ -22,7 +23,7 @@ default: image .build_$(TS_VERSION)_$(PG_VER): Dockerfile test -n "$(TS_VERSION)" # TS_VERSION test -n "$(PREV_TS_VERSION)" # PREV_TS_VERSION - docker build -f ./Dockerfile --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) $(TAG) .. + docker build -f ./Dockerfile --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) $(TAG) .. touch .build_$(TS_VERSION)_$(PG_VER)-bitnami image: .build_$(TS_VERSION)_$(PG_VER) diff --git a/bitnami/timescaledb-bitnami-entrypoint.sh b/bitnami/timescaledb-bitnami-entrypoint.sh index 6b82dc10..eeffd591 100755 --- a/bitnami/timescaledb-bitnami-entrypoint.sh +++ b/bitnami/timescaledb-bitnami-entrypoint.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash -# We have to use the Bitnami configuration variable to add TimescaleDB and Citus to +# We have to use the Bitnami configuration variable to add TimescaleDB, Citus, and PostGIS to # the shared preload list, or else it gets overwritten. if [ -z "$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" ] then - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,postgis" else - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,postgis,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" fi export POSTGRESQL_SHARED_PRELOAD_LIBRARIES From ab497cf0f3b722a4537b22fd905a13a8364d06f2 Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Sat, 22 Apr 2023 14:20:50 +0530 Subject: [PATCH 022/104] WarpSQL: Add PostGIS extension smoke tests 1. Add smoke tests to the GitHub Actions workflow to verify the functionality of the PostGIS extension. 2. This includes creating the PostGIS extension, checking its version, and testing basic geometry functions. --- .github/workflows/smoke-test.yml | 9 ++ Dockerfile | 124 ++++++++++++++++------ Makefile | 5 +- bitnami/Dockerfile | 21 +++- bitnami/Makefile | 7 +- bitnami/timescaledb-bitnami-entrypoint.sh | 6 +- 6 files changed, 129 insertions(+), 43 deletions(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 8214ef9e..fed32e61 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -62,6 +62,15 @@ jobs: psql -c "INSERT INTO test_distributed_table (data) VALUES ('test data');" psql -c "SELECT * FROM test_distributed_table;" + echo "Test PostGIS Extension" + psql -c "CREATE EXTENSION postgis;" || true + psql -c "SELECT PostGIS_Version();" + + echo "Test PostGIS Geometry Function" + psql -c "CREATE TABLE test_geometry_table (id serial primary key, geom geometry(Point, 4326));" + psql -c "INSERT INTO test_geometry_table (geom) VALUES (ST_GeomFromText('POINT(0 0)', 4326));" + psql -c "SELECT * FROM test_geometry_table;" + break fi sleep 1 diff --git a/Dockerfile b/Dockerfile index 878b04a1..c4825438 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,7 +73,7 @@ RUN set -ex \ && rm -rf /build \ && sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample -# Add Citus to shared_preload_libraries +# Update to shared_preload_libraries RUN echo "shared_preload_libraries = 'citus,timescaledb,pg_stat_statements'" >> /usr/local/share/postgresql/postgresql.conf.sample # Adding PG Vector @@ -132,43 +132,99 @@ RUN set -ex \ && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \ && apk del .citus-deps .citus-build-deps -## Adding PostGIS -# Install PostGIS dependencies -RUN apk add --no-cache --virtual .postgis-deps \ - geos-dev \ - gdal-dev \ - proj-dev \ - curl \ - json-c-dev \ - protobuf-c-dev -# Install PostGIS ARG POSTGIS_VERSION -RUN set -ex \ - && apk add --no-cache --virtual .postgis-build-deps \ - gcc \ +ARG POSTGIS_SHA256 + +RUN set -eux \ + \ + && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ + set -eux ; \ + export GEOS_ALPINE_VER=3.11 ; \ + export GDAL_ALPINE_VER=3.5 ; \ + export PROJ_ALPINE_VER=9.1 ; \ + elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ + set -eux ; \ + export GEOS_ALPINE_VER=3.8 ; \ + export GDAL_ALPINE_VER=3.2 ; \ + export PROJ_ALPINE_VER=7.2 ; \ + \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.14/main' >> /etc/apk/repositories ; \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.14/community' >> /etc/apk/repositories ; \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.13/main' >> /etc/apk/repositories ; \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.13/community' >> /etc/apk/repositories ; \ + \ + else \ + set -eux ; \ + echo ".... unknown \$POSTGIS_VERSION ...." ; \ + exit 1 ; \ + fi \ + \ + && apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + openssl \ + tar \ + \ + && wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/${POSTGIS_VERSION}.tar.gz" \ + && echo "${POSTGIS_SHA256} *postgis.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/postgis \ + && tar \ + --extract \ + --file postgis.tar.gz \ + --directory /usr/src/postgis \ + --strip-components 1 \ + && rm postgis.tar.gz \ + \ + && apk add --no-cache --virtual .build-deps \ + \ + gdal-dev~=${GDAL_ALPINE_VER} \ + geos-dev~=${GEOS_ALPINE_VER} \ + proj-dev~=${PROJ_ALPINE_VER} \ + \ + autoconf \ + automake \ + clang-dev \ + cunit-dev \ + file \ g++ \ - libc-dev \ - make \ + gcc \ + gettext-dev \ + git \ + json-c-dev \ + libtool \ libxml2-dev \ - musl-dev \ + llvm-dev \ + make \ + pcre-dev \ perl \ - clang \ - geos-dev \ - gdal-dev \ - proj-dev \ protobuf-c-dev \ - llvm15-dev \ - json-c-dev \ - && POSTGIS_DOWNLOAD_URL="https://download.osgeo.org/postgis/source/postgis-${POSTGIS_VERSION}.tar.gz" \ - && curl -L -o /tmp/postgis.tar.gz "${POSTGIS_DOWNLOAD_URL}" \ - && tar -C /tmp -xvf /tmp/postgis.tar.gz \ - && chown -R postgres:postgres /tmp/postgis-${POSTGIS_VERSION} \ - && cd /tmp/postgis-${POSTGIS_VERSION} \ - && PATH="/usr/local/pgsql/bin:$PATH" ./configure \ - && make \ + \ +# build PostGIS + \ + && cd /usr/src/postgis \ + && gettextize \ + && ./autogen.sh \ + && ./configure \ + --with-pcredir="$(pcre-config --prefix)" \ + && make -j$(nproc) \ && make install \ - && cd ~ \ - && rm -rf /tmp/postgis.tar.gz /tmp/postgis-${POSTGIS_VERSION} \ - && apk del .postgis-deps .postgis-build-deps - \ No newline at end of file + \ +# add .postgis-rundeps + && apk add --no-cache --virtual .postgis-rundeps \ + \ + gdal~=${GDAL_ALPINE_VER} \ + geos~=${GEOS_ALPINE_VER} \ + proj~=${PROJ_ALPINE_VER} \ + \ + json-c \ + libstdc++ \ + pcre \ + protobuf-c \ + \ + # ca-certificates: for accessing remote raster files + # fix https://github.com/postgis/docker-postgis/issues/307 + ca-certificates \ +# clean + && cd / \ + && rm -rf /usr/src/postgis \ + && apk del .fetch-deps .build-deps diff --git a/Makefile b/Makefile index 8e1e9626..54706778 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,8 @@ NAME=postgres ORG=samagragovernance PG_VER=pg15 CITUS_VERSION="11.2.0" -POSTGIS_VERSION=3.1.4 +POSTGIS_VERSION=3.3.2 +POSTGIS_SHA256=2a6858d1df06de1c5f85a5b780773e92f6ba3a5dc09ac31120ac895242f5a77b PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main 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 = !!') @@ -56,7 +57,7 @@ default: image touch .build_$(TS_VERSION)_$(PG_VER)_oss .build_$(TS_VERSION)_$(PG_VER): Dockerfile - 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) $(TAG) . + 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) . touch .build_$(TS_VERSION)_$(PG_VER) image: .build_$(TS_VERSION)_$(PG_VER) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index 3c2d8513..a210b429 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -80,7 +80,6 @@ RUN set -ex \ make \ cmake \ wget \ - postgis \ && mkdir -p /build/ \ && git clone https://github.com/timescale/timescaledb /build/timescaledb \ \ @@ -126,7 +125,25 @@ RUN set -ex \ /var/tmp/* \ \ # Update shared_preload_libraries - && sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb,postgis'/g" /opt/bitnami/postgresql/conf/postgresql.conf + && sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb'/g" /opt/bitnami/postgresql/conf/postgresql.conf + +# Add PostGIS Extension +ARG POSTGIS_MAJOR +ARG PG_MAJOR +ARG POSTGIS_VERSION + +RUN apt-get update \ + && apt-get install -y lsb-release gnupg2 \ + && echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \ + && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + \ + postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ + postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ + && rm -rf /var/lib/apt/lists/* USER 1001 diff --git a/bitnami/Makefile b/bitnami/Makefile index cbaf4359..6dab83ad 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -4,7 +4,10 @@ NAME=timescaledb ORG=timescaledev PG_VER=pg15 CITUS_VERSION="11.2.0" -POSTGIS_VERSION=3.1.4 +POSTGIS_MAJOR=3 +PG_MAJOR=15 +POSTGIS_VERSION=3.3.2+dfsg-1.pgdg110+1 + PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main @@ -23,7 +26,7 @@ default: image .build_$(TS_VERSION)_$(PG_VER): Dockerfile test -n "$(TS_VERSION)" # TS_VERSION test -n "$(PREV_TS_VERSION)" # PREV_TS_VERSION - docker build -f ./Dockerfile --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) $(TAG) .. + docker build -f ./Dockerfile --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_MAJOR=$(POSTGIS_MAJOR) --build-arg PG_MAJOR=$(PG_MAJOR) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) $(TAG) .. touch .build_$(TS_VERSION)_$(PG_VER)-bitnami image: .build_$(TS_VERSION)_$(PG_VER) diff --git a/bitnami/timescaledb-bitnami-entrypoint.sh b/bitnami/timescaledb-bitnami-entrypoint.sh index eeffd591..f5c79bf5 100755 --- a/bitnami/timescaledb-bitnami-entrypoint.sh +++ b/bitnami/timescaledb-bitnami-entrypoint.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash -# We have to use the Bitnami configuration variable to add TimescaleDB, Citus, and PostGIS to +# We have to use the Bitnami configuration variable to add TimescaleDB, Citus to # the shared preload list, or else it gets overwritten. if [ -z "$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" ] then - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,postgis" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb" else - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,postgis,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" fi export POSTGRESQL_SHARED_PRELOAD_LIBRARIES From e05ff91f9ac5580af0360562b924ef1f40d4ac38 Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Tue, 18 Apr 2023 15:44:25 +0530 Subject: [PATCH 023/104] WarpSQL: Add support for multiple PostGIS versions and optimize build process 1. Implement ARGs for POSTGIS_VERSION and POSTGIS_SHA256 to support different PostGIS versions 2. Conditionally set environment variables GEOS_ALPINE_VER, GDAL_ALPINE_VER, and PROJ_ALPINE_VER based on the selected PostGIS version 3. Add Alpine repositories for required packages when using PostGIS 2.x 4. Streamline the build process by combining RUN instructions 5. Update COPY instructions for initdb-postgis.sh and update-postgis.sh --- Dockerfile | 229 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 229 insertions(+) diff --git a/Dockerfile b/Dockerfile index c4825438..45338b29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -133,6 +133,235 @@ RUN set -ex \ && apk del .citus-deps .citus-build-deps +ARG POSTGIS_VERSION +ARG POSTGIS_SHA256 + +RUN set -eux \ + \ + && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ + set -eux ; \ + export GEOS_ALPINE_VER=3.11 ; \ + export GDAL_ALPINE_VER=3.5 ; \ + export PROJ_ALPINE_VER=9.1 ; \ + elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ + set -eux ; \ + export GEOS_ALPINE_VER=3.8 ; \ + export GDAL_ALPINE_VER=3.2 ; \ + export PROJ_ALPINE_VER=7.2 ; \ + \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.14/main' >> /etc/apk/repositories ; \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.14/community' >> /etc/apk/repositories ; \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.13/main' >> /etc/apk/repositories ; \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.13/community' >> /etc/apk/repositories ; \ + \ + else \ + set -eux ; \ + echo ".... unknown \$POSTGIS_VERSION ...." ; \ + exit 1 ; \ + fi \ + \ + && apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + openssl \ + tar \ + \ + && wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/${POSTGIS_VERSION}.tar.gz" \ + && echo "${POSTGIS_SHA256} *postgis.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/postgis \ + && tar \ + --extract \ + --file postgis.tar.gz \ + --directory /usr/src/postgis \ + --strip-components 1 \ + && rm postgis.tar.gz \ + \ + && apk add --no-cache --virtual .build-deps \ + \ + gdal-dev~=${GDAL_ALPINE_VER} \ + geos-dev~=${GEOS_ALPINE_VER} \ + proj-dev~=${PROJ_ALPINE_VER} \ + \ + autoconf \ + automake \ + clang-dev \ + cunit-dev \ + file \ + g++ \ + gcc \ + gettext-dev \ + git \ + json-c-dev \ + libtool \ + libxml2-dev \ + llvm-dev \ + make \ + pcre-dev \ + perl \ + protobuf-c-dev \ + \ +# build PostGIS + \ + && cd /usr/src/postgis \ + && gettextize \ + && ./autogen.sh \ + && ./configure \ + --with-pcredir="$(pcre-config --prefix)" \ + && make -j$(nproc) \ + && make install \ + \ +# add .postgis-rundeps + && apk add --no-cache --virtual .postgis-rundeps \ + \ + gdal~=${GDAL_ALPINE_VER} \ + geos~=${GEOS_ALPINE_VER} \ + proj~=${PROJ_ALPINE_VER} \ + \ + json-c \ + libstdc++ \ + pcre \ + protobuf-c \ + \ + ca-certificates \ +# clean + && cd / \ + && rm -rf /usr/src/postgis \ + && apk del .fetch-deps .build-deps + +ARG PG_VERSION +ARG PREV_IMAGE +ARG TS_VERSION +############################ +# Build tools binaries in separate image +############################ +ARG GO_VERSION=1.18.7 +FROM golang:${GO_VERSION}-alpine AS tools + +ENV TOOLS_VERSION 0.8.1 + +RUN apk update && apk add --no-cache git gcc musl-dev \ + && go install github.com/timescale/timescaledb-tune/cmd/timescaledb-tune@latest \ + && go install github.com/timescale/timescaledb-parallel-copy/cmd/timescaledb-parallel-copy@latest + +############################ +# Grab old versions from previous version +############################ +ARG PG_VERSION +ARG PREV_IMAGE +FROM ${PREV_IMAGE} AS oldversions +# Remove update files, mock files, and all but the last 5 .so/.sql files +RUN rm -f $(pg_config --sharedir)/extension/timescaledb*mock*.sql \ + && if [ -f $(pg_config --pkglibdir)/timescaledb-tsl-1*.so ]; then rm -f $(ls -1 $(pg_config --pkglibdir)/timescaledb-tsl-1*.so | head -n -5); fi \ + && if [ -f $(pg_config --pkglibdir)/timescaledb-1*.so ]; then rm -f $(ls -1 $(pg_config --pkglibdir)/timescaledb-*.so | head -n -5); fi \ + && if [ -f $(pg_config --sharedir)/extension/timescaledb--1*.sql ]; then rm -f $(ls -1 $(pg_config --sharedir)/extension/timescaledb--1*.sql | head -n -5); fi + +############################ +# Now build image and copy in tools +############################ +ARG PG_VERSION +FROM postgres:${PG_VERSION}-alpine +ARG OSS_ONLY + +LABEL maintainer="Timescale https://www.timescale.com" + +COPY docker-entrypoint-initdb.d/* /docker-entrypoint-initdb.d/ +COPY --from=tools /go/bin/* /usr/local/bin/ +COPY --from=oldversions /usr/local/lib/postgresql/timescaledb-*.so /usr/local/lib/postgresql/ +COPY --from=oldversions /usr/local/share/postgresql/extension/timescaledb--*.sql /usr/local/share/postgresql/extension/ + +ARG TS_VERSION +RUN set -ex \ + && apk add libssl1.1 \ + && apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + git \ + openssl \ + openssl-dev \ + tar \ + && mkdir -p /build/ \ + && git clone https://github.com/timescale/timescaledb /build/timescaledb \ + \ + && apk add --no-cache --virtual .build-deps \ + coreutils \ + dpkg-dev dpkg \ + gcc \ + krb5-dev \ + libc-dev \ + make \ + cmake \ + util-linux-dev \ + \ + # Build current version \ + && cd /build/timescaledb && rm -fr build \ + && git checkout ${TS_VERSION} \ + && ./bootstrap -DCMAKE_BUILD_TYPE=RelWithDebInfo -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DGENERATE_DOWNGRADE_SCRIPT=ON -DWARNINGS_AS_ERRORS=OFF -DPROJECT_INSTALL_METHOD="docker"${OSS_ONLY} \ + && cd build && make install \ + && cd ~ \ + \ + && if [ "${OSS_ONLY}" != "" ]; then rm -f $(pg_config --pkglibdir)/timescaledb-tsl-*.so; fi \ + && apk del .fetch-deps .build-deps \ + && rm -rf /build \ + && sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample + +# Update to shared_preload_libraries +RUN echo "shared_preload_libraries = 'citus,timescaledb,pg_stat_statements'" >> /usr/local/share/postgresql/postgresql.conf.sample + +# Adding PG Vector + +RUN cd /tmp +RUN apk add --no-cache --virtual .build-deps \ + coreutils \ + dpkg-dev dpkg \ + gcc \ + git \ + krb5-dev \ + libc-dev \ + llvm15 \ + clang \ + make \ + cmake \ + util-linux-dev \ + && git clone --branch v0.4.1 https://github.com/pgvector/pgvector.git \ + && cd /pgvector \ + && ls \ + && make \ + && make install + +## Adding Citus + +# Install Citus dependencies +RUN apk add --no-cache --virtual .citus-deps \ + curl \ + jq + +# Install Citus +ARG CITUS_VERSION +RUN set -ex \ + && apk add --no-cache --virtual .citus-build-deps \ + gcc \ + libc-dev \ + make \ + curl-dev \ + lz4-dev \ + zstd-dev \ + clang \ + krb5-dev \ + icu-dev \ + libxslt-dev \ + libxml2-dev \ + llvm15-dev \ + && CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" \ + && curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" \ + && tar -C /tmp -xvf /tmp/citus.tar.gz \ + && chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} \ + && cd /tmp/citus-${CITUS_VERSION} \ + && PATH="/usr/local/pgsql/bin:$PATH" ./configure \ + && make \ + && make install \ + && cd ~ \ + && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \ + && apk del .citus-deps .citus-build-deps + + ARG POSTGIS_VERSION ARG POSTGIS_SHA256 From 02b1678618708f8522f15eabbe51da0b327c7b65 Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Wed, 26 Apr 2023 18:27:57 +0530 Subject: [PATCH 024/104] WarpSQL/bitnami: Add PostGIS extension to PostgreSQL 1. Specify POSTGIS_MAJOR, PG_MAJOR, and POSTGIS_VERSION arguments 2. Update and install necessary dependencies 3. Add PostgreSQL repository and import key 4. Install PostGIS extension with specified versions 5. Clean up apt lists --- Dockerfile | 231 ----------------------------------------------------- 1 file changed, 231 deletions(-) diff --git a/Dockerfile b/Dockerfile index 45338b29..1686f038 100644 --- a/Dockerfile +++ b/Dockerfile @@ -226,234 +226,3 @@ RUN set -eux \ && cd / \ && rm -rf /usr/src/postgis \ && apk del .fetch-deps .build-deps - -ARG PG_VERSION -ARG PREV_IMAGE -ARG TS_VERSION -############################ -# Build tools binaries in separate image -############################ -ARG GO_VERSION=1.18.7 -FROM golang:${GO_VERSION}-alpine AS tools - -ENV TOOLS_VERSION 0.8.1 - -RUN apk update && apk add --no-cache git gcc musl-dev \ - && go install github.com/timescale/timescaledb-tune/cmd/timescaledb-tune@latest \ - && go install github.com/timescale/timescaledb-parallel-copy/cmd/timescaledb-parallel-copy@latest - -############################ -# Grab old versions from previous version -############################ -ARG PG_VERSION -ARG PREV_IMAGE -FROM ${PREV_IMAGE} AS oldversions -# Remove update files, mock files, and all but the last 5 .so/.sql files -RUN rm -f $(pg_config --sharedir)/extension/timescaledb*mock*.sql \ - && if [ -f $(pg_config --pkglibdir)/timescaledb-tsl-1*.so ]; then rm -f $(ls -1 $(pg_config --pkglibdir)/timescaledb-tsl-1*.so | head -n -5); fi \ - && if [ -f $(pg_config --pkglibdir)/timescaledb-1*.so ]; then rm -f $(ls -1 $(pg_config --pkglibdir)/timescaledb-*.so | head -n -5); fi \ - && if [ -f $(pg_config --sharedir)/extension/timescaledb--1*.sql ]; then rm -f $(ls -1 $(pg_config --sharedir)/extension/timescaledb--1*.sql | head -n -5); fi - -############################ -# Now build image and copy in tools -############################ -ARG PG_VERSION -FROM postgres:${PG_VERSION}-alpine -ARG OSS_ONLY - -LABEL maintainer="Timescale https://www.timescale.com" - -COPY docker-entrypoint-initdb.d/* /docker-entrypoint-initdb.d/ -COPY --from=tools /go/bin/* /usr/local/bin/ -COPY --from=oldversions /usr/local/lib/postgresql/timescaledb-*.so /usr/local/lib/postgresql/ -COPY --from=oldversions /usr/local/share/postgresql/extension/timescaledb--*.sql /usr/local/share/postgresql/extension/ - -ARG TS_VERSION -RUN set -ex \ - && apk add libssl1.1 \ - && apk add --no-cache --virtual .fetch-deps \ - ca-certificates \ - git \ - openssl \ - openssl-dev \ - tar \ - && mkdir -p /build/ \ - && git clone https://github.com/timescale/timescaledb /build/timescaledb \ - \ - && apk add --no-cache --virtual .build-deps \ - coreutils \ - dpkg-dev dpkg \ - gcc \ - krb5-dev \ - libc-dev \ - make \ - cmake \ - util-linux-dev \ - \ - # Build current version \ - && cd /build/timescaledb && rm -fr build \ - && git checkout ${TS_VERSION} \ - && ./bootstrap -DCMAKE_BUILD_TYPE=RelWithDebInfo -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DGENERATE_DOWNGRADE_SCRIPT=ON -DWARNINGS_AS_ERRORS=OFF -DPROJECT_INSTALL_METHOD="docker"${OSS_ONLY} \ - && cd build && make install \ - && cd ~ \ - \ - && if [ "${OSS_ONLY}" != "" ]; then rm -f $(pg_config --pkglibdir)/timescaledb-tsl-*.so; fi \ - && apk del .fetch-deps .build-deps \ - && rm -rf /build \ - && sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample - -# Update to shared_preload_libraries -RUN echo "shared_preload_libraries = 'citus,timescaledb,pg_stat_statements'" >> /usr/local/share/postgresql/postgresql.conf.sample - -# Adding PG Vector - -RUN cd /tmp -RUN apk add --no-cache --virtual .build-deps \ - coreutils \ - dpkg-dev dpkg \ - gcc \ - git \ - krb5-dev \ - libc-dev \ - llvm15 \ - clang \ - make \ - cmake \ - util-linux-dev \ - && git clone --branch v0.4.1 https://github.com/pgvector/pgvector.git \ - && cd /pgvector \ - && ls \ - && make \ - && make install - -## Adding Citus - -# Install Citus dependencies -RUN apk add --no-cache --virtual .citus-deps \ - curl \ - jq - -# Install Citus -ARG CITUS_VERSION -RUN set -ex \ - && apk add --no-cache --virtual .citus-build-deps \ - gcc \ - libc-dev \ - make \ - curl-dev \ - lz4-dev \ - zstd-dev \ - clang \ - krb5-dev \ - icu-dev \ - libxslt-dev \ - libxml2-dev \ - llvm15-dev \ - && CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" \ - && curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" \ - && tar -C /tmp -xvf /tmp/citus.tar.gz \ - && chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} \ - && cd /tmp/citus-${CITUS_VERSION} \ - && PATH="/usr/local/pgsql/bin:$PATH" ./configure \ - && make \ - && make install \ - && cd ~ \ - && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \ - && apk del .citus-deps .citus-build-deps - - -ARG POSTGIS_VERSION -ARG POSTGIS_SHA256 - -RUN set -eux \ - \ - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - set -eux ; \ - export GEOS_ALPINE_VER=3.11 ; \ - export GDAL_ALPINE_VER=3.5 ; \ - export PROJ_ALPINE_VER=9.1 ; \ - elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ - set -eux ; \ - export GEOS_ALPINE_VER=3.8 ; \ - export GDAL_ALPINE_VER=3.2 ; \ - export PROJ_ALPINE_VER=7.2 ; \ - \ - echo 'https://dl-cdn.alpinelinux.org/alpine/v3.14/main' >> /etc/apk/repositories ; \ - echo 'https://dl-cdn.alpinelinux.org/alpine/v3.14/community' >> /etc/apk/repositories ; \ - echo 'https://dl-cdn.alpinelinux.org/alpine/v3.13/main' >> /etc/apk/repositories ; \ - echo 'https://dl-cdn.alpinelinux.org/alpine/v3.13/community' >> /etc/apk/repositories ; \ - \ - else \ - set -eux ; \ - echo ".... unknown \$POSTGIS_VERSION ...." ; \ - exit 1 ; \ - fi \ - \ - && apk add --no-cache --virtual .fetch-deps \ - ca-certificates \ - openssl \ - tar \ - \ - && wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/${POSTGIS_VERSION}.tar.gz" \ - && echo "${POSTGIS_SHA256} *postgis.tar.gz" | sha256sum -c - \ - && mkdir -p /usr/src/postgis \ - && tar \ - --extract \ - --file postgis.tar.gz \ - --directory /usr/src/postgis \ - --strip-components 1 \ - && rm postgis.tar.gz \ - \ - && apk add --no-cache --virtual .build-deps \ - \ - gdal-dev~=${GDAL_ALPINE_VER} \ - geos-dev~=${GEOS_ALPINE_VER} \ - proj-dev~=${PROJ_ALPINE_VER} \ - \ - autoconf \ - automake \ - clang-dev \ - cunit-dev \ - file \ - g++ \ - gcc \ - gettext-dev \ - git \ - json-c-dev \ - libtool \ - libxml2-dev \ - llvm-dev \ - make \ - pcre-dev \ - perl \ - protobuf-c-dev \ - \ -# build PostGIS - \ - && cd /usr/src/postgis \ - && gettextize \ - && ./autogen.sh \ - && ./configure \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ - \ -# add .postgis-rundeps - && apk add --no-cache --virtual .postgis-rundeps \ - \ - gdal~=${GDAL_ALPINE_VER} \ - geos~=${GEOS_ALPINE_VER} \ - proj~=${PROJ_ALPINE_VER} \ - \ - json-c \ - libstdc++ \ - pcre \ - protobuf-c \ - \ - # ca-certificates: for accessing remote raster files - # fix https://github.com/postgis/docker-postgis/issues/307 - ca-certificates \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps From 4c9bf8718c2c08ead0c205d8ed32868a88d79cf5 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Thu, 4 May 2023 22:22:37 +0530 Subject: [PATCH 025/104] Update status for PostGIS. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e3e4d2aa..cf776c4a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Certified as Indie Hacker's best friend!!! - [x] [PgVector](https://github.com/pgvector/pgvector) - [x] [TimescaleDB](https://github.com/timescale/timescaledb) - [x] [Citus](https://www.citusdata.com/) -- [ ] [PostGIS](https://postgis.net) +- [x] [PostGIS](https://postgis.net) - [ ] [ZomboDB](https://github.com/zombodb/zombodb) - [ ] [PLV8](https://github.com/plv8/plv8) - [ ] [Pg Repack](https://github.com/reorg/pg_repack) From 82377ae2e788c31b4b6e523854c0f5a28362ec85 Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Thu, 4 May 2023 11:13:55 +0530 Subject: [PATCH 026/104] WarpSQL/normal: Add ZomboDB extension build to Dockerfile 1. This commit adds the necessary commands to the Dockerfile to build and install the ZomboDB extension for PostgreSQL. 2. The build process uses cargo-pgrx and clang to compile the Rust code and create a PostgreSQL extension that can be installed via CREATE EXTENSION. 3. The resulting extension is included in the final Docker image. 4. This feature is useful for users who need to use ZomboDB's full-text search capabilities in their PostgreSQL databases. 5. The version of PostgreSQL can be specified via a build argument PG_VER. 6. The commit also adds some necessary dependencies, such as Ruby and FPM, to the Dockerfile. Fixes: #5 --- .github/workflows/smoke-test.yml | 3 +++ Dockerfile | 30 ++++++++++++++++++++++++++++++ Makefile | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index fed32e61..c831969c 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -71,6 +71,9 @@ jobs: psql -c "INSERT INTO test_geometry_table (geom) VALUES (ST_GeomFromText('POINT(0 0)', 4326));" psql -c "SELECT * FROM test_geometry_table;" + psql -c "CREATE EXTENSION zombodb;" + psql -c "SELECT * FROM pg_extension WHERE extname = 'zombodb';" + break fi sleep 1 diff --git a/Dockerfile b/Dockerfile index 1686f038..677ed309 100644 --- a/Dockerfile +++ b/Dockerfile @@ -226,3 +226,33 @@ RUN set -eux \ && cd / \ && rm -rf /usr/src/postgis \ && apk del .fetch-deps .build-deps + +ENV RUSTFLAGS="-C target-feature=-crt-static" +ARG PG_VER +RUN apk add --no-cache --virtual .zombodb-build-deps \ + git \ + curl \ + bash \ + ruby-dev \ + ruby-etc \ + musl-dev \ + make \ + gcc \ + coreutils \ + util-linux-dev \ + musl-dev \ + openssl-dev \ + clang-libs \ + clang-dev \ + tar \ + && gem install --no-document fpm \ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \ + && PATH=$HOME/.cargo/bin:$PATH \ + && cargo install cargo-pgrx \ + && cargo pgrx init --${PG_VER}=$(which pg_config) \ + && git clone https://github.com/zombodb/zombodb.git \ + && cd ./zombodb \ + && cargo pgrx install --release \ + && cd .. \ + && rm -rf ./zombodb \ + && apk del .zombodb-build-deps \ No newline at end of file diff --git a/Makefile b/Makefile index 54706778..7c97a5a6 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ default: image touch .build_$(TS_VERSION)_$(PG_VER)_oss .build_$(TS_VERSION)_$(PG_VER): Dockerfile - 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) . + 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) . touch .build_$(TS_VERSION)_$(PG_VER) image: .build_$(TS_VERSION)_$(PG_VER) From 2af9a6bc2d3f47627169665d51001463ab22fe76 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Thu, 18 May 2023 19:31:49 +0530 Subject: [PATCH 027/104] Delete .gitpod.yml --- .gitpod.yml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index 63a3e4fd..00000000 --- a/.gitpod.yml +++ /dev/null @@ -1,10 +0,0 @@ -# This configuration file was automatically generated by Gitpod. -# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) -# and commit this file to your remote git repository to share the goodness with others. - -# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart - -tasks: - - init: make - - From 0db7531c52b9c338edfe1d0aab581009c6c53c92 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 19 May 2023 08:49:48 +0530 Subject: [PATCH 028/104] Create devcontainer.json --- .devcontainer/devcontainer.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..fe6e7806 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,10 @@ +{ + "name": "warsql-devcontainer", + "image": "samagragovernance/postgres:latest-pg15", + "extensions": [ + "ms-vscode-remote.vscode-remote-extensionpack" + ], + "settings": {}, + "forwardPorts": [5432], + "postCreateCommand": "pip install -r requirements.txt" +} From 01d2eff25704d36c792c6319dedc1a533006761b Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 19 May 2023 08:50:34 +0530 Subject: [PATCH 029/104] Update devcontainer.json --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fe6e7806..f49858b4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,6 +5,6 @@ "ms-vscode-remote.vscode-remote-extensionpack" ], "settings": {}, - "forwardPorts": [5432], + "forwardPorts": [1313], "postCreateCommand": "pip install -r requirements.txt" } From a2c7a5324df229accfc5035c9e03786549bd632f Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 19 May 2023 08:50:57 +0530 Subject: [PATCH 030/104] Update devcontainer.json --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f49858b4..fe6e7806 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,6 +5,6 @@ "ms-vscode-remote.vscode-remote-extensionpack" ], "settings": {}, - "forwardPorts": [1313], + "forwardPorts": [5432], "postCreateCommand": "pip install -r requirements.txt" } From 555b1f9e78927402604bb3909fa222f90cb51bcd Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 19 May 2023 09:01:12 +0530 Subject: [PATCH 031/104] Update README.md --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index cf776c4a..3b3cd9ed 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,17 @@ services: POSTGRES_USER: warpSQLUser POSTGRES_PASSWORD: warpSQLPass ``` + +## Development with GitHub Codespaces + +You can use GitHub Codespaces to develop this project in the cloud. + +1. Click on the "Code" button. +2. Select "Open with Codespaces" from the dropdown menu. +3. Choose the appropriate Codespace configuration. +4. Wait for the environment to be provisioned. +5. Once the environment is ready, you can start working on the project. +6. Install the project dependencies by running the following command in the terminal: + + ```bash + pip install -r requirements.txt From 80a2a43e272ad9080c5cde6d53ceccc3374bf30b Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 19 May 2023 09:48:45 +0530 Subject: [PATCH 032/104] Create requirements.txt --- requirements.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..12c0377f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +pgvector +timescaledb +citus +postgis From ec4ce6c861ea86477d54785edd3c018a2eb58d2a Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 19 May 2023 09:53:51 +0530 Subject: [PATCH 033/104] Update requirements.txt --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index 12c0377f..2ecb19c7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,5 @@ pgvector timescaledb citus postgis +numpy==1.20.3 +pandas==1.3.0 From ea2e0565aa8ee20de00dedbce41886466e558fbd Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 19 May 2023 10:09:42 +0530 Subject: [PATCH 034/104] Update requirements.txt --- requirements.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 2ecb19c7..b522584e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,2 @@ pgvector -timescaledb -citus -postgis -numpy==1.20.3 -pandas==1.3.0 +timescaledb-tune From ef9d1698a964872b5bb2b5402e9fd0a3df53a81c Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 19 May 2023 10:10:10 +0530 Subject: [PATCH 035/104] Update requirements.txt --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index b522584e..5659e515 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,4 @@ pgvector timescaledb-tune +timescaledb-parallel-copy +libssl1.1 From 8e8030b2581bff509e24b914068948382472ee29 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 19 May 2023 10:10:50 +0530 Subject: [PATCH 036/104] Update requirements.txt --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index 5659e515..318024e1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,5 @@ pgvector timescaledb-tune timescaledb-parallel-copy libssl1.1 +libssl-dev +libkrb5-dev From cd57f3b0fbac63f68e8251c88f8b0054020f1845 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 19 May 2023 10:11:33 +0530 Subject: [PATCH 037/104] Update requirements.txt --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requirements.txt b/requirements.txt index 318024e1..3d64e1b8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,6 @@ timescaledb-parallel-copy libssl1.1 libssl-dev libkrb5-dev +libpq-dev +libc-dev +make From 6ef1f7234d0b89aa440a46371bc8b4e57a1a9397 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 19 May 2023 10:12:26 +0530 Subject: [PATCH 038/104] Update requirements.txt --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requirements.txt b/requirements.txt index 3d64e1b8..824dabde 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,6 @@ libkrb5-dev libpq-dev libc-dev make +cmake +llvm15 +clang From 77e60c2adbaed7f5434eaef9f442e03e9c62b116 Mon Sep 17 00:00:00 2001 From: Jayanth Kumar <64846852+jayanth-kumar-morem@users.noreply.github.com> Date: Wed, 24 May 2023 10:42:25 +0000 Subject: [PATCH 039/104] clang15 version specification --- .github/workflows/smoke-test.yml | 2 + Dockerfile | 17 ++- bitnami/Dockerfile | 199 ++++++++++++++++++------------- 3 files changed, 133 insertions(+), 85 deletions(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index c831969c..439ae28f 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -74,6 +74,8 @@ jobs: psql -c "CREATE EXTENSION zombodb;" psql -c "SELECT * FROM pg_extension WHERE extname = 'zombodb';" + psql -c "CREATE EXTENSION zombodb;" + break fi sleep 1 diff --git a/Dockerfile b/Dockerfile index 677ed309..dd38d2a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -79,6 +79,10 @@ RUN echo "shared_preload_libraries = 'citus,timescaledb,pg_stat_statements'" >> # Adding PG Vector RUN cd /tmp + +# Installing clang-15 +RUN + RUN apk add --no-cache --virtual .build-deps \ coreutils \ dpkg-dev dpkg \ @@ -87,9 +91,9 @@ RUN apk add --no-cache --virtual .build-deps \ krb5-dev \ libc-dev \ llvm15 \ - clang \ make \ cmake \ + clang15 \ util-linux-dev \ && git clone --branch v0.4.1 https://github.com/pgvector/pgvector.git \ && cd /pgvector \ @@ -141,8 +145,8 @@ RUN set -eux \ && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ set -eux ; \ export GEOS_ALPINE_VER=3.11 ; \ - export GDAL_ALPINE_VER=3.5 ; \ - export PROJ_ALPINE_VER=9.1 ; \ + export GDAL_ALPINE_VER=3.6.4-r4 ; \ + export PROJ_ALPINE_VER=9.2.0-r0 ; \ elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ set -eux ; \ export GEOS_ALPINE_VER=3.8 ; \ @@ -184,6 +188,7 @@ RUN set -eux \ autoconf \ automake \ clang-dev \ + clang15 \ cunit-dev \ file \ g++ \ @@ -194,6 +199,7 @@ RUN set -eux \ libtool \ libxml2-dev \ llvm-dev \ + llvm15 \ make \ pcre-dev \ perl \ @@ -242,8 +248,9 @@ RUN apk add --no-cache --virtual .zombodb-build-deps \ util-linux-dev \ musl-dev \ openssl-dev \ - clang-libs \ - clang-dev \ + # clang-libs \ + # clang-dev \ + clang15 \ tar \ && gem install --no-document fpm \ && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \ diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index a210b429..f975cdec 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -63,87 +63,126 @@ COPY bitnami/timescaledb-bitnami-entrypoint.sh /opt/bitnami/scripts/postgresql/ USER 0 ARG TS_VERSION -RUN set -ex \ - && rm -v /opt/bitnami/postgresql/lib/.emptyfile \ - && rm -v /opt/bitnami/postgresql/share/extension/.emptyfile \ - && mkdir -p /var/lib/apt/lists/partial \ - && apt-get update \ - && apt-get -y install \ - \ - build-essential \ - libssl-dev \ - git \ - \ - dpkg-dev \ - gcc \ - libc-dev \ - make \ - cmake \ - wget \ - && mkdir -p /build/ \ - && git clone https://github.com/timescale/timescaledb /build/timescaledb \ - \ - # Build current version \ - && cd /build/timescaledb && rm -fr build \ - && git checkout ${TS_VERSION} \ - && ./bootstrap -DCMAKE_BUILD_TYPE=RelWithDebInfo -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DGENERATE_DOWNGRADE_SCRIPT=ON -DWARNINGS_AS_ERRORS=OFF -DPROJECT_INSTALL_METHOD="docker-bitnami" \ - && cd build && make install \ - && cd ~ \ - \ - # Install Citus - && apt-get update \ - && apt-get install -y curl liblz4-dev libzstd-dev clang libkrb5-dev libicu-dev libxslt1-dev libxml2-dev llvm-dev libcurl4-openssl-dev \ - && CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" \ - && curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" \ - && tar -C /tmp -xvf /tmp/citus.tar.gz \ - && addgroup --system postgres \ - && adduser --system --ingroup postgres --home /opt/bitnami/postgresql --no-create-home postgres \ - && chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} \ - && cd /tmp/citus-${CITUS_VERSION} \ - && PATH="/opt/bitnami/postgresql/bin:$PATH" ./configure \ - && make \ - && make install \ - && cd ~ \ - && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \ - \ - && apt-get autoremove --purge -y \ - \ - build-essential \ - libssl-dev \ - \ - dpkg-dev \ - gcc \ - libc-dev \ - make \ - cmake \ - && apt-get clean -y \ - && rm -rf \ - /build \ - "${HOME}/.cache" \ - /var/lib/apt/lists/* \ - /tmp/* \ - /var/tmp/* \ - \ - # Update shared_preload_libraries - && sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb'/g" /opt/bitnami/postgresql/conf/postgresql.conf +# RUN set -ex \ +# && rm -v /opt/bitnami/postgresql/lib/.emptyfile \ +# && rm -v /opt/bitnami/postgresql/share/extension/.emptyfile \ +# && mkdir -p /var/lib/apt/lists/partial \ +# && apt-get update \ +# && apt-get -y install \ +# \ +# build-essential \ +# libssl-dev \ +# git \ +# \ +# dpkg-dev \ +# gcc \ +# libc-dev \ +# make \ +# cmake \ +# wget \ +# && mkdir -p /build/ \ +# && git clone https://github.com/timescale/timescaledb /build/timescaledb \ +# \ +# # Build current version \ +# && cd /build/timescaledb && rm -fr build \ +# && git checkout ${TS_VERSION} \ +# && ./bootstrap -DCMAKE_BUILD_TYPE=RelWithDebInfo -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DGENERATE_DOWNGRADE_SCRIPT=ON -DWARNINGS_AS_ERRORS=OFF -DPROJECT_INSTALL_METHOD="docker-bitnami" \ +# && cd build && make install \ +# && cd ~ \ +# \ +# # Install Citus +# && apt-get update \ +# && apt-get install -y curl liblz4-dev libzstd-dev clang libkrb5-dev libicu-dev libxslt1-dev libxml2-dev llvm-dev libcurl4-openssl-dev \ +# && CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" \ +# && curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" \ +# && tar -C /tmp -xvf /tmp/citus.tar.gz \ +# && addgroup --system postgres \ +# && adduser --system --ingroup postgres --home /opt/bitnami/postgresql --no-create-home postgres \ +# && chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} \ +# && cd /tmp/citus-${CITUS_VERSION} \ +# && PATH="/opt/bitnami/postgresql/bin:$PATH" ./configure \ +# && make \ +# && make install \ +# && cd ~ \ +# && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \ +# \ +# && apt-get autoremove --purge -y \ +# \ +# build-essential \ +# libssl-dev \ +# \ +# dpkg-dev \ +# gcc \ +# libc-dev \ +# make \ +# cmake \ +# && apt-get clean -y \ +# && rm -rf \ +# /build \ +# "${HOME}/.cache" \ +# /var/lib/apt/lists/* \ +# /tmp/* \ +# /var/tmp/* \ +# \ +# # Update shared_preload_libraries +# && sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb'/g" /opt/bitnami/postgresql/conf/postgresql.conf -# Add PostGIS Extension -ARG POSTGIS_MAJOR -ARG PG_MAJOR -ARG POSTGIS_VERSION - -RUN apt-get update \ - && apt-get install -y lsb-release gnupg2 \ - && echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \ - && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ - && apt-get update \ - && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ - && apt-get install -y --no-install-recommends \ - ca-certificates \ - \ - postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ - postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ - && rm -rf /var/lib/apt/lists/* +# # Add PostGIS Extension +# ARG POSTGIS_MAJOR +# ARG PG_MAJOR +# ARG POSTGIS_VERSION + +# RUN apt-get update \ +# && apt-get install -y lsb-release gnupg2 \ +# && echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \ +# && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ +# && apt-get update \ +# && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ +# && apt-get install -y --no-install-recommends \ +# ca-certificates \ +# \ +# postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ +# postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ +# && rm -rf /var/lib/apt/lists/* + + +RUN apt-get update -y -qq --fix-missing +RUN apt-get install -y wget gnupg + +RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main 15" >> /etc/apt/sources.list.d/pgdg.list +RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - +RUN apt update +RUN apt-get update -y --fix-missing + +RUN apt-get install -y git +RUN apt-get install -y curl +RUN apt-get install -y clang llvm gcc make build-essential libz-dev zlib1g-dev strace libssl-dev pkg-config + +RUN apt-get install lsb-release wget software-properties-common gnupg -y + +# Try to install the dependencies one by one +RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 14 + +# RUN apt-get install -y postgresql-15 postgresql-server-dev-15 + +## b/c why not! http://www.inanzzz.com/index.php/post/3zs5/installing-ruby-on-debian-8 +RUN apt-get install -y libreadline-dev libgdbm-dev openssl +RUN mkdir ruby && \ + cd ruby && \ + wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz && \ + tar xvfz ruby-2.3.0.tar.gz && \ + cd ruby-2.3.0 && \ + ./configure && \ + make -j64 && \ + make install +RUN gem install --no-document fpm + + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y +ENV PATH="/home/.cargo/bin:${PATH}" +RUN cargo install cargo-pgrx +RUN cargo pgrx init \ + --pg15=/usr/lib/postgresql/15/bin/pg_config USER 1001 From b9b188abb931bdd90c2a8f6cafd0604a1275109c Mon Sep 17 00:00:00 2001 From: Jayanth Kumar <64846852+jayanth-kumar-morem@users.noreply.github.com> Date: Thu, 11 May 2023 12:50:07 +0000 Subject: [PATCH 040/104] updated to clang15 --- Dockerfile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index dd38d2a1..ba99fb47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -79,10 +79,6 @@ RUN echo "shared_preload_libraries = 'citus,timescaledb,pg_stat_statements'" >> # Adding PG Vector RUN cd /tmp - -# Installing clang-15 -RUN - RUN apk add --no-cache --virtual .build-deps \ coreutils \ dpkg-dev dpkg \ @@ -248,8 +244,6 @@ RUN apk add --no-cache --virtual .zombodb-build-deps \ util-linux-dev \ musl-dev \ openssl-dev \ - # clang-libs \ - # clang-dev \ clang15 \ tar \ && gem install --no-document fpm \ From 6d334080caa305518cdf104e7c9a7a91648f6a09 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:10:08 +0530 Subject: [PATCH 041/104] Refactor Readme --- README.md | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 3b3cd9ed..e6eefd95 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,14 @@

WarpSQL


-Opinionated extensions to Postgres packaged as a single docker deployment. Why install 10 DBs when you can can have everthing at once (maybe not everything). +Opinionated extensions to Postgres packaged as a single docker deployment. Why install 10 DBs when you can have everything at once (maybe not everything). Certified as Indie Hacker's best friend!!! ### Test on GitPod [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ChakshuGautam/postgres-tsdb-vector-docker) + ### Current and future supported extensions - [x] [PgVector](https://github.com/pgvector/pgvector) @@ -19,35 +20,3 @@ Certified as Indie Hacker's best friend!!! - [ ] [Pg Repack](https://github.com/reorg/pg_repack) Bootstrapped from [TimescaleDB](https://github.com/timescale/timescaledb-docker) - -### Usage with Compose - -```yaml -version: '3.6' -services: - warpsql: - container_name: warpsql - image: samagragovernance/postgres:latest-pg15 - restart: always - ports: - - "5432:5432" - volumes: - - ./pgdata:/var/lib/postgresql/data - environment: - POSTGRES_USER: warpSQLUser - POSTGRES_PASSWORD: warpSQLPass -``` - -## Development with GitHub Codespaces - -You can use GitHub Codespaces to develop this project in the cloud. - -1. Click on the "Code" button. -2. Select "Open with Codespaces" from the dropdown menu. -3. Choose the appropriate Codespace configuration. -4. Wait for the environment to be provisioned. -5. Once the environment is ready, you can start working on the project. -6. Install the project dependencies by running the following command in the terminal: - - ```bash - pip install -r requirements.txt From b3be6883c67b6a66421cdcf53cbbd67172390f4a Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:10:51 +0530 Subject: [PATCH 042/104] Refactor Readme --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index e6eefd95..4c15b66a 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,21 @@ Certified as Indie Hacker's best friend!!! - [ ] [Pg Repack](https://github.com/reorg/pg_repack) Bootstrapped from [TimescaleDB](https://github.com/timescale/timescaledb-docker) + +### Usage with Compose + +```yaml +version: '3.6' +services: + warpsql: + container_name: warpsql + image: samagragovernance/postgres:latest-pg15 + restart: always + ports: + - "5432:5432" + volumes: + - ./pgdata:/var/lib/postgresql/data + environment: + POSTGRES_USER: warpSQLUser + POSTGRES_PASSWORD: warpSQLPass +``` From 51945fd8fe412cb8847c814dcb57a58a99a1f4c9 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:12:09 +0530 Subject: [PATCH 043/104] Refactor Readme --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 4c15b66a..6a5ea461 100644 --- a/README.md +++ b/README.md @@ -38,3 +38,13 @@ services: POSTGRES_USER: warpSQLUser POSTGRES_PASSWORD: warpSQLPass ``` + +WarpSQL is a powerful solution that provides opinionated extensions to Postgres, conveniently packaged as a single Docker deployment. It eliminates the need to install multiple separate databases by offering a comprehensive set of features in one place (although not everything, as some features might not be included). + +By utilizing WarpSQL, you can benefit from the following: + +• Simplified setup: With WarpSQL, you can have all the necessary extensions for your Postgres database in one go, saving you time and effort. + +• Seamless integration: WarpSQL includes popular extensions like PgVector, TimescaleDB, Citus, and PostGIS, allowing you to leverage their functionality seamlessly. + +• Enhanced performance: The included extensions are carefully selected to optimize database performance, enabling you to work efficiently with large datasets. From 74bc4fbe003519c597057b080dac7b1d81e1bdd2 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:12:56 +0530 Subject: [PATCH 044/104] Refactor Readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6a5ea461..0fda2d7b 100644 --- a/README.md +++ b/README.md @@ -48,3 +48,9 @@ By utilizing WarpSQL, you can benefit from the following: • Seamless integration: WarpSQL includes popular extensions like PgVector, TimescaleDB, Citus, and PostGIS, allowing you to leverage their functionality seamlessly. • Enhanced performance: The included extensions are carefully selected to optimize database performance, enabling you to work efficiently with large datasets. + +• Extensibility: While WarpSQL already supports a range of extensions, it aims to expand its offerings to include even more powerful tools in the future, such as ZomboDB, PLV8, and Pg Repack. +Get started with WarpSQL today and experience the convenience of a comprehensive Postgres solution. + +## Contribution + From 8081073bb289eb2faa5a0e1dd7479c5f195015f8 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:13:40 +0530 Subject: [PATCH 045/104] Refactor Readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0fda2d7b..4ba4a2d9 100644 --- a/README.md +++ b/README.md @@ -54,3 +54,4 @@ Get started with WarpSQL today and experience the convenience of a comprehensive ## Contribution +You can contribute to the development of WarpSQL using both Gitpod and Codespaces. Follow the steps below to set up your development environment and make contributions: From ab3b7673a1c10f03d9b6b7f1a3dfb39c6b56d6a1 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:14:23 +0530 Subject: [PATCH 046/104] Refactor Readme --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 4ba4a2d9..30964bcf 100644 --- a/README.md +++ b/README.md @@ -55,3 +55,18 @@ Get started with WarpSQL today and experience the convenience of a comprehensive ## Contribution You can contribute to the development of WarpSQL using both Gitpod and Codespaces. Follow the steps below to set up your development environment and make contributions: + +## Gitpod + +Click the "Open in Gitpod" button above or use the following link:[Open in Gitpod](https://gitpod.io/new/#https://github.com/ChakshuGautam/postgres-tsdb-vector-docker) + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ChakshuGautam/postgres-tsdb-vector-docker) + + +• Wait for the Gitpod environment to be created and initialized. + +• Once the environment is ready, you can start working on the project. + +• Make your desired changes or additions. + +• Test your changes and ensure they meet the project's guidelines. From 190ab95352a05abae496f18a31b692eca5bc0550 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:15:07 +0530 Subject: [PATCH 047/104] Refactor Readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 30964bcf..63875709 100644 --- a/README.md +++ b/README.md @@ -70,3 +70,7 @@ Click the "Open in Gitpod" button above or use the following link:[Open in Gitpo • Make your desired changes or additions. • Test your changes and ensure they meet the project's guidelines. + +• Commit and push your changes to your forked repository. + +• Create a pull request from your forked repository to the main WarpSQL repository. From b367b94316551e5c990cb709aec3f192a57a0803 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:15:59 +0530 Subject: [PATCH 048/104] Refactor Readme --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 63875709..f095171d 100644 --- a/README.md +++ b/README.md @@ -74,3 +74,16 @@ Click the "Open in Gitpod" button above or use the following link:[Open in Gitpo • Commit and push your changes to your forked repository. • Create a pull request from your forked repository to the main WarpSQL repository. + +## Development with GitHub Codespaces + +You can use GitHub Codespaces to develop this project in the cloud. + +[![GitHub Codespaces](https://img.shields.io/badge/GitHub-Codespaces-blue?logo=github)](https://github.com/features/codespaces) + + +• Click on the "Code" button. + +• Select "Open with Codespaces" from the dropdown menu. + +• Choose the appropriate Codespace configuration. From cdea8350845a5ee173b295c4045fa95d49d7b22f Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:16:40 +0530 Subject: [PATCH 049/104] Refactor Readme --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index f095171d..659c5a28 100644 --- a/README.md +++ b/README.md @@ -87,3 +87,17 @@ You can use GitHub Codespaces to develop this project in the cloud. • Select "Open with Codespaces" from the dropdown menu. • Choose the appropriate Codespace configuration. + +• Wait for the environment to be provisioned. + +Once the environment is ready, you can start working on the project. + +Make your desired changes or additions. +Test your changes and ensure they meet the project's guidelines. +Commit and push your changes to your forked repository. +Create a pull request from your forked repository to the main WarpSQL repository. +We welcome contributions from the community and appreciate your support in improving WarpSQL! + +Install the project dependencies by running the following command in the terminal: + +```pip install -r requirements.txt``` From 41cb3eeb4c40d3640cac41413b6839127f2423b1 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:18:28 +0530 Subject: [PATCH 050/104] Refactor Readme --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 659c5a28..7fd92afd 100644 --- a/README.md +++ b/README.md @@ -101,3 +101,19 @@ We welcome contributions from the community and appreciate your support in impro Install the project dependencies by running the following command in the terminal: ```pip install -r requirements.txt``` + +## Ensure CI passes ![](https://img.shields.io/badge/CI-Passing-brightgreen) + + +Before merging any contributions or changes, it's essential to ensure that the continuous integration (CI) tests pass successfully. CI helps maintain code quality standards and prevents the introduction of regressions. To ensure a smooth integration process, follow these steps: + +• Make your desired changes or additions to the codebase. + +• Run the relevant tests locally to verify that your changes are functioning as expected. + +• Push your changes to the branch you're working on. + +• The CI system will automatically run tests and checks on your code. + +• Monitor the CI build status to ensure that all tests pass successfully. + From 5b9c811540ac3a5fd9d401fa8b8db444f86c94f9 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:19:03 +0530 Subject: [PATCH 051/104] Refactor Readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 7fd92afd..2461a4f7 100644 --- a/README.md +++ b/README.md @@ -117,3 +117,8 @@ Before merging any contributions or changes, it's essential to ensure that the c • Monitor the CI build status to ensure that all tests pass successfully. +• If the CI build fails, review the error messages and make the necessary fixes. + +• Repeat steps 3-6 until the CI build passes successfully. + +• Once the CI build is successful, you can proceed with merging your changes into the main WarpSQL repository. From 5b8a3dc793270f8aca836fb50cb18b4fc2eec9a7 Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:19:34 +0530 Subject: [PATCH 052/104] Refactor Readme --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 2461a4f7..72a01548 100644 --- a/README.md +++ b/README.md @@ -122,3 +122,13 @@ Before merging any contributions or changes, it's essential to ensure that the c • Repeat steps 3-6 until the CI build passes successfully. • Once the CI build is successful, you can proceed with merging your changes into the main WarpSQL repository. + + +## Publish the Project ![](https://img.shields.io/badge/Publish-IconName-green) + + +To publish the WarpSQL project, follow the guidelines below: + +• Document the release process: Provide clear instructions on how to release new versions of the project. This may include steps to follow, release branches or tags, and any necessary checks or validations. + +• Versioning conventions: Define the versioning scheme used for the project. It could be semantic versioning (e.g., MAJOR.MINOR.PATCH) or any other convention that aligns with the project's needs. From 03a76ccfe6a1696e9c6fce2a4732d285100681ae Mon Sep 17 00:00:00 2001 From: Atul Rajput <92659293+AtulRajput01@users.noreply.github.com> Date: Fri, 26 May 2023 21:20:06 +0530 Subject: [PATCH 053/104] Refactor Readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 72a01548..d65a60fb 100644 --- a/README.md +++ b/README.md @@ -132,3 +132,7 @@ To publish the WarpSQL project, follow the guidelines below: • Document the release process: Provide clear instructions on how to release new versions of the project. This may include steps to follow, release branches or tags, and any necessary checks or validations. • Versioning conventions: Define the versioning scheme used for the project. It could be semantic versioning (e.g., MAJOR.MINOR.PATCH) or any other convention that aligns with the project's needs. + +• Release notes: Prepare release notes for each new version, highlighting the changes, bug fixes, and new features included in the release. This helps users understand what to expect when upgrading to a new version. + +• Distribution and deployment: Specify how the project should be distributed or deployed. If there are specific packages, containers, or deployment configurations, provide relevant documentation or instructions. From 796a2073656d0a46a61980604bfcab1893875a5e Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Thu, 18 May 2023 12:39:41 +0530 Subject: [PATCH 054/104] pgrx 0.8.3 compatability with zombodb cargo.toml --- .github/workflows/smoke-test.yml | 2 +- bitnami/Dockerfile | 242 ++++++++++++++++--------------- 2 files changed, 124 insertions(+), 120 deletions(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 439ae28f..c169152d 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -3,7 +3,7 @@ on: pull_request: push: branches: - - main + # - main env: ORG: timescaledev diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index f975cdec..07018dcf 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -63,126 +63,130 @@ COPY bitnami/timescaledb-bitnami-entrypoint.sh /opt/bitnami/scripts/postgresql/ USER 0 ARG TS_VERSION -# RUN set -ex \ -# && rm -v /opt/bitnami/postgresql/lib/.emptyfile \ -# && rm -v /opt/bitnami/postgresql/share/extension/.emptyfile \ -# && mkdir -p /var/lib/apt/lists/partial \ -# && apt-get update \ -# && apt-get -y install \ -# \ -# build-essential \ -# libssl-dev \ -# git \ -# \ -# dpkg-dev \ -# gcc \ -# libc-dev \ -# make \ -# cmake \ -# wget \ -# && mkdir -p /build/ \ -# && git clone https://github.com/timescale/timescaledb /build/timescaledb \ -# \ -# # Build current version \ -# && cd /build/timescaledb && rm -fr build \ -# && git checkout ${TS_VERSION} \ -# && ./bootstrap -DCMAKE_BUILD_TYPE=RelWithDebInfo -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DGENERATE_DOWNGRADE_SCRIPT=ON -DWARNINGS_AS_ERRORS=OFF -DPROJECT_INSTALL_METHOD="docker-bitnami" \ -# && cd build && make install \ -# && cd ~ \ -# \ -# # Install Citus -# && apt-get update \ -# && apt-get install -y curl liblz4-dev libzstd-dev clang libkrb5-dev libicu-dev libxslt1-dev libxml2-dev llvm-dev libcurl4-openssl-dev \ -# && CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" \ -# && curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" \ -# && tar -C /tmp -xvf /tmp/citus.tar.gz \ -# && addgroup --system postgres \ -# && adduser --system --ingroup postgres --home /opt/bitnami/postgresql --no-create-home postgres \ -# && chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} \ -# && cd /tmp/citus-${CITUS_VERSION} \ -# && PATH="/opt/bitnami/postgresql/bin:$PATH" ./configure \ -# && make \ -# && make install \ -# && cd ~ \ -# && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \ -# \ -# && apt-get autoremove --purge -y \ -# \ -# build-essential \ -# libssl-dev \ -# \ -# dpkg-dev \ -# gcc \ -# libc-dev \ -# make \ -# cmake \ -# && apt-get clean -y \ -# && rm -rf \ -# /build \ -# "${HOME}/.cache" \ -# /var/lib/apt/lists/* \ -# /tmp/* \ -# /var/tmp/* \ -# \ -# # Update shared_preload_libraries -# && sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb'/g" /opt/bitnami/postgresql/conf/postgresql.conf +RUN set -ex \ + && rm -v /opt/bitnami/postgresql/lib/.emptyfile \ + && rm -v /opt/bitnami/postgresql/share/extension/.emptyfile \ + && mkdir -p /var/lib/apt/lists/partial \ + && apt-get update \ + && apt-get -y install \ + \ + build-essential \ + libssl-dev \ + git \ + \ + dpkg-dev \ + gcc \ + libc-dev \ + make \ + cmake \ + wget \ + && mkdir -p /build/ \ + && git clone https://github.com/timescale/timescaledb /build/timescaledb \ + \ + # Build current version \ + && cd /build/timescaledb && rm -fr build \ + && git checkout ${TS_VERSION} \ + && ./bootstrap -DCMAKE_BUILD_TYPE=RelWithDebInfo -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DGENERATE_DOWNGRADE_SCRIPT=ON -DWARNINGS_AS_ERRORS=OFF -DPROJECT_INSTALL_METHOD="docker-bitnami" \ + && cd build && make install \ + && cd ~ \ + \ + # Install Citus + && apt-get update \ + && apt-get install -y curl liblz4-dev libzstd-dev clang libkrb5-dev libicu-dev libxslt1-dev libxml2-dev llvm-dev libcurl4-openssl-dev \ + && CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" \ + && curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" \ + && tar -C /tmp -xvf /tmp/citus.tar.gz \ + && addgroup --system postgres \ + && adduser --system --ingroup postgres --home /opt/bitnami/postgresql --no-create-home postgres \ + && chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} \ + && cd /tmp/citus-${CITUS_VERSION} \ + && PATH="/opt/bitnami/postgresql/bin:$PATH" ./configure \ + && make \ + && make install \ + && cd ~ \ + && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \ + \ + && apt-get autoremove --purge -y \ + \ + build-essential \ + libssl-dev \ + \ + dpkg-dev \ + gcc \ + libc-dev \ + make \ + cmake \ + && apt-get clean -y \ + && rm -rf \ + /build \ + "${HOME}/.cache" \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* + # \ + # # Update shared_preload_libraries + # && sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb'/g" /opt/bitnami/postgresql/conf/postgresql.conf -# # Add PostGIS Extension -# ARG POSTGIS_MAJOR -# ARG PG_MAJOR -# ARG POSTGIS_VERSION - -# RUN apt-get update \ -# && apt-get install -y lsb-release gnupg2 \ -# && echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \ -# && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ -# && apt-get update \ -# && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ -# && apt-get install -y --no-install-recommends \ -# ca-certificates \ -# \ -# postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ -# postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ -# && rm -rf /var/lib/apt/lists/* - - -RUN apt-get update -y -qq --fix-missing -RUN apt-get install -y wget gnupg - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main 15" >> /etc/apt/sources.list.d/pgdg.list -RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN apt update -RUN apt-get update -y --fix-missing - -RUN apt-get install -y git -RUN apt-get install -y curl -RUN apt-get install -y clang llvm gcc make build-essential libz-dev zlib1g-dev strace libssl-dev pkg-config - -RUN apt-get install lsb-release wget software-properties-common gnupg -y - -# Try to install the dependencies one by one -RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 14 - -# RUN apt-get install -y postgresql-15 postgresql-server-dev-15 - -## b/c why not! http://www.inanzzz.com/index.php/post/3zs5/installing-ruby-on-debian-8 -RUN apt-get install -y libreadline-dev libgdbm-dev openssl -RUN mkdir ruby && \ - cd ruby && \ - wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz && \ - tar xvfz ruby-2.3.0.tar.gz && \ - cd ruby-2.3.0 && \ - ./configure && \ - make -j64 && \ - make install -RUN gem install --no-document fpm - - -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y -ENV PATH="/home/.cargo/bin:${PATH}" -RUN cargo install cargo-pgrx -RUN cargo pgrx init \ - --pg15=/usr/lib/postgresql/15/bin/pg_config +# Add PostGIS Extension +ARG POSTGIS_MAJOR +ARG PG_MAJOR +ARG POSTGIS_VERSION + +RUN apt-get update \ + && apt-get install -y lsb-release gnupg2 \ + && echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \ + && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + \ + postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ + postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ + && rm -rf /var/lib/apt/lists/* + +RUN apt-get update -y -qq --fix-missing \ + && apt-get install -y wget gnupg \ + && echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main 15" >> /etc/apt/sources.list.d/pgdg.list \ + && echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" >> /etc/apt/sources.list \ + && echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list \ + && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && wget --quiet -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ + && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 \ + && apt update \ + && apt-get update -y --fix-missing \ + && 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 \ + && wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz \ + && tar -xzvf openssl-1.0.2l.tar.gz \ + && cd openssl-1.0.2l \ + && ./config \ + && make install \ + && ln -sf /usr/local/ssl/bin/openssl `which openssl` \ + && mkdir ruby \ + && cd ruby \ + && wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz \ + && tar xvfz ruby-2.3.0.tar.gz \ + && cd ruby-2.3.0 \ + && ./configure --with-openssl-dir=/usr/include/openssl-1.0 \ + && make -j64 \ + && make install \ + && gem install --no-document fpm + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ + && export PATH="/.cargo/bin:$PATH" \ + && export PGRX_HOME="/.pgrx/" \ + && mkdir -p $PGRX_HOME \ + && cargo install cargo-pgrx --version 0.8.3 \ + && cargo pgrx init --pg15=/opt/bitnami/postgresql/bin/pg_config + +RUN git clone https://github.com/zombodb/zombodb.git \ + && cd zombodb \ + # && sed -i 's/pgrx = "=0.8.3"/pgrx = "=0.8.3"/' Cargo.toml \ + && export PATH="/.cargo/bin:$PATH" && cargo pgrx install --release + + +#0 166.5 /.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-pgrx-0.9.0/Cargo.toml +#0 166.5 /.cargo/registry/src/github.com-1ecc6299db9ec823/pgrx-pg-config-0.9.0/Cargo.toml USER 1001 From 11145717fb6659b6fb35f7a23c0ab668cb0bbf9a Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Sat, 20 May 2023 12:47:26 +0530 Subject: [PATCH 055/104] timescaledb-bitnami-entrypoint.sh update to include zombodb --- bitnami/timescaledb-bitnami-entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitnami/timescaledb-bitnami-entrypoint.sh b/bitnami/timescaledb-bitnami-entrypoint.sh index f5c79bf5..6c605e36 100755 --- a/bitnami/timescaledb-bitnami-entrypoint.sh +++ b/bitnami/timescaledb-bitnami-entrypoint.sh @@ -4,9 +4,9 @@ # the shared preload list, or else it gets overwritten. if [ -z "$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" ] then - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb" else - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" fi export POSTGRESQL_SHARED_PRELOAD_LIBRARIES From adc3d832cff156cfb7ef3557c7601e90534f75ba Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Sun, 21 May 2023 12:52:37 +0530 Subject: [PATCH 056/104] bitnami Image cleaned --- bitnami/Dockerfile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index 07018dcf..bbb0dd9c 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -123,9 +123,6 @@ RUN set -ex \ /var/lib/apt/lists/* \ /tmp/* \ /var/tmp/* - # \ - # # Update shared_preload_libraries - # && sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb'/g" /opt/bitnami/postgresql/conf/postgresql.conf # Add PostGIS Extension ARG POSTGIS_MAJOR @@ -145,6 +142,7 @@ RUN apt-get update \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ && rm -rf /var/lib/apt/lists/* +# Install Zombodb extension RUN apt-get update -y -qq --fix-missing \ && apt-get install -y wget gnupg \ && echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main 15" >> /etc/apt/sources.list.d/pgdg.list \ @@ -181,13 +179,8 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ RUN git clone https://github.com/zombodb/zombodb.git \ && cd zombodb \ - # && sed -i 's/pgrx = "=0.8.3"/pgrx = "=0.8.3"/' Cargo.toml \ && export PATH="/.cargo/bin:$PATH" && cargo pgrx install --release - -#0 166.5 /.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-pgrx-0.9.0/Cargo.toml -#0 166.5 /.cargo/registry/src/github.com-1ecc6299db9ec823/pgrx-pg-config-0.9.0/Cargo.toml - USER 1001 ENTRYPOINT [ "/opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh" ] From c5ca05d061fec9933dd5776df889432b07dba8de Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Mon, 22 May 2023 12:53:39 +0530 Subject: [PATCH 057/104] smoke tests added for zombodb --- .github/workflows/smoke-test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index c169152d..c831969c 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -3,7 +3,7 @@ on: pull_request: push: branches: - # - main + - main env: ORG: timescaledev @@ -74,8 +74,6 @@ jobs: psql -c "CREATE EXTENSION zombodb;" psql -c "SELECT * FROM pg_extension WHERE extname = 'zombodb';" - psql -c "CREATE EXTENSION zombodb;" - break fi sleep 1 From 7cdd3f81a3fd0de51b0708a548f36efe7430b8c0 Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Mon, 22 May 2023 13:22:44 +0530 Subject: [PATCH 058/104] removed pg15 sources --- bitnami/Dockerfile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index bbb0dd9c..79bbfa61 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -142,13 +142,11 @@ RUN apt-get update \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ && rm -rf /var/lib/apt/lists/* -# Install Zombodb extension +# Install zombodb extension RUN apt-get update -y -qq --fix-missing \ && apt-get install -y wget gnupg \ - && echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main 15" >> /etc/apt/sources.list.d/pgdg.list \ && echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" >> /etc/apt/sources.list \ && echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list \ - && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && wget --quiet -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 \ && apt update \ @@ -168,16 +166,14 @@ RUN apt-get update -y -qq --fix-missing \ && ./configure --with-openssl-dir=/usr/include/openssl-1.0 \ && make -j64 \ && make install \ - && gem install --no-document fpm - -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ + && gem install --no-document fpm \ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ && export PATH="/.cargo/bin:$PATH" \ && export PGRX_HOME="/.pgrx/" \ && mkdir -p $PGRX_HOME \ && cargo install cargo-pgrx --version 0.8.3 \ - && cargo pgrx init --pg15=/opt/bitnami/postgresql/bin/pg_config - -RUN git clone https://github.com/zombodb/zombodb.git \ + && cargo pgrx init --pg${PG_MAJOR}=/opt/bitnami/postgresql/bin/pg_config \ + && git clone https://github.com/zombodb/zombodb.git \ && cd zombodb \ && export PATH="/.cargo/bin:$PATH" && cargo pgrx install --release From fa4d0fa86d62e01e53b1bbc58372e33156d1c2a5 Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Tue, 23 May 2023 13:48:35 +0530 Subject: [PATCH 059/104] pgrx version specification --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ba99fb47..aa1b9a1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -249,7 +249,7 @@ RUN apk add --no-cache --virtual .zombodb-build-deps \ && gem install --no-document fpm \ && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \ && PATH=$HOME/.cargo/bin:$PATH \ - && cargo install cargo-pgrx \ + && cargo install cargo-pgrx --version 0.8.3 \ && cargo pgrx init --${PG_VER}=$(which pg_config) \ && git clone https://github.com/zombodb/zombodb.git \ && cd ./zombodb \ From ce3f35f17afafb4ab01f4fd18061ab290de8c693 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Tue, 30 May 2023 11:25:37 +0530 Subject: [PATCH 060/104] Fix whitespaces. --- README.md | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/README.md b/README.md index d65a60fb..2e3b0989 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,8 @@ WarpSQL is a powerful solution that provides opinionated extensions to Postgres, By utilizing WarpSQL, you can benefit from the following: • Simplified setup: With WarpSQL, you can have all the necessary extensions for your Postgres database in one go, saving you time and effort. - • Seamless integration: WarpSQL includes popular extensions like PgVector, TimescaleDB, Citus, and PostGIS, allowing you to leverage their functionality seamlessly. - • Enhanced performance: The included extensions are carefully selected to optimize database performance, enabling you to work efficiently with large datasets. - • Extensibility: While WarpSQL already supports a range of extensions, it aims to expand its offerings to include even more powerful tools in the future, such as ZomboDB, PLV8, and Pg Repack. Get started with WarpSQL today and experience the convenience of a comprehensive Postgres solution. @@ -64,15 +61,10 @@ Click the "Open in Gitpod" button above or use the following link:[Open in Gitpo • Wait for the Gitpod environment to be created and initialized. - • Once the environment is ready, you can start working on the project. - • Make your desired changes or additions. - • Test your changes and ensure they meet the project's guidelines. - • Commit and push your changes to your forked repository. - • Create a pull request from your forked repository to the main WarpSQL repository. ## Development with GitHub Codespaces @@ -83,11 +75,8 @@ You can use GitHub Codespaces to develop this project in the cloud. • Click on the "Code" button. - • Select "Open with Codespaces" from the dropdown menu. - • Choose the appropriate Codespace configuration. - • Wait for the environment to be provisioned. Once the environment is ready, you can start working on the project. @@ -108,31 +97,20 @@ Install the project dependencies by running the following command in the termina Before merging any contributions or changes, it's essential to ensure that the continuous integration (CI) tests pass successfully. CI helps maintain code quality standards and prevents the introduction of regressions. To ensure a smooth integration process, follow these steps: • Make your desired changes or additions to the codebase. - • Run the relevant tests locally to verify that your changes are functioning as expected. - • Push your changes to the branch you're working on. - • The CI system will automatically run tests and checks on your code. - • Monitor the CI build status to ensure that all tests pass successfully. - • If the CI build fails, review the error messages and make the necessary fixes. - • Repeat steps 3-6 until the CI build passes successfully. - • Once the CI build is successful, you can proceed with merging your changes into the main WarpSQL repository. ## Publish the Project ![](https://img.shields.io/badge/Publish-IconName-green) - To publish the WarpSQL project, follow the guidelines below: • Document the release process: Provide clear instructions on how to release new versions of the project. This may include steps to follow, release branches or tags, and any necessary checks or validations. - • Versioning conventions: Define the versioning scheme used for the project. It could be semantic versioning (e.g., MAJOR.MINOR.PATCH) or any other convention that aligns with the project's needs. - • Release notes: Prepare release notes for each new version, highlighting the changes, bug fixes, and new features included in the release. This helps users understand what to expect when upgrading to a new version. - • Distribution and deployment: Specify how the project should be distributed or deployed. If there are specific packages, containers, or deployment configurations, provide relevant documentation or instructions. From c058d3f36244476912347100756f89116beb3382 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Tue, 30 May 2023 11:28:55 +0530 Subject: [PATCH 061/104] Update README.md --- README.md | 63 +++++++++++++++++++++++-------------------------------- 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 2e3b0989..77a4a4cf 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Certified as Indie Hacker's best friend!!! - [x] [TimescaleDB](https://github.com/timescale/timescaledb) - [x] [Citus](https://www.citusdata.com/) - [x] [PostGIS](https://postgis.net) -- [ ] [ZomboDB](https://github.com/zombodb/zombodb) +- [x] [ZomboDB](https://github.com/zombodb/zombodb) - [ ] [PLV8](https://github.com/plv8/plv8) - [ ] [Pg Repack](https://github.com/reorg/pg_repack) @@ -43,41 +43,40 @@ WarpSQL is a powerful solution that provides opinionated extensions to Postgres, By utilizing WarpSQL, you can benefit from the following: -• Simplified setup: With WarpSQL, you can have all the necessary extensions for your Postgres database in one go, saving you time and effort. -• Seamless integration: WarpSQL includes popular extensions like PgVector, TimescaleDB, Citus, and PostGIS, allowing you to leverage their functionality seamlessly. -• Enhanced performance: The included extensions are carefully selected to optimize database performance, enabling you to work efficiently with large datasets. -• Extensibility: While WarpSQL already supports a range of extensions, it aims to expand its offerings to include even more powerful tools in the future, such as ZomboDB, PLV8, and Pg Repack. +- *Simplified setup*: With WarpSQL, you can have all the necessary extensions for your Postgres database in one go, saving you time and effort. +- *Seamless integration*: WarpSQL includes popular extensions like PgVector, TimescaleDB, Citus, and PostGIS, allowing you to leverage their functionality seamlessly. +- *Enhanced performance*: The included extensions are carefully selected to optimize database performance, enabling you to work efficiently with large datasets. +- *Extensibility*: While WarpSQL already supports a range of extensions, it aims to expand its offerings to include even more powerful tools in the future, such as ZomboDB, PLV8, and Pg Repack. Get started with WarpSQL today and experience the convenience of a comprehensive Postgres solution. ## Contribution You can contribute to the development of WarpSQL using both Gitpod and Codespaces. Follow the steps below to set up your development environment and make contributions: -## Gitpod +### Gitpod Click the "Open in Gitpod" button above or use the following link:[Open in Gitpod](https://gitpod.io/new/#https://github.com/ChakshuGautam/postgres-tsdb-vector-docker) [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ChakshuGautam/postgres-tsdb-vector-docker) -• Wait for the Gitpod environment to be created and initialized. -• Once the environment is ready, you can start working on the project. -• Make your desired changes or additions. -• Test your changes and ensure they meet the project's guidelines. -• Commit and push your changes to your forked repository. -• Create a pull request from your forked repository to the main WarpSQL repository. +- Wait for the Gitpod environment to be created and initialized. +- Once the environment is ready, you can start working on the project. +- Make your desired changes or additions. +- Test your changes and ensure they meet the project's guidelines. +- Commit and push your changes to your forked repository. +- Create a pull request from your forked repository to the main WarpSQL repository. -## Development with GitHub Codespaces +### Development with GitHub Codespaces You can use GitHub Codespaces to develop this project in the cloud. [![GitHub Codespaces](https://img.shields.io/badge/GitHub-Codespaces-blue?logo=github)](https://github.com/features/codespaces) - -• Click on the "Code" button. -• Select "Open with Codespaces" from the dropdown menu. -• Choose the appropriate Codespace configuration. -• Wait for the environment to be provisioned. +- Click on the "Code" button. +- Select "Open with Codespaces" from the dropdown menu. +- Choose the appropriate Codespace configuration. +- Wait for the environment to be provisioned. Once the environment is ready, you can start working on the project. @@ -91,26 +90,16 @@ Install the project dependencies by running the following command in the termina ```pip install -r requirements.txt``` -## Ensure CI passes ![](https://img.shields.io/badge/CI-Passing-brightgreen) +### Ensure CI passes ![](https://img.shields.io/badge/CI-Passing-brightgreen) Before merging any contributions or changes, it's essential to ensure that the continuous integration (CI) tests pass successfully. CI helps maintain code quality standards and prevents the introduction of regressions. To ensure a smooth integration process, follow these steps: -• Make your desired changes or additions to the codebase. -• Run the relevant tests locally to verify that your changes are functioning as expected. -• Push your changes to the branch you're working on. -• The CI system will automatically run tests and checks on your code. -• Monitor the CI build status to ensure that all tests pass successfully. -• If the CI build fails, review the error messages and make the necessary fixes. -• Repeat steps 3-6 until the CI build passes successfully. -• Once the CI build is successful, you can proceed with merging your changes into the main WarpSQL repository. - - -## Publish the Project ![](https://img.shields.io/badge/Publish-IconName-green) - -To publish the WarpSQL project, follow the guidelines below: - -• Document the release process: Provide clear instructions on how to release new versions of the project. This may include steps to follow, release branches or tags, and any necessary checks or validations. -• Versioning conventions: Define the versioning scheme used for the project. It could be semantic versioning (e.g., MAJOR.MINOR.PATCH) or any other convention that aligns with the project's needs. -• Release notes: Prepare release notes for each new version, highlighting the changes, bug fixes, and new features included in the release. This helps users understand what to expect when upgrading to a new version. -• Distribution and deployment: Specify how the project should be distributed or deployed. If there are specific packages, containers, or deployment configurations, provide relevant documentation or instructions. +- Make your desired changes or additions to the codebase. +- Run the relevant tests locally to verify that your changes are functioning as expected. +- Push your changes to the branch you're working on. +- The CI system will automatically run tests and checks on your code. +- Monitor the CI build status to ensure that all tests pass successfully. +- If the CI build fails, review the error messages and make the necessary fixes. +- Repeat steps 3-6 until the CI build passes successfully. +- Once the CI build is successful, you can proceed with merging your changes into the main WarpSQL repository. From 989ac8e0b5a8e9b2c53861ced355738aee25ac8c Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Tue, 30 May 2023 11:29:35 +0530 Subject: [PATCH 062/104] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 77a4a4cf..5dbc27d9 100644 --- a/README.md +++ b/README.md @@ -80,11 +80,11 @@ You can use GitHub Codespaces to develop this project in the cloud. Once the environment is ready, you can start working on the project. -Make your desired changes or additions. -Test your changes and ensure they meet the project's guidelines. -Commit and push your changes to your forked repository. -Create a pull request from your forked repository to the main WarpSQL repository. -We welcome contributions from the community and appreciate your support in improving WarpSQL! +- Make your desired changes or additions. +- Test your changes and ensure they meet the project's guidelines. +- Commit and push your changes to your forked repository. +- Create a pull request from your forked repository to the main WarpSQL repository. +- We welcome contributions from the community and appreciate your support in improving WarpSQL! Install the project dependencies by running the following command in the terminal: From 17e07e604613f8745dff2ab468142ae5cecaa3b2 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Tue, 30 May 2023 11:31:47 +0530 Subject: [PATCH 063/104] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 5dbc27d9..004bde4e 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,6 @@ Click the "Open in Gitpod" button above or use the following link:[Open in Gitpo [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ChakshuGautam/postgres-tsdb-vector-docker) - - Wait for the Gitpod environment to be created and initialized. - Once the environment is ready, you can start working on the project. - Make your desired changes or additions. @@ -67,7 +66,7 @@ Click the "Open in Gitpod" button above or use the following link:[Open in Gitpo - Commit and push your changes to your forked repository. - Create a pull request from your forked repository to the main WarpSQL repository. -### Development with GitHub Codespaces +### GitHub Codespaces You can use GitHub Codespaces to develop this project in the cloud. @@ -92,7 +91,6 @@ Install the project dependencies by running the following command in the termina ### Ensure CI passes ![](https://img.shields.io/badge/CI-Passing-brightgreen) - Before merging any contributions or changes, it's essential to ensure that the continuous integration (CI) tests pass successfully. CI helps maintain code quality standards and prevents the introduction of regressions. To ensure a smooth integration process, follow these steps: - Make your desired changes or additions to the codebase. From d61f483f791a856a677c067a924b8da5b407d113 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Tue, 30 May 2023 11:32:52 +0530 Subject: [PATCH 064/104] Refactor readme. --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 004bde4e..2f368d2f 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,6 @@ Opinionated extensions to Postgres packaged as a single docker deployment. Why i Certified as Indie Hacker's best friend!!! -### Test on GitPod -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ChakshuGautam/postgres-tsdb-vector-docker) - - ### Current and future supported extensions - [x] [PgVector](https://github.com/pgvector/pgvector) From 957f097c20523ff08a3f382466c6ab0de8b369b4 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Tue, 30 May 2023 11:36:18 +0530 Subject: [PATCH 065/104] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 2f368d2f..a67f6c86 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@

WarpSQL

-
Opinionated extensions to Postgres packaged as a single docker deployment. Why install 10 DBs when you can have everything at once (maybe not everything). Certified as Indie Hacker's best friend!!! From 8029168e1e28e5edd5dc4c113d75a6c04bd0d71e Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Tue, 30 May 2023 11:41:45 +0530 Subject: [PATCH 066/104] Add Contributor's Block --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index a67f6c86..f289e3f3 100644 --- a/README.md +++ b/README.md @@ -96,3 +96,14 @@ Before merging any contributions or changes, it's essential to ensure that the c - If the CI build fails, review the error messages and make the necessary fixes. - Repeat steps 3-6 until the CI build passes successfully. - Once the CI build is successful, you can proceed with merging your changes into the main WarpSQL repository. + +## Contributors + + + + + + + + + From e05006d6b1655ab2f56e9e82da7fac979d43002d Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Tue, 30 May 2023 12:01:24 +0530 Subject: [PATCH 067/104] Add Jayanth as a Maintainer --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f289e3f3..08cf2534 100644 --- a/README.md +++ b/README.md @@ -97,12 +97,18 @@ Before merging any contributions or changes, it's essential to ensure that the c - Repeat steps 3-6 until the CI build passes successfully. - Once the CI build is successful, you can proceed with merging your changes into the main WarpSQL repository. -## Contributors +## Maintainers - + + + + + + +
Jayanth Kumar
Jayanth Kumar
💻
From 5faa6fcc26e7d6d2325c096f47ffeb145a2e2b65 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Tue, 30 May 2023 23:42:15 +0530 Subject: [PATCH 068/104] Fixes #7 Signed-off-by: Piyush Raj --- .github/workflows/smoke-test.yml | 6 ++++- Dockerfile | 28 +++++++++++++++++++++- Makefile | 3 ++- bitnami/Dockerfile | 29 +++++++++++++++++++++++ bitnami/Makefile | 4 ++-- bitnami/timescaledb-bitnami-entrypoint.sh | 4 ++-- 6 files changed, 67 insertions(+), 7 deletions(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index c831969c..5791a15a 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -73,7 +73,11 @@ jobs: psql -c "CREATE EXTENSION zombodb;" psql -c "SELECT * FROM pg_extension WHERE extname = 'zombodb';" - + + echo "Test pg_repack Extension" + psql -c "CREATE EXTENSION pg_repack;" + psql -c "select repack.version(), repack.version_sql();" + pg_repack --version break fi sleep 1 diff --git a/Dockerfile b/Dockerfile index aa1b9a1f..ad9518c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -256,4 +256,30 @@ RUN apk add --no-cache --virtual .zombodb-build-deps \ && cargo pgrx install --release \ && cd .. \ && rm -rf ./zombodb \ - && apk del .zombodb-build-deps \ No newline at end of file + && apk del .zombodb-build-deps + +## Adding pg_repack +ARG PG_REPACK_VERSION +RUN set -eux \ + && apk add --no-cache --virtual .pg_repack-build-deps \ + openssl-dev \ + zstd-dev \ + lz4-dev \ + zlib-dev \ + make \ + clang15 \ + # coreutils \ + gawk \ + llvm15 \ + gcc \ + musl-dev \ +# build pg_repack + && wget -O /tmp/pg_repack-${PG_REPACK_VERSION}.zip "https://api.pgxn.org/dist/pg_repack/${PG_REPACK_VERSION}/pg_repack-${PG_REPACK_VERSION}.zip" \ + && unzip /tmp/pg_repack-${PG_REPACK_VERSION}.zip -d /tmp \ + && cd /tmp/pg_repack-${PG_REPACK_VERSION} \ + && make \ + && make install \ +# clean + && cd / \ + && rm -rf /tmp/pg_repack-${PG_REPACK_VERSION} /tmp/pg_repack.zip \ + && apk del .pg_repack-build-deps \ No newline at end of file diff --git a/Makefile b/Makefile index 7c97a5a6..9285064b 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ ORG=samagragovernance PG_VER=pg15 CITUS_VERSION="11.2.0" POSTGIS_VERSION=3.3.2 +PG_REPACK_VERSION = 1.4.8 POSTGIS_SHA256=2a6858d1df06de1c5f85a5b780773e92f6ba3a5dc09ac31120ac895242f5a77b PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main @@ -57,7 +58,7 @@ default: image touch .build_$(TS_VERSION)_$(PG_VER)_oss .build_$(TS_VERSION)_$(PG_VER): Dockerfile - 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) . + 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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) . touch .build_$(TS_VERSION)_$(PG_VER) image: .build_$(TS_VERSION)_$(PG_VER) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index 79bbfa61..8a3b1d4c 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -141,6 +141,35 @@ RUN apt-get update \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ && rm -rf /var/lib/apt/lists/* +# ADD pg_repack Extention +ARG PG_REPACK_VERSION + +RUN apt-get update \ + && apt-get install -y unzip \ + build-essential \ + liblz4-dev \ + zlib1g-dev \ + libssl-dev \ + wget \ +# build pg_repack + && wget -O /tmp/pg_repack-${PG_REPACK_VERSION}.zip "https://api.pgxn.org/dist/pg_repack/${PG_REPACK_VERSION}/pg_repack-${PG_REPACK_VERSION}.zip" \ + && unzip /tmp/pg_repack-${PG_REPACK_VERSION}.zip -d /tmp \ + && cd /tmp/pg_repack-${PG_REPACK_VERSION} \ + && make \ + && make install \ +#clean + && apt-get autoremove --purge -y \ + unzip \ + build-essential \ + liblz4-dev \ + libssl-dev \ + zlib1g-dev \ + wget \ + && apt-get clean -y \ + && rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* # Install zombodb extension RUN apt-get update -y -qq --fix-missing \ diff --git a/bitnami/Makefile b/bitnami/Makefile index 6dab83ad..569c0116 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -7,7 +7,7 @@ CITUS_VERSION="11.2.0" POSTGIS_MAJOR=3 PG_MAJOR=15 POSTGIS_VERSION=3.3.2+dfsg-1.pgdg110+1 - +PG_REPACK_VERSION = 1.4.8 PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main @@ -26,7 +26,7 @@ default: image .build_$(TS_VERSION)_$(PG_VER): Dockerfile test -n "$(TS_VERSION)" # TS_VERSION test -n "$(PREV_TS_VERSION)" # PREV_TS_VERSION - docker build -f ./Dockerfile --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_MAJOR=$(POSTGIS_MAJOR) --build-arg PG_MAJOR=$(PG_MAJOR) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) $(TAG) .. + docker build -f ./Dockerfile --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_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) --build-arg PG_MAJOR=$(PG_MAJOR) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) $(TAG) .. touch .build_$(TS_VERSION)_$(PG_VER)-bitnami image: .build_$(TS_VERSION)_$(PG_VER) diff --git a/bitnami/timescaledb-bitnami-entrypoint.sh b/bitnami/timescaledb-bitnami-entrypoint.sh index 6c605e36..f4df80c2 100755 --- a/bitnami/timescaledb-bitnami-entrypoint.sh +++ b/bitnami/timescaledb-bitnami-entrypoint.sh @@ -4,9 +4,9 @@ # the shared preload list, or else it gets overwritten. if [ -z "$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" ] then - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb,pg_repack" else - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb,pg_repack,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" fi export POSTGRESQL_SHARED_PRELOAD_LIBRARIES From 1bc8cf702ab088d3a8d1e69d5351b9beedd66725 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Wed, 31 May 2023 01:06:52 +0530 Subject: [PATCH 069/104] remove comment Signed-off-by: Piyush Raj --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ad9518c9..6c052667 100644 --- a/Dockerfile +++ b/Dockerfile @@ -268,7 +268,6 @@ RUN set -eux \ zlib-dev \ make \ clang15 \ - # coreutils \ gawk \ llvm15 \ gcc \ From de9e6507a7e9a1c9de8fad60d8a8bc484c6e79c5 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Wed, 31 May 2023 10:59:25 +0530 Subject: [PATCH 070/104] Fix smoke test Signed-off-by: Piyush Raj --- .github/workflows/smoke-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 5791a15a..5825ad09 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -77,7 +77,7 @@ jobs: echo "Test pg_repack Extension" psql -c "CREATE EXTENSION pg_repack;" psql -c "select repack.version(), repack.version_sql();" - pg_repack --version + /usr/local/bin/pg_repack --version break fi sleep 1 From 8e5876d33d8efc21f55752c39893414ed5df7288 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Wed, 31 May 2023 11:06:18 +0530 Subject: [PATCH 071/104] Trigger Build From ca00ae2eae7784efc73d94ec3f4b5030f54d2f04 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Wed, 31 May 2023 12:43:11 +0530 Subject: [PATCH 072/104] fix test Signed-off-by: Piyush Raj --- .github/workflows/smoke-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 5825ad09..af3abfe8 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -77,7 +77,6 @@ jobs: echo "Test pg_repack Extension" psql -c "CREATE EXTENSION pg_repack;" psql -c "select repack.version(), repack.version_sql();" - /usr/local/bin/pg_repack --version break fi sleep 1 From 03dbb26f40b80ec5cc6d94c4b6b739e8d000a1a3 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Wed, 31 May 2023 19:34:38 +0530 Subject: [PATCH 073/104] fix zombodb test Signed-off-by: Piyush Raj --- .github/workflows/smoke-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index af3abfe8..322c5ce3 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -71,8 +71,9 @@ 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 zombodb Extension" psql -c "CREATE EXTENSION zombodb;" - psql -c "SELECT * FROM pg_extension WHERE extname = 'zombodb';" + psql -c "SELECT zdb.internal_version();" echo "Test pg_repack Extension" psql -c "CREATE EXTENSION pg_repack;" From f78570b1f178ffcdc6e76631fa10c13b9e7a877a Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Wed, 31 May 2023 23:34:38 +0530 Subject: [PATCH 074/104] Fix #8 Signed-off-by: Piyush Raj --- .github/workflows/smoke-test.yml | 4 +++ Dockerfile | 35 ++++++++++++++++++++++- Makefile | 3 +- bitnami/Dockerfile | 35 +++++++++++++++++++++++ bitnami/Makefile | 5 ++-- bitnami/timescaledb-bitnami-entrypoint.sh | 4 +-- 6 files changed, 80 insertions(+), 6 deletions(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index af3abfe8..dc502f55 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -77,6 +77,10 @@ jobs: echo "Test pg_repack Extension" psql -c "CREATE EXTENSION pg_repack;" psql -c "select repack.version(), repack.version_sql();" + + echo "Test pgautofailover Extension" + psql -c "CREATE EXTENSION pgautofailover CASCADE;" + psql -c "SELECT pgautofailover.formation_settings();" break fi sleep 1 diff --git a/Dockerfile b/Dockerfile index 6c052667..4ed11c02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -281,4 +281,37 @@ RUN set -eux \ # clean && cd / \ && rm -rf /tmp/pg_repack-${PG_REPACK_VERSION} /tmp/pg_repack.zip \ - && apk del .pg_repack-build-deps \ No newline at end of file + && apk del .pg_repack-build-deps + +# Adding pgautofailover +ARG PG_AUTO_FAILOVER_VERSION +RUN set -eux \ + && apk add --no-cache --virtual .pg_auto_failover-build-deps \ + make \ + gcc \ + musl-dev \ + krb5-dev \ + openssl-dev \ + clang15 \ + ncurses-dev \ + linux-headers \ + zstd-dev \ + lz4-dev \ + zlib-dev \ + libedit-dev \ + libxml2-utils \ + libxslt-dev \ + llvm15 \ +# build pg_auto_failover + && wget -O /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION}.zip "https://github.com/hapostgres/pg_auto_failover/archive/refs/tags/v${PG_AUTO_FAILOVER_VERSION}.zip" \ + && unzip /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION}.zip -d /tmp \ + && ls -alh /tmp \ + && cd /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION} \ + && make \ + && make install \ + && sed -i "s/\(shared_preload_libraries = '[^']*\)/\1,pgautofailover/" /usr/local/share/postgresql/postgresql.conf.sample \ + +# clean + && cd / \ + && rm -rf /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION} /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION}.zip \ + && apk del .pg_auto_failover-build-deps \ No newline at end of file diff --git a/Makefile b/Makefile index 9285064b..26f8f274 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ PG_VER=pg15 CITUS_VERSION="11.2.0" POSTGIS_VERSION=3.3.2 PG_REPACK_VERSION = 1.4.8 +PG_AUTO_FAILOVER_VERSION = 2.0 POSTGIS_SHA256=2a6858d1df06de1c5f85a5b780773e92f6ba3a5dc09ac31120ac895242f5a77b PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main @@ -58,7 +59,7 @@ default: image touch .build_$(TS_VERSION)_$(PG_VER)_oss .build_$(TS_VERSION)_$(PG_VER): Dockerfile - 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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) . + 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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) . touch .build_$(TS_VERSION)_$(PG_VER) image: .build_$(TS_VERSION)_$(PG_VER) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index 8a3b1d4c..6b17bd4f 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -171,6 +171,41 @@ RUN apt-get update \ /tmp/* \ /var/tmp/* +# Adding pgautofailover +ARG PG_AUTO_FAILOVER_VERSION +RUN apt-get update \ + && apt-get install -y unzip \ + build-essential \ + liblz4-dev \ + zlib1g-dev \ + libedit-dev \ + libssl-dev \ + wget \ +# build pg_auto_failover + && wget -O /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION}.zip "https://github.com/hapostgres/pg_auto_failover/archive/refs/tags/v${PG_AUTO_FAILOVER_VERSION}.zip" \ + && unzip /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION}.zip -d /tmp \ + && ls -alh /tmp \ + && cd /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION} \ + && make \ + && make install \ + +# clean + && cd / \ + && rm -rf /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION} /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION}.zip \ + && apt-get autoremove --purge -y \ + unzip \ + build-essential \ + liblz4-dev \ + zlib1g-dev \ + libedit-dev \ + libssl-dev \ + wget \ + && apt-get clean -y \ + && rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* + # Install zombodb extension RUN apt-get update -y -qq --fix-missing \ && apt-get install -y wget gnupg \ diff --git a/bitnami/Makefile b/bitnami/Makefile index 569c0116..682f605a 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -6,8 +6,9 @@ PG_VER=pg15 CITUS_VERSION="11.2.0" POSTGIS_MAJOR=3 PG_MAJOR=15 -POSTGIS_VERSION=3.3.2+dfsg-1.pgdg110+1 +POSTGIS_VERSION=3.3.3+dfsg-1~exp1.pgdg110+1 PG_REPACK_VERSION = 1.4.8 +PG_AUTO_FAILOVER_VERSION = 2.0 PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main @@ -26,7 +27,7 @@ default: image .build_$(TS_VERSION)_$(PG_VER): Dockerfile test -n "$(TS_VERSION)" # TS_VERSION test -n "$(PREV_TS_VERSION)" # PREV_TS_VERSION - docker build -f ./Dockerfile --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_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) --build-arg PG_MAJOR=$(PG_MAJOR) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) $(TAG) .. + docker build -f ./Dockerfile --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_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) --build-arg PG_MAJOR=$(PG_MAJOR) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) $(TAG) .. touch .build_$(TS_VERSION)_$(PG_VER)-bitnami image: .build_$(TS_VERSION)_$(PG_VER) diff --git a/bitnami/timescaledb-bitnami-entrypoint.sh b/bitnami/timescaledb-bitnami-entrypoint.sh index f4df80c2..50f515bc 100755 --- a/bitnami/timescaledb-bitnami-entrypoint.sh +++ b/bitnami/timescaledb-bitnami-entrypoint.sh @@ -4,9 +4,9 @@ # the shared preload list, or else it gets overwritten. if [ -z "$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" ] then - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb,pg_repack" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb,pg_repack,pgautofailover" else - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb,pg_repack,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb,pg_repack,pgautofailover,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" fi export POSTGRESQL_SHARED_PRELOAD_LIBRARIES From 672a33e4684ce3c4ab8cfd0a364b7ebb8f4c5437 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Wed, 31 May 2023 23:38:13 +0530 Subject: [PATCH 075/104] updated postgis Signed-off-by: Piyush Raj --- bitnami/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitnami/Makefile b/bitnami/Makefile index 569c0116..448650ce 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -6,7 +6,7 @@ PG_VER=pg15 CITUS_VERSION="11.2.0" POSTGIS_MAJOR=3 PG_MAJOR=15 -POSTGIS_VERSION=3.3.2+dfsg-1.pgdg110+1 +POSTGIS_VERSION=3.3.3+dfsg-1~exp1.pgdg110+1 PG_REPACK_VERSION = 1.4.8 PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) From b360c8b80cca5f6e8f5234e724334396e7816409 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Thu, 1 Jun 2023 00:19:40 +0530 Subject: [PATCH 076/104] removed newline Signed-off-by: Piyush Raj --- bitnami/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index 6b17bd4f..1fefe56e 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -188,7 +188,6 @@ RUN apt-get update \ && cd /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION} \ && make \ && make install \ - # clean && cd / \ && rm -rf /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION} /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION}.zip \ From 4be1b0f310ae3b13b92acd82bef5b6ddeca87802 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Thu, 1 Jun 2023 13:50:07 +0530 Subject: [PATCH 077/104] minor fix Signed-off-by: Piyush Raj --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4ed11c02..255cffcd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,7 +74,7 @@ RUN set -ex \ && sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample # Update to shared_preload_libraries -RUN echo "shared_preload_libraries = 'citus,timescaledb,pg_stat_statements'" >> /usr/local/share/postgresql/postgresql.conf.sample +RUN echo "shared_preload_libraries = 'citus,timescaledb,pg_stat_statements,pgautofailover'" >> /usr/local/share/postgresql/postgresql.conf.sample # Adding PG Vector @@ -309,8 +309,6 @@ RUN set -eux \ && cd /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION} \ && make \ && make install \ - && sed -i "s/\(shared_preload_libraries = '[^']*\)/\1,pgautofailover/" /usr/local/share/postgresql/postgresql.conf.sample \ - # clean && cd / \ && rm -rf /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION} /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION}.zip \ From 7d7a0c597a45dc86275498a980ec2fec50db67aa Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Thu, 1 Jun 2023 22:44:26 +0530 Subject: [PATCH 078/104] add hyperloglog Signed-off-by: Piyush Raj --- .github/workflows/smoke-test.yml | 4 +++ Dockerfile | 28 ++++++++++++++++++- Makefile | 3 ++- bitnami/Dockerfile | 33 +++++++++++++++++++++++ bitnami/Makefile | 3 ++- bitnami/timescaledb-bitnami-entrypoint.sh | 4 +-- 6 files changed, 70 insertions(+), 5 deletions(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index dc502f55..6a4e41ae 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -81,6 +81,10 @@ jobs: echo "Test pgautofailover Extension" psql -c "CREATE EXTENSION pgautofailover CASCADE;" psql -c "SELECT pgautofailover.formation_settings();" + + echo "Test HyperLogLog Extension" + psql -c "CREATE EXTENSION hll;" + psql -c "select hll_hash_text('hello world');" break fi sleep 1 diff --git a/Dockerfile b/Dockerfile index 255cffcd..62d96295 100644 --- a/Dockerfile +++ b/Dockerfile @@ -312,4 +312,30 @@ RUN set -eux \ # clean && cd / \ && rm -rf /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION} /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION}.zip \ - && apk del .pg_auto_failover-build-deps \ No newline at end of file + && apk del .pg_auto_failover-build-deps + +## Adding postgresql-hll +ARG POSTGRES_HLL_VERSION +RUN set -eux \ + && apk add --no-cache --virtual .postgresql-hll-build-deps \ + openssl-dev \ + zstd-dev \ + lz4-dev \ + zlib-dev \ + make \ + git \ + clang15 \ + gawk \ + llvm15 \ + g++ \ + musl-dev \ +# build postgresql-hll + && wget -O /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip "https://github.com/citusdata/postgresql-hll/archive/refs/tags/v${POSTGRES_HLL_VERSION}.zip" \ + && unzip /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip -d /tmp \ + && cd /tmp/postgresql-hll-${POSTGRES_HLL_VERSION} \ + && make \ + && make install \ +# clean + && cd / \ + && rm -rf /tmp/postgresql-hll-${POSTGRES_HLL_VERSION} /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip \ + && apk del .postgresql-hll-build-deps \ No newline at end of file diff --git a/Makefile b/Makefile index 26f8f274..f98d6ac4 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ CITUS_VERSION="11.2.0" POSTGIS_VERSION=3.3.2 PG_REPACK_VERSION = 1.4.8 PG_AUTO_FAILOVER_VERSION = 2.0 +POSTGRES_HLL_VERSION = 2.17 POSTGIS_SHA256=2a6858d1df06de1c5f85a5b780773e92f6ba3a5dc09ac31120ac895242f5a77b PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main @@ -59,7 +60,7 @@ default: image touch .build_$(TS_VERSION)_$(PG_VER)_oss .build_$(TS_VERSION)_$(PG_VER): Dockerfile - 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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) . + 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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) . touch .build_$(TS_VERSION)_$(PG_VER) image: .build_$(TS_VERSION)_$(PG_VER) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index 1fefe56e..9a51a2c2 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -205,6 +205,39 @@ RUN apt-get update \ /tmp/* \ /var/tmp/* +## Adding postgresql-hll +ARG POSTGRES_HLL_VERSION +RUN apt-get update \ + && apt-get install -y unzip \ + build-essential \ + liblz4-dev \ + zlib1g-dev \ + libedit-dev \ + libssl-dev \ + wget \ +# build postgresql-hll + && wget -O /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip "https://github.com/citusdata/postgresql-hll/archive/refs/tags/v${POSTGRES_HLL_VERSION}.zip" \ + && unzip /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip -d /tmp \ + && cd /tmp/postgresql-hll-${POSTGRES_HLL_VERSION} \ + && make \ + && make install \ +# clean + && cd / \ + && rm -rf /tmp/postgresql-hll-${POSTGRES_HLL_VERSION} /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip \ + && apt-get autoremove --purge -y \ + unzip \ + build-essential \ + liblz4-dev \ + zlib1g-dev \ + libedit-dev \ + libssl-dev \ + wget \ + && apt-get clean -y \ + && rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* + # Install zombodb extension RUN apt-get update -y -qq --fix-missing \ && apt-get install -y wget gnupg \ diff --git a/bitnami/Makefile b/bitnami/Makefile index 682f605a..45ca4c84 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -9,6 +9,7 @@ PG_MAJOR=15 POSTGIS_VERSION=3.3.3+dfsg-1~exp1.pgdg110+1 PG_REPACK_VERSION = 1.4.8 PG_AUTO_FAILOVER_VERSION = 2.0 +POSTGRES_HLL_VERSION = 2.17 PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) TS_VERSION=main @@ -27,7 +28,7 @@ default: image .build_$(TS_VERSION)_$(PG_VER): Dockerfile test -n "$(TS_VERSION)" # TS_VERSION test -n "$(PREV_TS_VERSION)" # PREV_TS_VERSION - docker build -f ./Dockerfile --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_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) --build-arg PG_MAJOR=$(PG_MAJOR) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) $(TAG) .. + docker build -f ./Dockerfile --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_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION) --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) --build-arg PG_MAJOR=$(PG_MAJOR) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) $(TAG) .. touch .build_$(TS_VERSION)_$(PG_VER)-bitnami image: .build_$(TS_VERSION)_$(PG_VER) diff --git a/bitnami/timescaledb-bitnami-entrypoint.sh b/bitnami/timescaledb-bitnami-entrypoint.sh index 50f515bc..346453a4 100755 --- a/bitnami/timescaledb-bitnami-entrypoint.sh +++ b/bitnami/timescaledb-bitnami-entrypoint.sh @@ -4,9 +4,9 @@ # the shared preload list, or else it gets overwritten. if [ -z "$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" ] then - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb,pg_repack,pgautofailover" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb,pg_repack,pgautofailover,hll" else - POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb,pg_repack,pgautofailover,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="citus,timescaledb,zombodb,pg_repack,pgautofailover,hll,$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" fi export POSTGRESQL_SHARED_PRELOAD_LIBRARIES From d90566811ae7cd4feaae331dc898e43010af68db Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Tue, 6 Jun 2023 18:48:31 +0530 Subject: [PATCH 079/104] add docker cache to action Signed-off-by: Piyush Raj --- .github/workflows/smoke-test.yml | 5 ++++- Makefile | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index dc502f55..65ad48fd 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -23,13 +23,16 @@ jobs: - name: Check out the source uses: actions/checkout@v3 + - name: Expose GitHub Runtime + uses: crazy-max/ghaction-github-runtime@v2 + - name: Build Docker Image for TimescaleDB run: | if [ ${{ matrix.type }} == bitnami ] then cd bitnami fi - make image PG_VER=pg${{ matrix.pg }} TAG_VERSION=smoketest-image BETA=1 + make build-docker-cache image PG_VER=pg${{ matrix.pg }} TAG_VERSION=smoketest-image BETA=1 - name: Install psql run: sudo apt install postgresql-client diff --git a/Makefile b/Makefile index 26f8f274..119c98da 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,11 @@ default: image 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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) . touch .build_$(TS_VERSION)_$(PG_VER) +build-docker-cache: Dockerfile + docker buildx create --use --driver=docker-container + docker buildx build --progress=plain --load --cache-to "type=gha,mode=max" --cache-from type=gha --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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) . + touch .build_$(TS_VERSION)_$(PG_VER) + image: .build_$(TS_VERSION)_$(PG_VER) oss: .build_$(TS_VERSION)_$(PG_VER)_oss @@ -88,4 +93,4 @@ clean: rm -f *~ .build_* .multi_* -docker buildx rm multibuild -.PHONY: default image push push-oss oss multi multi-oss clean all +.PHONY: default image push push-oss oss multi multi-oss clean all build-docker-cache From e381000f9af7b57fe78dbb0852c8c4287a5e11c4 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Tue, 6 Jun 2023 18:57:55 +0530 Subject: [PATCH 080/104] add bitnami makefile Signed-off-by: Piyush Raj --- bitnami/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bitnami/Makefile b/bitnami/Makefile index 682f605a..c183c5b3 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -30,6 +30,10 @@ default: image docker build -f ./Dockerfile --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_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) --build-arg PG_MAJOR=$(PG_MAJOR) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) $(TAG) .. touch .build_$(TS_VERSION)_$(PG_VER)-bitnami +build-docker-cache: Dockerfile + docker buildx create --use --driver=docker-container + docker buildx build --progress=plain --load --cache-to "type=gha,mode=max" --cache-from type=gha --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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) . + touch .build_$(TS_VERSION)_$(PG_VER) image: .build_$(TS_VERSION)_$(PG_VER) push: image @@ -41,4 +45,4 @@ push: image clean: rm -f *~ .build_* -.PHONY: default image push clean +.PHONY: default image push clean build-docker-cache From b2218aa2bb54d76547fb673fdbbb69a1f952fb0c Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Tue, 6 Jun 2023 19:04:43 +0530 Subject: [PATCH 081/104] fix bitnami Signed-off-by: Piyush Raj --- bitnami/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitnami/Makefile b/bitnami/Makefile index c183c5b3..458e3afc 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -32,7 +32,7 @@ default: image build-docker-cache: Dockerfile docker buildx create --use --driver=docker-container - docker buildx build --progress=plain --load --cache-to "type=gha,mode=max" --cache-from type=gha --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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) . + docker buildx build -f ./Dockerfile --progress=plain --load --cache-to "type=gha,mode=max" --cache-from type=gha --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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) .. touch .build_$(TS_VERSION)_$(PG_VER) image: .build_$(TS_VERSION)_$(PG_VER) From 5c4ae12edeea7bd3024bb8e10e5558b19f44ac58 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Tue, 6 Jun 2023 23:12:58 +0530 Subject: [PATCH 082/104] fix version Signed-off-by: Piyush Raj --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 255cffcd..573f4283 100644 --- a/Dockerfile +++ b/Dockerfile @@ -142,7 +142,7 @@ RUN set -eux \ set -eux ; \ export GEOS_ALPINE_VER=3.11 ; \ export GDAL_ALPINE_VER=3.6.4-r4 ; \ - export PROJ_ALPINE_VER=9.2.0-r0 ; \ + export PROJ_ALPINE_VER=9.2 ; \ elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ set -eux ; \ export GEOS_ALPINE_VER=3.8 ; \ From 7828bcd7625108be87e19abc8bb5e37e89076db7 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Tue, 6 Jun 2023 23:18:52 +0530 Subject: [PATCH 083/104] fix build-arg Signed-off-by: Piyush Raj --- bitnami/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitnami/Makefile b/bitnami/Makefile index 458e3afc..8c63fd61 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -32,7 +32,7 @@ default: image build-docker-cache: Dockerfile docker buildx create --use --driver=docker-container - docker buildx build -f ./Dockerfile --progress=plain --load --cache-to "type=gha,mode=max" --cache-from type=gha --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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) .. + docker buildx build -f ./Dockerfile --progress=plain --load --cache-to "type=gha,mode=max" --cache-from type=gha --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_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) --build-arg PG_MAJOR=$(PG_MAJOR) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) $(TAG) .. touch .build_$(TS_VERSION)_$(PG_VER) image: .build_$(TS_VERSION)_$(PG_VER) From 1d8ea20954c48bc0b6102eb24531bea3717bfe45 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Fri, 9 Jun 2023 12:53:36 +0530 Subject: [PATCH 084/104] Update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 08cf2534..b0bb0ae9 100644 --- a/README.md +++ b/README.md @@ -80,10 +80,6 @@ Once the environment is ready, you can start working on the project. - Create a pull request from your forked repository to the main WarpSQL repository. - We welcome contributions from the community and appreciate your support in improving WarpSQL! -Install the project dependencies by running the following command in the terminal: - -```pip install -r requirements.txt``` - ### Ensure CI passes ![](https://img.shields.io/badge/CI-Passing-brightgreen) Before merging any contributions or changes, it's essential to ensure that the continuous integration (CI) tests pass successfully. CI helps maintain code quality standards and prevents the introduction of regressions. To ensure a smooth integration process, follow these steps: From 4e2df541994c5f4dccae90efe8a0994fbe184d5b Mon Sep 17 00:00:00 2001 From: Amrittttt <105008027+Amrittttt@users.noreply.github.com> Date: Fri, 9 Jun 2023 13:20:29 +0530 Subject: [PATCH 085/104] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b0bb0ae9..b9df2bcb 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Bootstrapped from [TimescaleDB](https://github.com/timescale/timescaledb-docker) ### Usage with Compose -```yaml +```yam version: '3.6' services: warpsql: From 6c2193242aac5536a268f35c60cb03633e7dc084 Mon Sep 17 00:00:00 2001 From: Pradyot Ranjan <99216956+prady0t@users.noreply.github.com> Date: Fri, 9 Jun 2023 23:35:56 +0530 Subject: [PATCH 086/104] Update Dockerfile --- bitnami/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index 1fefe56e..a9a93914 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -234,7 +234,7 @@ RUN apt-get update -y -qq --fix-missing \ && export PATH="/.cargo/bin:$PATH" \ && export PGRX_HOME="/.pgrx/" \ && mkdir -p $PGRX_HOME \ - && cargo install cargo-pgrx --version 0.8.3 \ + && cargo install cargo-pgrx --version 0.9.3 \ && cargo pgrx init --pg${PG_MAJOR}=/opt/bitnami/postgresql/bin/pg_config \ && git clone https://github.com/zombodb/zombodb.git \ && cd zombodb \ From 5996df3d363248cfe93b76ed8a9215d6857a8e07 Mon Sep 17 00:00:00 2001 From: Pradyot Ranjan <99216956+prady0t@users.noreply.github.com> Date: Fri, 9 Jun 2023 23:36:39 +0530 Subject: [PATCH 087/104] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 573f4283..5e01bf7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -249,7 +249,7 @@ RUN apk add --no-cache --virtual .zombodb-build-deps \ && gem install --no-document fpm \ && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \ && PATH=$HOME/.cargo/bin:$PATH \ - && cargo install cargo-pgrx --version 0.8.3 \ + && cargo install cargo-pgrx --version 0.9.3 \ && cargo pgrx init --${PG_VER}=$(which pg_config) \ && git clone https://github.com/zombodb/zombodb.git \ && cd ./zombodb \ @@ -312,4 +312,4 @@ RUN set -eux \ # clean && cd / \ && rm -rf /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION} /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION}.zip \ - && apk del .pg_auto_failover-build-deps \ No newline at end of file + && apk del .pg_auto_failover-build-deps From c8edb581405fae3db761f4cebf16652fd5322493 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Sun, 11 Jun 2023 16:10:38 +0530 Subject: [PATCH 088/104] add DOCKER_BUILD_ARGS Signed-off-by: Piyush Raj --- Makefile | 15 +++++++++++++-- bitnami/Makefile | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 119c98da..c960aea1 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,17 @@ TAG_LATEST=$(ORG)/$(NAME):latest-$(PG_VER) TAG=-t $(TAG_VERSION) $(if $(BETA),,-t $(TAG_LATEST)) TAG_OSS=-t $(TAG_VERSION)-oss $(if $(BETA),,-t $(TAG_LATEST)-oss) +DOCKER_BUILD_ARGS = --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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) \ + --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ + --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \ + --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ + --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) + default: image .multi_$(TS_VERSION)_$(PG_VER)_oss: Dockerfile @@ -59,12 +70,12 @@ default: image touch .build_$(TS_VERSION)_$(PG_VER)_oss .build_$(TS_VERSION)_$(PG_VER): Dockerfile - 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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) . + docker build $(DOCKER_BUILD_ARGS) $(TAG) . touch .build_$(TS_VERSION)_$(PG_VER) build-docker-cache: Dockerfile docker buildx create --use --driver=docker-container - docker buildx build --progress=plain --load --cache-to "type=gha,mode=max" --cache-from type=gha --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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) $(TAG) . + docker buildx build --progress=plain --load --cache-to "type=gha,mode=max" --cache-from type=gha $(DOCKER_BUILD_ARGS) $(TAG) . touch .build_$(TS_VERSION)_$(PG_VER) image: .build_$(TS_VERSION)_$(PG_VER) diff --git a/bitnami/Makefile b/bitnami/Makefile index 8c63fd61..3a29e7da 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -22,17 +22,27 @@ TAG_VERSION=$(ORG)/$(NAME):$(TS_VERSION)-$(PG_VER)-bitnami TAG_LATEST=$(ORG)/$(NAME):latest-$(PG_VER)-bitnami TAG=-t $(TAG_VERSION) $(if $(BETA),,-t $(TAG_LATEST)) +DOCKER_BUILD_ARGS = --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_REPACK_VERSION=$(PG_REPACK_VERSION) \ + --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \ + --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) \ + --build-arg PG_MAJOR=$(PG_MAJOR) \ + --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) + default: image .build_$(TS_VERSION)_$(PG_VER): Dockerfile test -n "$(TS_VERSION)" # TS_VERSION test -n "$(PREV_TS_VERSION)" # PREV_TS_VERSION - docker build -f ./Dockerfile --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_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) --build-arg PG_MAJOR=$(PG_MAJOR) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) $(TAG) .. + docker build -f ./Dockerfile $(DOCKER_BUILD_ARGS) $(TAG) .. touch .build_$(TS_VERSION)_$(PG_VER)-bitnami build-docker-cache: Dockerfile docker buildx create --use --driver=docker-container - docker buildx build -f ./Dockerfile --progress=plain --load --cache-to "type=gha,mode=max" --cache-from type=gha --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_REPACK_VERSION=$(PG_REPACK_VERSION) --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) --build-arg PG_MAJOR=$(PG_MAJOR) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) $(TAG) .. + docker buildx build -f ./Dockerfile --progress=plain --load --cache-to "type=gha,mode=max" --cache-from type=gha $(DOCKER_BUILD_ARGS) $(TAG) .. touch .build_$(TS_VERSION)_$(PG_VER) image: .build_$(TS_VERSION)_$(PG_VER) From 31a9613d7ac45ced30c3bf88c56f007166c972ac Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Sun, 11 Jun 2023 16:41:46 +0530 Subject: [PATCH 089/104] remove whitespace Signed-off-by: Piyush Raj --- Makefile | 20 ++++++++++---------- bitnami/Makefile | 18 +++++++++--------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 1fc09535..181317ff 100644 --- a/Makefile +++ b/Makefile @@ -26,16 +26,16 @@ TAG=-t $(TAG_VERSION) $(if $(BETA),,-t $(TAG_LATEST)) TAG_OSS=-t $(TAG_VERSION)-oss $(if $(BETA),,-t $(TAG_LATEST)-oss) DOCKER_BUILD_ARGS = --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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) \ - --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ - --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \ - --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ - --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) \ - --build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION) + --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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) \ + --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ + --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \ + --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ + --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) \ + --build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION) default: image diff --git a/bitnami/Makefile b/bitnami/Makefile index 194e19e9..23737ba4 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -24,15 +24,15 @@ TAG_LATEST=$(ORG)/$(NAME):latest-$(PG_VER)-bitnami TAG=-t $(TAG_VERSION) $(if $(BETA),,-t $(TAG_LATEST)) DOCKER_BUILD_ARGS = --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_REPACK_VERSION=$(PG_REPACK_VERSION) \ - --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \ - --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) \ - --build-arg PG_MAJOR=$(PG_MAJOR) \ - --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ - --build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION) + --build-arg TS_VERSION=$(TS_VERSION) \ + --build-arg PREV_IMAGE=$(PREV_IMAGE) \ + --build-arg CITUS_VERSION=$(CITUS_VERSION) \ + --build-arg PG_REPACK_VERSION=$(PG_REPACK_VERSION) \ + --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \ + --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) \ + --build-arg PG_MAJOR=$(PG_MAJOR) \ + --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ + --build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION) default: image From 32bc2a3ebef27532561270417ee49b62ce9a1982 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Fri, 16 Jun 2023 12:44:54 +0530 Subject: [PATCH 090/104] Create c4gt.md template --- .github/ISSUE_TEMPLATE /c4gt.md | 96 +++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE /c4gt.md diff --git a/.github/ISSUE_TEMPLATE /c4gt.md b/.github/ISSUE_TEMPLATE /c4gt.md new file mode 100644 index 00000000..e3cbd23d --- /dev/null +++ b/.github/ISSUE_TEMPLATE /c4gt.md @@ -0,0 +1,96 @@ +--- +name: C4GT +about: C4GT Community Issues Template +title: "[C4GT] Button for likes" +labels: C4GT Community +assignees: '' + +--- + +## Description +[Provide a brief description of the feature, including why it is needed and what it will accomplish. You can skip any of Goals, Expected Outcome, Implementation Details, Mockups / Wireframes if they are irrelevant] + +## Goals +- [ ] [Goal 1] +- [ ] [Goal 2] +- [ ] [Goal 3] +- [ ] [Goal 4] +- [ ] [Goal 5] + +## Expected Outcome +[Describe in detail what the final product or result should look like and how it should behave.] + +## Acceptance Criteria +- [ ] [Criteria 1] +- [ ] [Criteria 2] +- [ ] [Criteria 3] +- [ ] [Criteria 4] +- [ ] [Criteria 5] + +## Implementation Details +[List any technical details about the proposed implementation, including any specific technologies that will be used.] + +## Mockups / Wireframes +[Include links to any visual aids, mockups, wireframes, or diagrams that help illustrate what the final product should look like. This is not always necessary, but can be very helpful in many cases.] + +--- + +### Project +[Project Name] + +### Organization Name: +[Organization Name] + +### Domain +[Area of governance] + + + +### Tech Skills Needed: +[Required technical skills for the project] + +### Mentor(s) +[@Mentor1] [@Mentor2] [@Mentor3] + +### Complexity +Pick one of [High]/[Medium]/[Low] + +### Category +Pick one or more of [CI/CD], [Integrations], [Performance Improvement], [Security], [UI/UX/Design], [Bug], [Feature], [Documentation], [Deployment], [Test], [PoC] + +### Sub Category +Pick one or more of [API], [Database], [Analytics], [Refactoring], [Data Science], [Machine Learning], [Accessibility], [Internationalization], [Localization], [Frontend], [Backend], [Mobile], [SEO], [Configuration], [Deprecation], [Breaking Change], [Maintenance], [Support], [Question], [Technical Debt], [Beginner friendly], [Research], [Reproducible], [Needs Reproduction]. From 44b5ed4fc8e0f0065ddc84a5c494882ae5abf344 Mon Sep 17 00:00:00 2001 From: Chakshu Gautam Date: Fri, 16 Jun 2023 14:21:36 +0530 Subject: [PATCH 091/104] Update issue templates --- .../ISSUE_TEMPLATE/c4gt-community-ticket.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/c4gt-community-ticket.md diff --git a/.github/ISSUE_TEMPLATE/c4gt-community-ticket.md b/.github/ISSUE_TEMPLATE/c4gt-community-ticket.md new file mode 100644 index 00000000..2b9a3fce --- /dev/null +++ b/.github/ISSUE_TEMPLATE/c4gt-community-ticket.md @@ -0,0 +1,58 @@ +--- +name: C4GT Community Ticket +about: C4GT Community Ticket +title: C4GT +labels: C4GT Community +assignees: '' + +--- + +## Description +There is a need for a commenting system that will allow users to interact with the blog posts. This will increase user engagement and provide feedback to the blog authors. + +## Goals +- [ ] Add a comment section to each blog post +- [ ] Implement a moderation system for comments +- [ ] Ensure comments are tied to a registered user +- [ ] Implement spam and bot protection for the comments +- [ ] Add notification system for new comments + +## Expected Outcome +- Users must be registered and logged in to leave a comment. +- Each comment should include the user's name, profile picture (if available), comment text, and timestamp. +- Comments should be displayed in chronological order, with the most recent comment at the top. +- An email notification should be sent to the blog post author when a new comment is made. +- Blog post authors and administrators should be able to moderate comments (approve, deny, delete). + +## Acceptance Criteria +- [ ] A registered user can submit a comment on a blog post. +- [ ] The comment appears on the blog post after approval from the post author or administrator. +- [ ] An email notification is sent to the blog post author when a new comment is posted. +- [ ] Comments can be moderated by the blog post author and administrators. +- [ ] Commenting system is resistant to spam and bot attacks. + +## Implementation Details +- Leverage Django's built-in commenting framework (if applicable) +- Use JavaScript and AJAX for real-time comment posting and updates +- Consider integrating with a service like Akismet for spam protection +- Use Django's built-in email function for the notification system + +## Mockups / Wireframes +(Here, you can link to any visual aids, mockups, wireframes, or diagrams that help illustrate what the final product should look like. This is not always necessary, but can be very helpful in many cases.) + +--- + +### Project +OpenBlog Platform + +### Organization Name: +The name of the organization proposing the project. + +### Domain +The area of governance the project pertains to (ex: agri, healthcare, ed etc). + +### Tech Skills Needed: +Django, Typescript, NextJS, Akismet + +### Mentor(s) +@ChakshuGautam @Shruti3004 @sukhpreetssekhon From 34fd036bffe1682d8579f21abc865fb6bec2d855 Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Wed, 14 Jun 2023 01:06:37 +0530 Subject: [PATCH 092/104] warpsql/gh_pages: Add website for documentation 1. Using docsify to create static website. Steps to run website locally 1. npm i docsify-cli -g 2. docsify serve . Fixes: #67 Date: Wed Jun 14 01:06:37 2023 +0530 --- index.html | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 00000000..025c6201 --- /dev/null +++ b/index.html @@ -0,0 +1,32 @@ + + + + + WarpSQL + + + + + + + +
+ + + + + + + + + + + + + From 32a52ed46f20fff7251ee24b3a602938c8b4fad1 Mon Sep 17 00:00:00 2001 From: Jayanth Kumar Date: Tue, 13 Jun 2023 14:40:48 +0530 Subject: [PATCH 093/104] warpsql/docker-compose: Added pgwatch2 service 1. Added pgwatch2 service to the Docker Compose file. 2. Configured pgwatch2 to use the cybertec/pgwatch2-postgres:latest image. 3. Exposed port 3000 for the pgwatch2 service. 4. Set up PW2_ADHOC_CONN_STR environment variable for pgwatch2 to connect to the timescaledb service. 5. Configured pgwatch2 to restart automatically in case of failure. 6. Added timescaledb as a dependency for pgwatch2 to ensure timescaledb starts before pgwatch2. Fixes: #52 --- docker-compose.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 2141a4f6..f11ce7cd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,3 +33,13 @@ services: # HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey HASURA_GRAPHQL_MIGRATIONS_DISABLE_TRANSACTION: "true" HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: /srv/console-assets + + pgwatch2: + image: cybertec/pgwatch2-postgres:latest + ports: + - "3000:3000" + environment: + PW2_ADHOC_CONN_STR: "postgresql://timescaledb:postgrespassword@timescaledb:5432/postgres?sslmode=disable" + depends_on: + - "timescaledb" + restart: always From d9e6c46fe366e2e8411b77e73d406698d5128385 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Wed, 21 Jun 2023 13:36:52 +0530 Subject: [PATCH 094/104] add pgvector --- bitnami/Dockerfile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index f1c1aacf..a25cb3c2 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -123,7 +123,21 @@ RUN set -ex \ /var/lib/apt/lists/* \ /tmp/* \ /var/tmp/* - + +# Add PG vector +RUN apt-get update \ + && cd /tmp \ + && apt-get install -y --no-install-recommends build-essential git \ + && git clone --branch v0.4.4 https://github.com/pgvector/pgvector.git /tmp/pgvector \ + && cd /tmp/pgvector \ + && make clean \ + && make OPTFLAGS="" \ + && make install \ + && rm -r /tmp/pgvector \ + && apt-get remove -y build-essential git \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* + # Add PostGIS Extension ARG POSTGIS_MAJOR ARG PG_MAJOR From c7999e34458502dee1ded8073e8af96b68018edf Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Wed, 21 Jun 2023 13:43:17 +0530 Subject: [PATCH 095/104] add concurrency --- .github/workflows/smoke-test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 6ca64f0d..247eb402 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -1,4 +1,9 @@ name: Smoke Test Docker Image + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: pull_request: push: From b89516d892be8446cf02e5427602172bc7e83b38 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Mon, 26 Jun 2023 12:32:44 +0530 Subject: [PATCH 096/104] build postgis from source --- bitnami/Dockerfile | 71 ++++++++++++++++++++++++++++++++++------------ bitnami/Makefile | 4 ++- 2 files changed, 56 insertions(+), 19 deletions(-) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index f1c1aacf..aa1f80ab 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -125,26 +125,64 @@ RUN set -ex \ /var/tmp/* # Add PostGIS Extension -ARG POSTGIS_MAJOR -ARG PG_MAJOR ARG POSTGIS_VERSION +ARG POSTGIS_SHA256 + +RUN set -eux \ + && apt update \ + && apt install -y \ + ca-certificates \ + openssl \ + tar \ + wget \ + gettext \ + automake \ + libltdl-dev \ + libxml2-dev \ + libgeos-dev \ + libproj-dev \ + libprotobuf-c-dev \ + protobuf-c-compiler \ + g++\ + gcc \ + make \ + && wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/${POSTGIS_VERSION}.tar.gz" \ + && echo "${POSTGIS_SHA256} *postgis.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/postgis \ + && tar \ + --extract \ + --file postgis.tar.gz \ + --directory /usr/src/postgis \ + --strip-components 1 \ + && rm postgis.tar.gz \ + \ +# build PostGIS + \ + && cd /usr/src/postgis \ + && gettextize \ + && ./autogen.sh \ + && ./configure \ + --with-pcredir="$(pcre-config --prefix)" --with-geosconfig="/usr/bin/geos-config"\ + && make -j$(nproc) \ + && make install \ + && cd / \ +# clean + && apt-get autoremove --purge -y \ + wget \ + g++\ + gcc \ + make \ + && apt-get clean -y \ + && rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* -RUN apt-get update \ - && apt-get install -y lsb-release gnupg2 \ - && echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \ - && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ - && apt-get update \ - && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ - && apt-get install -y --no-install-recommends \ - ca-certificates \ - \ - postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ - postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \ - && rm -rf /var/lib/apt/lists/* # ADD pg_repack Extention ARG PG_REPACK_VERSION -RUN apt-get update \ +RUN set -eux \ + && apt-get update \ && apt-get install -y unzip \ build-essential \ liblz4-dev \ @@ -163,7 +201,6 @@ RUN apt-get update \ build-essential \ liblz4-dev \ libssl-dev \ - zlib1g-dev \ wget \ && apt-get clean -y \ && rm -rf \ @@ -195,7 +232,6 @@ RUN apt-get update \ unzip \ build-essential \ liblz4-dev \ - zlib1g-dev \ libedit-dev \ libssl-dev \ wget \ @@ -228,7 +264,6 @@ RUN apt-get update \ unzip \ build-essential \ liblz4-dev \ - zlib1g-dev \ libedit-dev \ libssl-dev \ wget \ diff --git a/bitnami/Makefile b/bitnami/Makefile index 23737ba4..a3718a34 100644 --- a/bitnami/Makefile +++ b/bitnami/Makefile @@ -6,7 +6,8 @@ PG_VER=pg15 CITUS_VERSION="11.2.0" POSTGIS_MAJOR=3 PG_MAJOR=15 -POSTGIS_VERSION=3.3.3+dfsg-1~exp1.pgdg110+1 +POSTGIS_VERSION=3.3.2 +POSTGIS_SHA256=2a6858d1df06de1c5f85a5b780773e92f6ba3a5dc09ac31120ac895242f5a77b PG_REPACK_VERSION = 1.4.8 PG_AUTO_FAILOVER_VERSION = 2.0 POSTGRES_HLL_VERSION = 2.17 @@ -32,6 +33,7 @@ DOCKER_BUILD_ARGS = --build-arg PG_VERSION=$(PG_VER_NUMBER) \ --build-arg POSTGIS_MAJOR=$(POSTGIS_MAJOR) \ --build-arg PG_MAJOR=$(PG_MAJOR) \ --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ + --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) \ --build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION) default: image From ba172d5889dcdab7d9531356f5f1d8a7c3280d9c Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Mon, 26 Jun 2023 13:04:00 +0530 Subject: [PATCH 097/104] add PG_MAJOR for zombodb --- bitnami/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index aa1f80ab..db581538 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -274,6 +274,7 @@ RUN apt-get update \ /var/tmp/* # Install zombodb extension +ARG PG_MAJOR RUN apt-get update -y -qq --fix-missing \ && apt-get install -y wget gnupg \ && echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" >> /etc/apt/sources.list \ From ea4111584c431d1f13486567127ed8754a0773a0 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Fri, 7 Jul 2023 13:12:05 +0530 Subject: [PATCH 098/104] add packer template and updated workflow --- .github/workflows/smoke-test-packer.yml | 128 +++++++ .github/workflows/smoke-test.yml | 35 +- README.md | 54 ++- bitnami/timescaledb-bitnami-entrypoint.sh | 2 +- packer/postgres-alpine.sh | 361 ++++++++++++++++++ packer/postgres-bitnami.sh | 359 +++++++++++++++++ packer/timescaledb-bitnami-entrypoint.sh | 15 + packer/warpsql.pkr.hcl | 104 +++++ test/smoke_test/extentions_test/test_citus.sh | 12 + test/smoke_test/extentions_test/test_hll.sh | 6 + .../extentions_test/test_pg_repack.sh | 6 + .../extentions_test/test_pgautofailover.sh | 6 + .../extentions_test/test_pgvector.sh | 8 + .../extentions_test/test_postgis.sh | 11 + .../extentions_test/test_timescaledb.sh | 26 ++ .../extentions_test/test_zombodb.sh | 10 + test/smoke_test/smoke_test.sh | 25 ++ 17 files changed, 1132 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/smoke-test-packer.yml create mode 100644 packer/postgres-alpine.sh create mode 100644 packer/postgres-bitnami.sh create mode 100755 packer/timescaledb-bitnami-entrypoint.sh create mode 100644 packer/warpsql.pkr.hcl create mode 100644 test/smoke_test/extentions_test/test_citus.sh create mode 100644 test/smoke_test/extentions_test/test_hll.sh create mode 100644 test/smoke_test/extentions_test/test_pg_repack.sh create mode 100644 test/smoke_test/extentions_test/test_pgautofailover.sh create mode 100644 test/smoke_test/extentions_test/test_pgvector.sh create mode 100644 test/smoke_test/extentions_test/test_postgis.sh create mode 100644 test/smoke_test/extentions_test/test_timescaledb.sh create mode 100644 test/smoke_test/extentions_test/test_zombodb.sh create mode 100755 test/smoke_test/smoke_test.sh diff --git a/.github/workflows/smoke-test-packer.yml b/.github/workflows/smoke-test-packer.yml new file mode 100644 index 00000000..157bdafb --- /dev/null +++ b/.github/workflows/smoke-test-packer.yml @@ -0,0 +1,128 @@ +name: Smoke Test packer template + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + push: + branches: + - main + +env: + ORG: timescaledev + TS_VERSION: main + PLATFORM: linux/amd64 + +jobs: + smoketest-all: + name: PG${{ matrix.pg }}-${{ matrix.type }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + pg: [15] + type: ['alpine', 'bitnami'] + steps: + - name: Check out the source + uses: actions/checkout@v3 + + + - name: Build packer template + run: | + cd packer + PACKER_LOG=1 packer init . && packer build -only 'warpsql.docker.${{matrix.type}}' -var image_repository=smoketest-image warpsql.pkr.hcl + + - name: Install psql + run: sudo apt install postgresql-client + + - name: Run the smoke test + run: | + set -eu + export PGHOST=localhost + export PGUSER=postgres + export PGPASSWORD=test1234 + docker container stop smoketest-container || true + docker container rm smoketest-container || true + docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=${PGPASSWORD} --name smoketest-container smoketest-image:latest + for _ in {1..120} + do + if [ -z "$(docker container ls -q --filter name=smoketest-container)" ] + then + echo "Smoketest container is not running" + exit 1 + fi + if psql -c "select 1" + then + bash ./test/smoke_test/smoke_test.sh + break + fi + sleep 1 + done + if ! psql -c "select 1" + then + echo "Cannot connect to PostgreSQL" + exit 1 + fi + + - name: Show the logs + if: always() + run: | + docker logs smoketest-container + + smoketest-individual: + name: PG${{ matrix.pg }}-${{ matrix.type }}-${{matrix.extention}} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + pg: [15] + type: ['alpine', 'bitnami'] + extention: ['timescaledb','pgvector','postgis','zombodb','pg_repack','pgautofailover','hll','citus'] + steps: + - name: Check out the source + uses: actions/checkout@v3 + + + - name: Build packer template + run: | + cd packer + PACKER_LOG=1 packer init . && packer build -only 'warpsql.docker.${{matrix.type}}' -var image_repository=smoketest-image -var extentions='${{matrix.extention}}' warpsql.pkr.hcl + + - name: Install psql + run: sudo apt install postgresql-client + + - name: Run the smoke test + run: | + set -eu + export PGHOST=localhost + export PGUSER=postgres + export PGPASSWORD=test1234 + docker container stop smoketest-container || true + docker container rm smoketest-container || true + docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=${PGPASSWORD} --name smoketest-container smoketest-image:latest + for _ in {1..120} + do + if [ -z "$(docker container ls -q --filter name=smoketest-container)" ] + then + echo "Smoketest container is not running" + exit 1 + fi + if psql -c "select 1" + then + bash ./test/smoke_test/smoke_test.sh "${{matrix.extention}}" + break + fi + sleep 1 + done + if ! psql -c "select 1" + then + echo "Cannot connect to PostgreSQL" + exit 1 + fi + + - name: Show the logs + if: always() + run: | + docker logs smoketest-container diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 247eb402..14c712bd 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -60,40 +60,7 @@ jobs: fi if psql -c "select 1" then - echo "Test Citus Extension" - psql -c "CREATE EXTENSION citus;" - psql -c "SELECT * FROM citus_version();" - - echo "Test Citus Distributed Table" - psql -c "CREATE TABLE test_distributed_table (id serial primary key, data text);" - psql -c "SELECT create_distributed_table('test_distributed_table', 'id');" - psql -c "INSERT INTO test_distributed_table (data) VALUES ('test data');" - psql -c "SELECT * FROM test_distributed_table;" - - echo "Test PostGIS Extension" - psql -c "CREATE EXTENSION postgis;" || true - psql -c "SELECT PostGIS_Version();" - - echo "Test PostGIS Geometry Function" - psql -c "CREATE TABLE test_geometry_table (id serial primary key, geom geometry(Point, 4326));" - psql -c "INSERT INTO test_geometry_table (geom) VALUES (ST_GeomFromText('POINT(0 0)', 4326));" - psql -c "SELECT * FROM test_geometry_table;" - - echo "Test zombodb Extension" - psql -c "CREATE EXTENSION zombodb;" - psql -c "SELECT zdb.internal_version();" - - echo "Test pg_repack Extension" - psql -c "CREATE EXTENSION pg_repack;" - psql -c "select repack.version(), repack.version_sql();" - - echo "Test pgautofailover Extension" - psql -c "CREATE EXTENSION pgautofailover CASCADE;" - psql -c "SELECT pgautofailover.formation_settings();" - - echo "Test HyperLogLog Extension" - psql -c "CREATE EXTENSION hll;" - psql -c "select hll_hash_text('hello world');" + bash ./test/smoke_test/smoke_test.sh break fi sleep 1 diff --git a/README.md b/README.md index b9df2bcb..919ff305 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Bootstrapped from [TimescaleDB](https://github.com/timescale/timescaledb-docker) ### Usage with Compose -```yam +```yaml version: '3.6' services: warpsql: @@ -44,6 +44,58 @@ By utilizing WarpSQL, you can benefit from the following: - *Extensibility*: While WarpSQL already supports a range of extensions, it aims to expand its offerings to include even more powerful tools in the future, such as ZomboDB, PLV8, and Pg Repack. Get started with WarpSQL today and experience the convenience of a comprehensive Postgres solution. +## PostgreSQL Image Packer Template + +This repository contains a Packer template for building the WarpSQL image with multiple sources and provisioners. The template supports building images based on both the Alpine and Bitnami PostgreSQL images. + +#### Prerequisites + +Before using this Packer template, ensure that you have the following prerequisites installed: + +- [Packer](https://www.packer.io/) +- [Docker](https://www.docker.com/) (for building Docker images) + +### Usage + +To build the WarpSQL image using the Packer template, follow these steps: + +1. Clone this repository and navigate to the packer directory: + + ```shell + git clone https://github.com/Samagra-Development/WarpSQL.git + cd WarpSQL/packer +2. Build the images: + ```shell + packer build warpsql.pkr.hcl + ``` +To build only the Alpine image, you can use the `-only` option: + + ```shell + packer build -only=warpsql.docker.alpine warpsql.pkr.hcl + ``` + By default, all supported [extensions](#list-of-supported-extensions) are installed. If you want to install specific extensions, you can provide the `extensions` variable: + ```shell + packer build -var extentions='pg_repack,hll' -only warpsql.docker.alpine warpsql.pkr.hcl + ``` + + Note that currently only the `Docker` source has been added to the template. + +You can further customize the image repository and tags by providing values for the `image_repository` and `image_tags` variables using the `-var` option. Here's an example command: +```shell +packer build -var="image_repository=your_value" -var="image_tags=[tag1,tag2]" warpsql.pkr.hcl +``` + +### List of supported extensions +|Extension | Identifier | +|----------------|------------------| +|[PgVector](https://github.com/pgvector/pgvector) | `pgvector` | +|[TimescaleDB](https://github.com/timescale/timescaledb) | `timescaledb` | +|[Citus](https://github.com/citusdata/citus) | `citus` | +|[PostGIS](https://github.com/postgis/postgis) | `postgis` | +|[ZomboDB](https://github.com/zombodb/zombodb) | `zombodb` | +|[PgRepack](https://github.com/reorg/pg_repack) | `pg_repack` | +|[PG Auto Failover](https://github.com/hapostgres/pg_auto_failover)| `pgautofailover` | +|[HyperLogLog](https://github.com/citusdata/postgresql-hll) | `hll` | ## Contribution You can contribute to the development of WarpSQL using both Gitpod and Codespaces. Follow the steps below to set up your development environment and make contributions: diff --git a/bitnami/timescaledb-bitnami-entrypoint.sh b/bitnami/timescaledb-bitnami-entrypoint.sh index 346453a4..c813e3b2 100755 --- a/bitnami/timescaledb-bitnami-entrypoint.sh +++ b/bitnami/timescaledb-bitnami-entrypoint.sh @@ -12,4 +12,4 @@ export POSTGRESQL_SHARED_PRELOAD_LIBRARIES # Fall through to the original entrypoint. Note that we use exec here because # this wrapper script shouldn't change PID 1 of the container. -exec /opt/bitnami/scripts/postgresql/entrypoint.sh "$@" +exec /opt/bitnami/scripts/postgresql/entrypoint.sh "$@" \ No newline at end of file diff --git a/packer/postgres-alpine.sh b/packer/postgres-alpine.sh new file mode 100644 index 00000000..c37a7a43 --- /dev/null +++ b/packer/postgres-alpine.sh @@ -0,0 +1,361 @@ +#! /bin/bash + +set -ex + +check_env_variables() { + for var in "$@"; do + if [ -z "${!var}" ]; then + echo "Error: '$var' environment variable is not set." + exit 1 + fi + done +} + +install_timescaledb (){ + check_env_variables TS_VERSION + apk add libssl1.1 + apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + git \ + openssl \ + openssl-dev \ + tar + mkdir -p /build/ + git clone https://github.com/timescale/timescaledb /build/timescaledb + apk add --no-cache --virtual .build-deps \ + coreutils \ + dpkg-dev dpkg \ + gcc \ + krb5-dev \ + libc-dev \ + make \ + cmake \ + util-linux-dev \ + # Build current version \ + cd /build/timescaledb && rm -fr build + git checkout ${TS_VERSION} + ./bootstrap -DCMAKE_BUILD_TYPE=RelWithDebInfo -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DGENERATE_DOWNGRADE_SCRIPT=ON -DWARNINGS_AS_ERRORS=OFF -DPROJECT_INSTALL_METHOD="docker"${OSS_ONLY} + cd build && make install + cd ~ + if [ "${OSS_ONLY}" != "" ]; then rm -f $(pg_config --pkglibdir)timescaledb-tsl-*.so; fi + apk del .fetch-deps .build-deps + rm -rf /build + sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample +} + + + +install_pgvector(){ +# Adding PG Vector + cd /tmp + apk add --no-cache --virtual .build-deps \ + coreutils \ + dpkg-dev dpkg \ + gcc \ + git \ + krb5-dev \ + libc-dev \ + llvm15 \ + make \ + cmake \ + clang15 \ + util-linux-dev + git clone --branch v0.4.1 https://github.com/pgvector/pgvector.git + cd pgvector + ls + make + make install +} + +install_citus(){ +## Adding Citus +check_env_variables CITUS_VERSION + apk add --no-cache --virtual .citus-deps \ + curl \ + jq \ + curl-dev + apk add --no-cache --virtual .citus-build-deps \ + gcc \ + libc-dev \ + make \ + lz4-dev \ + zstd-dev \ + clang15 \ + krb5-dev \ + icu-dev \ + libxslt-dev \ + libxml2-dev \ + llvm15-dev + export CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" + curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" + tar -C /tmp -xvf /tmp/citus.tar.gz + chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} + cd /tmp/citus-${CITUS_VERSION} + PATH="/usr/local/pgsql/bin:$PATH" ./configure + make + make install + cd ~ + rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} + apk del .citus-build-deps + sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'citus,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample +} + +install_postgis(){ +# Adding Postgis +check_env_variables POSTGIS_VERSION POSTGIS_SHA256 +if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ + set -eux ; \ + export GEOS_ALPINE_VER=3.11 ; \ + export GDAL_ALPINE_VER=3.6.4-r4 ; \ + export PROJ_ALPINE_VER=9.2 ; \ + elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ + set -eux ; \ + export GEOS_ALPINE_VER=3.8 ; \ + export GDAL_ALPINE_VER=3.2 ; \ + export PROJ_ALPINE_VER=7.2 ; \ + \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.14/main' >> /etc/apk/repositories ; \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.14/community' >> /etc/apk/repositories ; \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.13/main' >> /etc/apk/repositories ; \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.13/community' >> /etc/apk/repositories ; \ + \ + else \ + set -eux ; \ + echo ".... unknown \$POSTGIS_VERSION ...." ; \ + exit 1 ; \ + fi + + apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + openssl \ + tar + + wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/${POSTGIS_VERSION}.tar.gz" + echo "${POSTGIS_SHA256} *postgis.tar.gz" | sha256sum -c - + mkdir -p /usr/src/postgis + tar \ + --extract \ + --file postgis.tar.gz \ + --directory /usr/src/postgis \ + --strip-components 1 + rm postgis.tar.gz + + apk add --no-cache --virtual .build-deps \ + \ + gdal-dev~=${GDAL_ALPINE_VER} \ + geos-dev~=${GEOS_ALPINE_VER} \ + proj-dev~=${PROJ_ALPINE_VER} \ + \ + autoconf \ + automake \ + clang-dev \ + clang15 \ + cunit-dev \ + file \ + g++ \ + gcc \ + gettext-dev \ + git \ + json-c-dev \ + libtool \ + libxml2-dev \ + llvm-dev \ + llvm15 \ + make \ + pcre-dev \ + perl \ + protobuf-c-dev \ + +# build PostGIS + + cd /usr/src/postgis + gettextize + ./autogen.sh + ./configure \ + --with-pcredir="$(pcre-config --prefix)" + make -j$(nproc) + make install + +# add .postgis-rundeps + apk add --no-cache --virtual .postgis-rundeps \ + \ + gdal~=${GDAL_ALPINE_VER} \ + geos~=${GEOS_ALPINE_VER} \ + proj~=${PROJ_ALPINE_VER} \ + \ + json-c \ + libstdc++ \ + pcre \ + protobuf-c \ + \ + ca-certificates +# clean + cd / + rm -rf /usr/src/postgis + apk del .fetch-deps .build-deps + +} + +install_zombodb(){ +# adding zombodb +check_env_variables PG_VER +export RUSTFLAGS="-C target-feature=-crt-static" +apk add --no-cache --virtual .zombodb-build-deps \ + git \ + curl \ + bash \ + ruby-dev \ + ruby-etc \ + musl-dev \ + make \ + gcc \ + coreutils \ + util-linux-dev \ + musl-dev \ + openssl-dev \ + clang15 \ + tar + gem install --no-document fpm + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y + PATH=$HOME/.cargo/bin:$PATH + cargo install cargo-pgrx --version 0.9.3 + cargo pgrx init --${PG_VER}=$(which pg_config) + git clone https://github.com/zombodb/zombodb.git + cd ./zombodb + cargo pgrx install --release + cd .. + rm -rf ./zombodb + apk del .zombodb-build-deps + sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'zombodb,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample + +} + +install_pgrepack(){ +## Adding pg_repack + check_env_variables PG_REPACK_VERSION + apk add --no-cache --virtual .pg_repack-build-deps \ + openssl-dev \ + zstd-dev \ + lz4-dev \ + zlib-dev \ + make \ + clang15 \ + gawk \ + llvm15 \ + gcc \ + musl-dev +# build pg_repack + wget -O /tmp/pg_repack-${PG_REPACK_VERSION}.zip "https://api.pgxn.org/dist/pg_repack/${PG_REPACK_VERSION}/pg_repack-${PG_REPACK_VERSION}.zip" + unzip /tmp/pg_repack-${PG_REPACK_VERSION}.zip -d /tmp + cd /tmp/pg_repack-${PG_REPACK_VERSION} + make + make install +# clean + cd / + rm -rf /tmp/pg_repack-${PG_REPACK_VERSION} /tmp/pg_repack.zip + apk del .pg_repack-build-deps + +} +install_pgautofailover(){ +# Adding pgautofailover + check_env_variables PG_AUTO_FAILOVER_VERSION + apk add --no-cache --virtual .pg_auto_failover-build-deps \ + make \ + gcc \ + musl-dev \ + krb5-dev \ + openssl-dev \ + clang15 \ + ncurses-dev \ + linux-headers \ + zstd-dev \ + lz4-dev \ + zlib-dev \ + libedit-dev \ + libxml2-utils \ + libxslt-dev \ + llvm15 +# build pg_auto_failover + wget -O /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION}.zip "https://github.com/hapostgres/pg_auto_failover/archive/refs/tags/v${PG_AUTO_FAILOVER_VERSION}.zip" + unzip /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION}.zip -d /tmp + ls -alh /tmp + cd /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION} + make + make install +# clean + cd / + rm -rf /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION} /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION}.zip + apk del .pg_auto_failover-build-deps + sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'pgautofailover,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample + +} +install_hll(){ +## Adding postgresql-hll +check_env_variables POSTGRES_HLL_VERSION + apk add --no-cache --virtual .postgresql-hll-build-deps \ + openssl-dev \ + zstd-dev \ + lz4-dev \ + zlib-dev \ + make \ + git \ + clang15 \ + gawk \ + llvm15 \ + g++ \ + musl-dev +# build postgresql-hll + wget -O /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip "https://github.com/citusdata/postgresql-hll/archive/refs/tags/v${POSTGRES_HLL_VERSION}.zip" + unzip /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip -d /tmp + cd /tmp/postgresql-hll-${POSTGRES_HLL_VERSION} + make + make install +# clean + cd / + rm -rf /tmp/postgresql-hll-${POSTGRES_HLL_VERSION} /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip + apk del .postgresql-hll-build-deps + +} + + +# enable contrib extentions +sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'pg_stat_statements,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample + + +# Retrieve and split the extension names +IFS=',' read -ra EXTENSION_LIST <<< "$EXTENSIONS" + +# Install each extension +for extension in "${EXTENSION_LIST[@]}"; do + case $extension in + timescaledb) + install_timescaledb + ;; + pgvector) + install_pgvector + ;; + citus) + install_citus + ;; + postgis) + install_postgis + ;; + zombodb) + install_zombodb + ;; + pg_repack) + install_pgrepack + ;; + pgautofailover) + install_pgautofailover + ;; + hll) + install_hll + ;; + *) + # Handle unrecognized extensions + echo "Unknown extension: $extension" + exit 1 + ;; + esac +done \ No newline at end of file diff --git a/packer/postgres-bitnami.sh b/packer/postgres-bitnami.sh new file mode 100644 index 00000000..f34c0785 --- /dev/null +++ b/packer/postgres-bitnami.sh @@ -0,0 +1,359 @@ +#! /bin/bash + +set -ex + +check_env_variables() { + for var in "$@"; do + if [ -z "${!var}" ]; then + echo "Error: '$var' environment variable is not set." + exit 1 + fi + done +} + +install_timescaledb (){ + check_env_variables TS_VERSION + apt-get update + apt-get -y install \ + build-essential \ + libssl-dev \ + git \ + \ + dpkg-dev \ + gcc \ + libc-dev \ + make \ + cmake \ + wget + mkdir -p /build/ + git clone https://github.com/timescale/timescaledb /build/timescaledb + # Build current version \ + cd /build/timescaledb && rm -fr build + git checkout ${TS_VERSION} + ./bootstrap -DCMAKE_BUILD_TYPE=RelWithDebInfo -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DGENERATE_DOWNGRADE_SCRIPT=ON -DWARNINGS_AS_ERRORS=OFF -DPROJECT_INSTALL_METHOD="docker-bitnami" + cd build && make install + apt-get autoremove --purge -y \ + \ + build-essential \ + libssl-dev \ + \ + dpkg-dev \ + gcc \ + libc-dev \ + make \ + cmake + apt-get clean -y + rm -rf \ + /build \ + "${HOME}/.cache" \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* + sed -r -i 's/[#]*\s*(POSTGRESQL_SHARED_PRELOAD_LIBRARIES)\s*=\s*"(.*)"/\1="timescaledb,\2"/;s/,"/"/' /opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh + +} + + + +install_pgvector(){ +# Adding PG Vector +check_env_variables PG_MAJOR + cd /tmp + apt-get update + apt-get install -y --no-install-recommends build-essential git + git clone --branch v0.4.4 https://github.com/pgvector/pgvector.git /tmp/pgvector + cd /tmp/pgvector + make clean + make OPTFLAGS="" + make install + rm -r /tmp/pgvector + apt-get remove -y build-essential git && \ + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/* +} + +install_citus(){ +## Adding Citus +check_env_variables CITUS_VERSION + apt-get update + apt-get install -y curl liblz4-dev libzstd-dev clang libkrb5-dev libicu-dev libxslt1-dev libxml2-dev llvm-dev libcurl4-openssl-dev gawk flex gcc make libssh-dev + export CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" + curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" + tar -C /tmp -xvf /tmp/citus.tar.gz + addgroup --system postgres + adduser --system --ingroup postgres --home /opt/bitnami/postgresql --no-create-home postgres + chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} + cd /tmp/citus-${CITUS_VERSION} + PATH="/opt/bitnami/postgresql/bin:$PATH" ./configure + make + make install + cd ~ + rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} + apt-get autoremove --purge -y \ + \ + build-essential \ + libssl-dev \ + \ + dpkg-dev \ + gcc \ + libc-dev \ + make \ + gawk \ + flex \ + make \ + libssh-dev \ + cmake + apt-get clean -y + rm -rf \ + /build \ + "${HOME}/.cache" \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* + sed -r -i 's/[#]*\s*(POSTGRESQL_SHARED_PRELOAD_LIBRARIES)\s*=\s*"(.*)"/\1="citus,\2"/;s/,"/"/' /opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh + +} + +install_postgis(){ +# Adding Postgis +check_env_variables POSTGIS_VERSION POSTGIS_SHA256 + cd /tmp + apt update + apt install -y \ + ca-certificates \ + openssl \ + tar \ + wget \ + gettext \ + automake \ + libltdl-dev \ + libxml2-dev \ + libgeos-dev \ + libproj-dev \ + libprotobuf-c-dev \ + protobuf-c-compiler \ + g++\ + gcc \ + make + wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/${POSTGIS_VERSION}.tar.gz" + echo "${POSTGIS_SHA256} *postgis.tar.gz" | sha256sum -c - + mkdir -p /usr/src/postgis + tar \ + --extract \ + --file postgis.tar.gz \ + --directory /usr/src/postgis \ + --strip-components 1 + rm postgis.tar.gz +# build PostGIS + cd /usr/src/postgis + gettextize + ./autogen.sh + ./configure \ + --with-pcredir="$(pcre-config --prefix)" --with-geosconfig="/usr/bin/geos-config" + make -j$(nproc) + make install + cd / +# clean + apt-get autoremove --purge -y \ + wget \ + g++\ + gcc \ + make + apt-get clean -y + rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* +} + +install_zombodb(){ +# adding zombodb +check_env_variables PG_VER + cd /tmp + apt-get update -y -qq --fix-missing + apt-get install -y wget gnupg + echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" >> /etc/apt/sources.list + echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list + wget --quiet -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 + apt update + apt-get update -y --fix-missing + 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 + wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz + tar -xzvf openssl-1.0.2l.tar.gz + cd openssl-1.0.2l + wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz + tar -xzvf openssl-1.0.2l.tar.gz + cd openssl-1.0.2l + ./config + make install + ln -sf /usr/local/ssl/bin/openssl `which openssl` + mkdir ruby + cd ruby + wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz + tar xvfz ruby-2.3.0.tar.gz + cd ruby-2.3.0 + ./configure --with-openssl-dir=/usr/include/openssl-1.0 + make -j64 + make install + gem install --no-document fpm + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + export PATH="/.cargo/bin:$PATH" + export PGRX_HOME="/.pgrx/" + mkdir -p $PGRX_HOME + cargo install cargo-pgrx --version 0.9.3 + cargo pgrx init --pg${PG_MAJOR}=/opt/bitnami/postgresql/bin/pg_config + git clone https://github.com/zombodb/zombodb.git + cd zombodb + export PATH="/.cargo/bin:$PATH" && cargo pgrx install --release + sed -r -i 's/[#]*\s*(POSTGRESQL_SHARED_PRELOAD_LIBRARIES)\s*=\s*"(.*)"/\1="zombodb,\2"/;s/,"/"/' /opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh +} + +install_pgrepack(){ +## Adding pg_repack + check_env_variables PG_REPACK_VERSION + apt-get update + apt-get install -y unzip \ + build-essential \ + liblz4-dev \ + zlib1g-dev \ + libssl-dev \ + wget +# build pg_repack + wget -O /tmp/pg_repack-${PG_REPACK_VERSION}.zip "https://api.pgxn.org/dist/pg_repack/${PG_REPACK_VERSION}/pg_repack-${PG_REPACK_VERSION}.zip" + unzip /tmp/pg_repack-${PG_REPACK_VERSION}.zip -d /tmp + cd /tmp/pg_repack-${PG_REPACK_VERSION} + make + make install +#clean + apt-get autoremove --purge -y \ + unzip \ + build-essential \ + liblz4-dev \ + libssl-dev \ + wget + apt-get clean -y + rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* + +} +install_pgautofailover(){ +# Adding pgautofailover + check_env_variables PG_AUTO_FAILOVER_VERSION + apt-get update + apt-get install -y unzip \ + build-essential \ + liblz4-dev \ + zlib1g-dev \ + libedit-dev \ + libssl-dev \ + libxslt1-dev \ + libxml2-dev \ + wget +# build pg_auto_failover + wget -O /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION}.zip "https://github.com/hapostgres/pg_auto_failover/archive/refs/tags/v${PG_AUTO_FAILOVER_VERSION}.zip" + unzip /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION}.zip -d /tmp + ls -alh /tmp + cd /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION} + make + make install +# clean + cd / + rm -rf /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION} /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION}.zip + apt-get autoremove --purge -y \ + unzip \ + build-essential \ + liblz4-dev \ + libedit-dev \ + libssl-dev \ + libxslt1-dev \ + libxml2-dev \ + wget + apt-get clean -y + rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* + sed -r -i 's/[#]*\s*(POSTGRESQL_SHARED_PRELOAD_LIBRARIES)\s*=\s*"(.*)"/\1="pgautofailover,\2"/;s/,"/"/' /opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh + +} + +install_hll(){ +## Adding postgresql-hll +check_env_variables POSTGRES_HLL_VERSION + apt-get update + apt-get install -y unzip \ + build-essential \ + liblz4-dev \ + zlib1g-dev \ + libedit-dev \ + libssl-dev \ + wget +# build postgresql-hll + wget -O /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip "https://github.com/citusdata/postgresql-hll/archive/refs/tags/v${POSTGRES_HLL_VERSION}.zip" + unzip /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip -d /tmp + cd /tmp/postgresql-hll-${POSTGRES_HLL_VERSION} + make + make install +# clean + cd / + rm -rf /tmp/postgresql-hll-${POSTGRES_HLL_VERSION} /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip + apt-get autoremove --purge -y \ + unzip \ + build-essential \ + liblz4-dev \ + libedit-dev \ + libssl-dev \ + wget + apt-get clean -y + rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* + +} + + +# enable contrib extentions +# sed -r -i 's/[#]*\s*(POSTGRESQL_SHARED_PRELOAD_LIBRARIES)\s*=\s*"(.*)"/\1="pg_stat_statements,\2"/;s/,"/"/' /opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh + + +# Retrieve and split the extension names +IFS=',' read -ra EXTENSION_LIST <<< "$EXTENSIONS" + +# Install each extension +for extension in "${EXTENSION_LIST[@]}"; do + case $extension in + timescaledb) + install_timescaledb + ;; + pgvector) + install_pgvector + ;; + citus) + install_citus + ;; + postgis) + install_postgis + ;; + zombodb) + install_zombodb + ;; + pg_repack) + install_pgrepack + ;; + pgautofailover) + install_pgautofailover + ;; + hll) + install_hll + ;; + *) + # Handle unrecognized extensions + echo "Unknown extension: $extension" + exit 1 + ;; + esac +done \ No newline at end of file diff --git a/packer/timescaledb-bitnami-entrypoint.sh b/packer/timescaledb-bitnami-entrypoint.sh new file mode 100755 index 00000000..46bf2259 --- /dev/null +++ b/packer/timescaledb-bitnami-entrypoint.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# We have to use the Bitnami configuration variable to add TimescaleDB, Citus to +# the shared preload list, or else it gets overwritten. +if [ -z "$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" ] +then + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="" +else + POSTGRESQL_SHARED_PRELOAD_LIBRARIES="$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" +fi +export POSTGRESQL_SHARED_PRELOAD_LIBRARIES + +# Fall through to the original entrypoint. Note that we use exec here because +# this wrapper script shouldn't change PID 1 of the container. +exec /opt/bitnami/scripts/postgresql/entrypoint.sh "$@" diff --git a/packer/warpsql.pkr.hcl b/packer/warpsql.pkr.hcl new file mode 100644 index 00000000..e58e2b01 --- /dev/null +++ b/packer/warpsql.pkr.hcl @@ -0,0 +1,104 @@ +# Packer configuration file for building a PostgreSQL image with multiple sources and provisioners +packer { + required_plugins { + docker = { + version = ">= 0.0.7" + source = "github.com/hashicorp/docker" + } + } +} +# # This variable defines the repository where the built image will be committed. +variable "image_repository" { + type = string + default = "warpsql" +} +# Tags to be applied to the built image +variable "image_tags" { + type = list(string) + default = ["latest"] + +} +variable "extentions" { + type = string + default = "timescaledb,pgvector,postgis,zombodb,pg_repack,pgautofailover,hll,citus" +} +source "docker" "alpine" { + image = "postgres:15-alpine" + commit = true + # Restore the parent image's ENTRYPOINT and CMD instructions + changes = [ + "ENTRYPOINT [\"docker-entrypoint.sh\"]", + "CMD [\"postgres\"]" + ] + run_command = ["-d", "-i", "-u=root", "-t", "--entrypoint=/bin/sh", "--", "{{.Image}}"] # running as the root user regardless of user instruction +} + +source "docker" "bitnami" { + image = "bitnami/postgresql:15" + commit = true + changes = [ + "USER 1001", + "ENTRYPOINT [ \"/opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh\" ]", + "CMD [ \"/opt/bitnami/scripts/postgresql/run.sh\" ]" + ] + run_command = ["-d", "-i", "-u=root", "-t", "--entrypoint=/bin/sh", "--", "{{.Image}}"] +} + +# Build configuration +build { + name = "warpsql" + # Specify the sources for the build + sources = [ + "source.docker.alpine", + "source.docker.bitnami" + ] + # provisioners for the Alpine image + provisioner "shell" { + environment_vars = [ + "EXTENSIONS=${var.extentions}", + "PG_VERSION=15", + "PG_VER=pg15", + "CITUS_VERSION=11.2.0", + "POSTGIS_VERSION=3.3.2", + "PG_REPACK_VERSION=1.4.8", + "PG_AUTO_FAILOVER_VERSION=2.0", + "POSTGRES_HLL_VERSION=2.17", + "POSTGIS_SHA256=2a6858d1df06de1c5f85a5b780773e92f6ba3a5dc09ac31120ac895242f5a77b", + "TS_VERSION=main" + ] + script = "postgres-alpine.sh" + only = ["docker.alpine"] + } + + # provisioners for the Bitnami image + provisioner "file" { + source = "timescaledb-bitnami-entrypoint.sh" + destination = "/opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh" + only = ["docker.bitnami"] + + } + + provisioner "shell" { + environment_vars = [ + "EXTENSIONS=${var.extentions}", + "PG_VERSION=15", + "PG_VER=pg15", + "CITUS_VERSION=11.2.0", + "POSTGIS_VERSION=3.3.2", + "PG_REPACK_VERSION=1.4.8", + "PG_MAJOR=15", + "PG_AUTO_FAILOVER_VERSION=2.0", + "POSTGRES_HLL_VERSION=2.17", + "POSTGIS_SHA256=2a6858d1df06de1c5f85a5b780773e92f6ba3a5dc09ac31120ac895242f5a77b", + "TS_VERSION=main" + ] + script = "postgres-bitnami.sh" + only = ["docker.bitnami"] + } + + post-processor "docker-tag" { + repository = var.image_repository + tags = var.image_tags + } + +} diff --git a/test/smoke_test/extentions_test/test_citus.sh b/test/smoke_test/extentions_test/test_citus.sh new file mode 100644 index 00000000..4c391978 --- /dev/null +++ b/test/smoke_test/extentions_test/test_citus.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -ex + +echo "Test Citus Extension" +psql -c "CREATE EXTENSION citus;" +psql -c "SELECT * FROM citus_version();" + +echo "Test Citus Distributed Table" +psql -c "CREATE TABLE test_distributed_table (id serial primary key, data text);" +psql -c "SELECT create_distributed_table('test_distributed_table', 'id');" +psql -c "INSERT INTO test_distributed_table (data) VALUES ('test data');" +psql -c "SELECT * FROM test_distributed_table;" \ No newline at end of file diff --git a/test/smoke_test/extentions_test/test_hll.sh b/test/smoke_test/extentions_test/test_hll.sh new file mode 100644 index 00000000..812f8f45 --- /dev/null +++ b/test/smoke_test/extentions_test/test_hll.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -ex + +echo "Test HyperLogLog Extension" +psql -c "CREATE EXTENSION hll;" +psql -c "select hll_hash_text('hello world');" \ No newline at end of file diff --git a/test/smoke_test/extentions_test/test_pg_repack.sh b/test/smoke_test/extentions_test/test_pg_repack.sh new file mode 100644 index 00000000..aaa86bb6 --- /dev/null +++ b/test/smoke_test/extentions_test/test_pg_repack.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -ex + +echo "Test pg_repack Extension" +psql -c "CREATE EXTENSION pg_repack;" +psql -c "select repack.version(), repack.version_sql();" \ No newline at end of file diff --git a/test/smoke_test/extentions_test/test_pgautofailover.sh b/test/smoke_test/extentions_test/test_pgautofailover.sh new file mode 100644 index 00000000..e3812c6f --- /dev/null +++ b/test/smoke_test/extentions_test/test_pgautofailover.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -ex + +echo "Test pgautofailover Extension" +psql -c "CREATE EXTENSION pgautofailover CASCADE;" +psql -c "SELECT pgautofailover.formation_settings();" \ No newline at end of file diff --git a/test/smoke_test/extentions_test/test_pgvector.sh b/test/smoke_test/extentions_test/test_pgvector.sh new file mode 100644 index 00000000..da4edf81 --- /dev/null +++ b/test/smoke_test/extentions_test/test_pgvector.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -ex + +echo "Test pg_vector Extension" +psql -c "CREATE EXTENSION vector;" +psql -c "CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));" +psql -c "INSERT INTO items (embedding) VALUES ('[1,2,3]'), ('[4,5,6]');" +psql -c "SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;" \ No newline at end of file diff --git a/test/smoke_test/extentions_test/test_postgis.sh b/test/smoke_test/extentions_test/test_postgis.sh new file mode 100644 index 00000000..881a531a --- /dev/null +++ b/test/smoke_test/extentions_test/test_postgis.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -ex + +echo "Test PostGIS Extension" +psql -c "CREATE EXTENSION postgis;" || true +psql -c "SELECT PostGIS_Version();" + +echo "Test PostGIS Geometry Function" +psql -c "CREATE TABLE test_geometry_table (id serial primary key, geom geometry(Point, 4326));" +psql -c "INSERT INTO test_geometry_table (geom) VALUES (ST_GeomFromText('POINT(0 0)', 4326));" +psql -c "SELECT * FROM test_geometry_table;" \ No newline at end of file diff --git a/test/smoke_test/extentions_test/test_timescaledb.sh b/test/smoke_test/extentions_test/test_timescaledb.sh new file mode 100644 index 00000000..3d3e0b5d --- /dev/null +++ b/test/smoke_test/extentions_test/test_timescaledb.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -ex + +psql < NOW() - interval '3 hours' + GROUP BY fifteen_min, location + ORDER BY fifteen_min DESC, max_temp DESC; +EOF \ No newline at end of file diff --git a/test/smoke_test/extentions_test/test_zombodb.sh b/test/smoke_test/extentions_test/test_zombodb.sh new file mode 100644 index 00000000..23e57bc0 --- /dev/null +++ b/test/smoke_test/extentions_test/test_zombodb.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -ex + +echo "Test zombodb Extension" +psql -c "CREATE EXTENSION zombodb;" +psql -c "SELECT zdb.internal_version();" + + + + \ No newline at end of file diff --git a/test/smoke_test/smoke_test.sh b/test/smoke_test/smoke_test.sh new file mode 100755 index 00000000..08f3cc71 --- /dev/null +++ b/test/smoke_test/smoke_test.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# +set -ex +# get the base dir of the script +scriptDir=$(dirname -- "$(readlink -f -- "$BASH_SOURCE")") +echo $scriptDir/extentions_test +# Find all test script files in the directory +test_scripts=$(find $scriptDir/extentions_test -type f -name 'test_*.sh') + +# If no extensions provided, run all test scripts +if [[ -z $1 ]]; then + for script in $test_scripts; do + bash "$script" + done +else +IFS=',' read -ra EXTENSION_LIST <<< "$1" + for extension in "${EXTENSION_LIST[@]}"; do + test_script="$scriptDir/extentions_test/test_${extension}.sh" + if [[ -f "$test_script" ]]; then + bash "$test_script" + else + echo "Test script for '$extension' not found." + fi + done +fi \ No newline at end of file From 09e6704ba61b328626659fde41aeeb895e5f0dd7 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Tue, 11 Jul 2023 19:27:53 +0530 Subject: [PATCH 099/104] add limit to parallel jobs in packer testing --- .github/workflows/smoke-test-packer.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/smoke-test-packer.yml b/.github/workflows/smoke-test-packer.yml index 157bdafb..865ef4b9 100644 --- a/.github/workflows/smoke-test-packer.yml +++ b/.github/workflows/smoke-test-packer.yml @@ -76,6 +76,7 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: false + max-parallel: 5 matrix: pg: [15] type: ['alpine', 'bitnami'] From 133ea05b35a8b175bc0467af3f44b84bead89274 Mon Sep 17 00:00:00 2001 From: inkerton <127668005+inkerton@users.noreply.github.com> Date: Sun, 16 Jul 2023 17:42:07 +0530 Subject: [PATCH 100/104] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 919ff305..e033408a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

-

WarpSQL

+

WarpSQL

Opinionated extensions to Postgres packaged as a single docker deployment. Why install 10 DBs when you can have everything at once (maybe not everything). Certified as Indie Hacker's best friend!!! From c283db4fb300a57e3be1112f65b6e270ace81134 Mon Sep 17 00:00:00 2001 From: inkerton <127668005+inkerton@users.noreply.github.com> Date: Sun, 16 Jul 2023 17:44:04 +0530 Subject: [PATCH 101/104] Create configure_jekyll.yml --- .github/workflows/configure_jekyll.yml | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/configure_jekyll.yml diff --git a/.github/workflows/configure_jekyll.yml b/.github/workflows/configure_jekyll.yml new file mode 100644 index 00000000..559bddf5 --- /dev/null +++ b/.github/workflows/configure_jekyll.yml @@ -0,0 +1,51 @@ +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll with GitHub Pages dependencies preinstalled + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 From ee2d462e076a31f5062827270f02444fbe5479cf Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Mon, 17 Jul 2023 23:18:07 +0530 Subject: [PATCH 102/104] remove build dependency and packages Signed-off-by: Piyush Raj --- bitnami/Dockerfile | 7 +++++-- packer/postgres-bitnami.sh | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index b917fcd2..27b48d24 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -297,7 +297,7 @@ RUN apt-get update -y -qq --fix-missing \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 \ && apt update \ && apt-get update -y --fix-missing \ - && 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 \ + && apt-get install -y git curl clang-14 llvm-14 gcc make build-essential libz-dev zlib1g-dev pkg-config libreadline-dev libgdbm-dev libssl1.0-dev \ && wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz \ && tar -xzvf openssl-1.0.2l.tar.gz \ && cd openssl-1.0.2l \ @@ -321,7 +321,10 @@ RUN apt-get update -y -qq --fix-missing \ && cargo pgrx init --pg${PG_MAJOR}=/opt/bitnami/postgresql/bin/pg_config \ && git clone https://github.com/zombodb/zombodb.git \ && cd zombodb \ - && export PATH="/.cargo/bin:$PATH" && cargo pgrx install --release + && export PATH="/.cargo/bin:$PATH" && cargo pgrx install --release \ + && cd / \ + && apt-get autoremove --purge -y git curl clang-14 gcc make build-essential wget \ + && rm -rf .cargo .gem openssl-1.0.2l .rustup openssl-1.0.2l.tar.gz USER 1001 diff --git a/packer/postgres-bitnami.sh b/packer/postgres-bitnami.sh index f34c0785..ce52e598 100644 --- a/packer/postgres-bitnami.sh +++ b/packer/postgres-bitnami.sh @@ -178,7 +178,7 @@ check_env_variables PG_VER apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 apt update apt-get update -y --fix-missing - 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 + apt-get install -y git curl clang-14 llvm-14 gcc make build-essential libz-dev zlib1g-dev pkg-config libreadline-dev libgdbm-dev libssl1.0-dev wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz tar -xzvf openssl-1.0.2l.tar.gz cd openssl-1.0.2l @@ -206,6 +206,9 @@ check_env_variables PG_VER git clone https://github.com/zombodb/zombodb.git cd zombodb export PATH="/.cargo/bin:$PATH" && cargo pgrx install --release + cd / + apt-get autoremove --purge -y git curl clang-14 gcc make build-essential wget + rm -rf .cargo .gem openssl-1.0.2l .rustup openssl-1.0.2l.tar.gz sed -r -i 's/[#]*\s*(POSTGRESQL_SHARED_PRELOAD_LIBRARIES)\s*=\s*"(.*)"/\1="zombodb,\2"/;s/,"/"/' /opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh } From 09b1ada1e93b9756434ad5688276c01e874d7384 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Tue, 18 Jul 2023 23:55:35 +0530 Subject: [PATCH 103/104] add image analysis workflow Signed-off-by: Piyush Raj --- .github/workflows/image-analysis-comment.yml | 97 +++++++++ .github/workflows/image-analysis.yml | 112 ++++++++++ .github/workflows/smoke-test-packer.yml | 4 +- .github/workflows/smoke-test.yml | 36 +++- image_size.js | 212 +++++++++++++++++++ 5 files changed, 455 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/image-analysis-comment.yml create mode 100644 .github/workflows/image-analysis.yml create mode 100644 image_size.js diff --git a/.github/workflows/image-analysis-comment.yml b/.github/workflows/image-analysis-comment.yml new file mode 100644 index 00000000..dbf79c0b --- /dev/null +++ b/.github/workflows/image-analysis-comment.yml @@ -0,0 +1,97 @@ +# image-analysis.yml and image-analysis-comment.yml workflows, are used to calculate and comment the size difference between Dockerfile in the main branch and the changes made in a pull request. + +name: comment Image Analysis on PR + +# this workflow writes all the messages present in the comment artifact to the respective Pull Request so only one parallel run is required +concurrency: + group: ${{ github.workflow }} + +on: + workflow_run: + workflows: ["Image Analysis"] + types: + - completed + +jobs: + comment-on-pr: + runs-on: ubuntu-latest + if: > + github.event.workflow_run.conclusion == 'success' + permissions: + pull-requests: write + actions: write + steps: + - name: Download the comments list + id: download-artifact + uses: dawidd6/action-download-artifact@v2.27.0 + with: + workflow: image-analysis.yml + name: image-analysis-comments + check_artifacts: true + search_artifacts: true + if_no_artifact_found: fail + + # set up dependency for github scripts + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: | + npm install fs + + - name: Comment on PR + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + // Modified from https://github.com/kanga333/comment-hider + async function hideComment(issueNumber,userName,reason){ + const comments = await github.issues.listComments({ + owner:context.repo.owner, + repo:context.repo.repo, + issue_number: issueNumber + }); + const ids = []; + for (const r of comments.data) { + if (r.user !== null && r.user.login !== userName) { + continue; + } + ids.push(r.node_id); + } + ids.splice(-1,1); + for ( let id of ids){ + const resp = await github.graphql(` + mutation { + minimizeComment(input: {classifier: ${reason}, subjectId: "${id}"}) { + minimizedComment { + isMinimized + } + } + } + `); + + if (resp.errors) { + core.setFailed(`${resp.errors[0].message}`); + } + } + } + var fs = require('fs'); + var comments = JSON.parse(fs.readFileSync('./comments.json')); + console.log(comments); + while (comments.length > 0) { + const comment = comments[0]; + hideComment(comment.issue_number,'github-actions[bot]','OUTDATED') ; + await github.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: comment.issue_number, + body: comment.body + }); + comments.shift(); + } + + - name: Delete the comment list + uses: jimschubert/delete-artifacts-action@v1 + with: + log_level: "debug" + artifact_name: image-analysis-comments + min_bytes: "0" diff --git a/.github/workflows/image-analysis.yml b/.github/workflows/image-analysis.yml new file mode 100644 index 00000000..71336b23 --- /dev/null +++ b/.github/workflows/image-analysis.yml @@ -0,0 +1,112 @@ +# image-analysis.yml and image-analysis-comment.yml workflows, are used to calculate and comment the size difference between Dockerfiles in the main branch and the changes made in a pull request. +name: Image Analysis + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + workflow_run: + workflows: ["Smoke Test Docker Image"] + types: [completed] + +env: + ORG: timescaledev + TS_VERSION: main + PLATFORM: linux/amd64 + +jobs: + image-analysis: + name: PG${{ matrix.pg }}-${{ matrix.type }}-analysis + runs-on: ubuntu-latest + permissions: + actions: write #write permission is need to delete actions + strategy: + max-parallel: 1 # Running sequentially to add comments to the comment artifact without overwriting + fail-fast: false + matrix: + pg: [15] + type: ["bitnami", "normal"] + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Check out the source + uses: actions/checkout@v3 + + - name: Download image built from the PR + uses: dawidd6/action-download-artifact@v2.27.0 + with: + workflow: smoke-test.yml + name: ${{matrix.type}}-${{ github.event.workflow_run.head_sha }} + check_artifacts: true + search_artifacts: true + if_no_artifact_found: fail + skip_unpack: true # Docker images are too big to unpack with this action + - name: unzip the image artifact + run: | + unzip ${{matrix.type}}-${{ github.event.workflow_run.head_sha }}.zip + + - name: Load image into docker + run: | + cat ./${{matrix.type}}-${{ github.event.workflow_run.head_sha }}.tar | docker import - smoketest-image + + # set up dependency for github scripts + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: | + npm install fs + + - name: Download metrics of main branch + if: github.event.workflow_run.event == 'pull_request' + uses: dawidd6/action-download-artifact@v2.27.0 + with: + workflow: image-analysis.yml + name: image-metric-${{matrix.type}} + check_artifacts: true + search_artifacts: true + if_no_artifact_found: warn + + - name: Download comments artifact + if: github.event.workflow_run.event == 'pull_request' + uses: dawidd6/action-download-artifact@v2.27.0 + with: + workflow: image-analysis.yml + name: image-analysis-comments + check_artifacts: true + search_artifacts: true + workflow_conclusion: "" # Consider current successful runs of matrix jobs + if_no_artifact_found: warn + + - name: Analyse image + uses: actions/github-script@v6.4.1 + with: + workspace: ${{ github.workspace }} + image-type: ${{matrix.type}} + script: | + const fs = require('fs') + const script = require('./image_size.js') + console.log(script({github, context, exec,core,fs})) + + - name: Upload the updated comments + uses: actions/upload-artifact@v3 + if: github.event.workflow_run.event == 'pull_request' + with: + name: image-analysis-comments + path: comments.json + if-no-files-found: error + + - name: Upload metrics from main branch + uses: actions/upload-artifact@v3 + if: github.event.workflow_run.event == 'push' + with: + name: image-metric-${{matrix.type}} + path: image-metrics-${{matrix.type}}.json + if-no-files-found: error + + + - name: Delete docker image artifact + uses: jimschubert/delete-artifacts-action@v1 + with: + log_level: "debug" + artifact_name: ${{matrix.type}}-${{ github.event.workflow_run.head_sha }} + min_bytes: "0" diff --git a/.github/workflows/smoke-test-packer.yml b/.github/workflows/smoke-test-packer.yml index 157bdafb..e54c6e3e 100644 --- a/.github/workflows/smoke-test-packer.yml +++ b/.github/workflows/smoke-test-packer.yml @@ -17,7 +17,7 @@ env: jobs: smoketest-all: - name: PG${{ matrix.pg }}-${{ matrix.type }} + name: PG${{ matrix.pg }}-${{ matrix.type }}-paacker runs-on: ubuntu-latest strategy: fail-fast: false @@ -72,7 +72,7 @@ jobs: docker logs smoketest-container smoketest-individual: - name: PG${{ matrix.pg }}-${{ matrix.type }}-${{matrix.extention}} + name: PG${{ matrix.pg }}-${{ matrix.type }}-${{matrix.extention}}-packer runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 14c712bd..384f54e6 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -1,9 +1,9 @@ name: Smoke Test Docker Image -concurrency: +concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - + on: pull_request: push: @@ -17,14 +17,24 @@ env: jobs: smoketest: - name: PG${{ matrix.pg }}-${{ matrix.type }} + name: PG${{ matrix.pg }}-${{ matrix.type }}-docker runs-on: ubuntu-latest strategy: fail-fast: false matrix: pg: [15] - type: ['normal', 'bitnami'] + type: ["normal", "bitnami"] steps: + - name: set the correct commit sha + env: + EVENT: ${{github.event_name}} + run: | + if [ "$EVENT" == 'pull_request' ] + then + echo "commit=${{ github.event.pull_request.head.sha}}" >> "$GITHUB_ENV" + else + echo "commit=${{ github.sha}}" >> "$GITHUB_ENV" + fi - name: Check out the source uses: actions/checkout@v3 @@ -75,3 +85,21 @@ jobs: if: always() run: | docker logs smoketest-container + + - name: export the image + run: | + set -eux + export PGHOST=localhost + export PGUSER=postgres + export PGPASSWORD=test1234 + docker container stop smoketest-container || true + docker container rm smoketest-container || true + docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=${PGPASSWORD} --name smoketest-container smoketest-image + docker export smoketest-container > ${{matrix.type}}-${{ env.commit }}.tar + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{matrix.type}}-${{ env.commit }} + path: ./${{matrix.type}}-${{ env.commit }}.tar + retention-days: 1 diff --git a/image_size.js b/image_size.js new file mode 100644 index 00000000..0d4538f1 --- /dev/null +++ b/image_size.js @@ -0,0 +1,212 @@ +async function saveToFile(metrics, fs, path) { + const filePath = path; + const jsonData = JSON.stringify(metrics, null, 2); + + try { + await fs.promises.writeFile(filePath, jsonData); + console.log(`Metrics saved to ${filePath}`); + } catch (error) { + console.error(`Error saving metrics to ${filePath}: ${error}`); + } +} + +async function readFromFile(fs, path) { + const filePath = path; + try { + const jsonData = await fs.promises.readFile(filePath); + const metrics = JSON.parse(jsonData); + return metrics; + } catch (error) { + console.error(`Error reading metrics from ${filePath}: ${error}`); + return null; + } +} + +function parseSizeToBytes(value, unit) { + let bytes; + + switch (unit) { + case "KB": + bytes = value * 1024; + break; + case "MB": + bytes = value * 1024 * 1024; + break; + case "GB": + bytes = value * 1024 * 1024 * 1024; + break; + default: + throw new Error("Invalid size unit"); + } + + return bytes; +} + +function formatBytes(bytes, decimals = 2) { + if (bytes == null) return "Unknown"; + if (!+bytes) return "0 Bytes"; + + const k = 1024; + const dm = decimals < 0 ? 0 : decimals; + const sizes = [ + "Bytes", + "KiB", + "MiB", + "GiB", + "TiB", + "PiB", + "EiB", + "ZiB", + "YiB", + ]; + + const i = Math.floor(Math.log(bytes) / Math.log(k)); + + return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`; +} + +async function captureExecOutput( + exec, + command, + arguments, + ignoreExitCode = false +) { + let myOutput = ""; + let myError = ""; + + const options = {}; + options.listeners = { + stdout: (data) => { + myOutput += data.toString(); + }, + stderr: (data) => { + myError += data.toString(); + }, + }; + if (ignoreExitCode) { + options.ignoreReturnCode = true; + } + await exec.exec(command, arguments, options); + console.log(myOutput); + return myOutput; +} + +function calculatePercentageChange(currentValue, previousValue) { + if (!previousValue || previousValue === 0) { + return ""; + } + + const percentageChange = + ((currentValue - previousValue) / previousValue) * 100; + const colorIndicator = + percentageChange > 0 ? ":small_red_triangle:" : ":small_red_triangle_down:"; + console.log(percentageChange); + console.log(percentageChange.toFixed(2)); + const formattedChange = `[${percentageChange.toFixed( + 2 + )} % ${colorIndicator}]`; + return formattedChange; +} + +function createIssueComment( + imageType, + commitSHA, + imageSizeInBytes, + metricToCompare +) { + const currentSize = formatBytes(imageSizeInBytes); + const previousSize = formatBytes(metricToCompare?.imageSize || null); + const percentageChange = calculatePercentageChange( + imageSizeInBytes, + metricToCompare?.imageSize || null + ); + + const githubMessage = `### :bar_chart: ${imageType} Image Analysis (Commit: ${commitSHA} ) + #### Summary + + - **Current Size:** ${currentSize} ${percentageChange} + - **Previous Size :** ${previousSize}`; + + return githubMessage; +} + +async function getPullNumber(github, workflow_run, context, core) { + let head = `${workflow_run.actor.login}:${workflow_run.head_branch}`; + let prNumber = ( + await github.rest.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + head: head, + }) + ).data[0]?.number; + if (prNumber != undefined) { + console.log(`Found PR number ${prNumber} based on base and head branches`); + core.exportVariable("pull_request_number", prNumber); + } else { + core.setFailed( + `Action failed: Pull-Request Number NOt found with head: ${head}` + ); + } + + console.log(prNumber); + return prNumber; +} + +module.exports = async ({ github, context, exec, core, fs }) => { + let commitSHA = context.payload.workflow_run.head_sha; + let imageSize = await captureExecOutput(exec, "docker", [ + "image", + "list", + "--format", + "{{.Size}}", + "smoketest-image", + ]); + let imageSizeInBytes = parseSizeToBytes( + imageSize.trim().slice(0, -2), + imageSize.trim().slice(-2) + ); + let imageLayers = await captureExecOutput(exec, "docker", [ + "image", + "history", + "-H", + "--format", + "table {{.CreatedBy}} \\t\\t {{.Size}}", + "smoketest-image", + ]); + const imageType = core.getInput("image-type", { required: true }); + + const workspace = core.getInput("workspace", { required: true }); + + if (context.payload.workflow_run.event == "pull_request") { + const metricToCompare = + (await readFromFile(fs, "image-metrics-" + imageType + ".json")) || {}; + + let githubMessage = createIssueComment( + imageType, + commitSHA, + imageSizeInBytes, + metricToCompare + ); + let issueNumber = await getPullNumber( + github, + context.payload.workflow_run, + context, + core + ); + const comment = { + body: githubMessage, + issue_number: issueNumber, + }; + const commentQueue = (await readFromFile(fs, "comments.json")) || []; + commentQueue.push(comment); + console.log(commentQueue); + await saveToFile(commentQueue, fs, "comments.json"); + } else if (context.payload.workflow_run.event == "push") { + const updatedMetric = { + imageId: imageType, + imageSize: imageSizeInBytes, + }; + console.log(updatedMetric); + await saveToFile(updatedMetric, fs, "image-metrics-" + imageType + ".json"); + } +}; From 28873822bb0da11b46d153b49d2b52e47d8cbed2 Mon Sep 17 00:00:00 2001 From: Piyush Raj Date: Mon, 4 Sep 2023 11:08:40 +0530 Subject: [PATCH 104/104] add Disaster Recovery for AWS Signed-off-by: Piyush Raj --- README.md | 29 ++ barman/Dockerfile | 16 + barman/barman_entrypoint.sh | 23 ++ terraform/aws/config/barman/barman.conf | 24 ++ terraform/aws/config/barman/barman.d/pg.conf | 33 ++ terraform/aws/config/init/init.sh | 3 + terraform/aws/config/init/init.sql | 2 + terraform/aws/main.tf | 233 ++++++++++++ terraform/aws/playbook-warpsql.yml | 208 ++++++++++ terraform/aws/variables.tf | 53 +++ warpsql_ssh/Dockerfile | 379 +++++++++++++++++++ warpsql_ssh/Makefile | 109 ++++++ warpsql_ssh/entrypoint.sh | 23 ++ 13 files changed, 1135 insertions(+) create mode 100644 barman/Dockerfile create mode 100644 barman/barman_entrypoint.sh create mode 100644 terraform/aws/config/barman/barman.conf create mode 100644 terraform/aws/config/barman/barman.d/pg.conf create mode 100644 terraform/aws/config/init/init.sh create mode 100644 terraform/aws/config/init/init.sql create mode 100644 terraform/aws/main.tf create mode 100644 terraform/aws/playbook-warpsql.yml create mode 100644 terraform/aws/variables.tf create mode 100644 warpsql_ssh/Dockerfile create mode 100644 warpsql_ssh/Makefile create mode 100644 warpsql_ssh/entrypoint.sh diff --git a/README.md b/README.md index e033408a..a0248259 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,35 @@ packer build -var="image_repository=your_value" -var="image_tags=[tag1,tag2]" wa |[PgRepack](https://github.com/reorg/pg_repack) | `pg_repack` | |[PG Auto Failover](https://github.com/hapostgres/pg_auto_failover)| `pgautofailover` | |[HyperLogLog](https://github.com/citusdata/postgresql-hll) | `hll` | +### AWS +WarpSQL provides a streamlined approach to deploying and managing PostgreSQL databases on AWS EC2 instances, complete with a disaster recovery solution powered by Barman. +> **Warning** +WarpSQL is a work in progress, and the current setup allows public SSH access to instances, which might not be secure. + + +To get started, ensure you have your AWS credentials set up and Docker,Terraform installed. + +First, create Docker images using the provided Dockerfiles in the `barman` and `warpsql_ssh` directories. Once built, push these images to a public image repository. +Specify the repository where you pushed these Docker images by passing the repository URL as a variable in the Terraform command. + +To launch WarpSQL with Barman, run: +```shell +git clone https://github.com/Samagra-Development/WarpSQL.git +cd WarpSQL/terraform/aws +terraform apply -var img_warpsql= -var img_barman= +``` + +You can also set the password for the Postgres instance by using the `warpsql_password` variable in the Terraform script the default value is `warpsql`. + +This will initiate the deployment of three EC2 instances that include an Ansible controller, PostgreSQL and Barman Docker containers.These instances are provisioned on an Ubuntu Host OS and are fully configured, requiring no further setup on your end. + +During any subsequent launches of the WarpSQL instance, the data is recovered from the latest backup stored by Barman. + +To specify the size of each instance's disk, provide the desired size in gigabytes to the respective variables: `warpsql_disk_size`, `ansible_disk_size`, and `barman_disk_size` in the terraform script. + + +The Barman images are based on [ubc/barman-docker](https://github.com/ubc/barman-docker). By default, Barman performs a base backup according to the cron schedule `0 4 * * *`. If you need to modify this schedule, refer to the environment variables documentation at https://github.com/ubc/barman-docker#environment-variables. + ## Contribution You can contribute to the development of WarpSQL using both Gitpod and Codespaces. Follow the steps below to set up your development environment and make contributions: diff --git a/barman/Dockerfile b/barman/Dockerfile new file mode 100644 index 00000000..8cb5700d --- /dev/null +++ b/barman/Dockerfile @@ -0,0 +1,16 @@ +FROM ubcctlt/barman + +RUN apt-get update && \ + apt-get install -y openssh-server && \ + apt-get clean +# Permit root login via SSH +RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config +RUN sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config + +# SSH port +EXPOSE 22 +COPY barman_entrypoint.sh /barman_entrypoint.sh +RUN chmod +x /barman_entrypoint.sh +RUN mkdir -p /run/sshd +ENTRYPOINT ["tini","--","/barman_entrypoint.sh"] +CMD ["cron", "-L", "4", "-f"] \ No newline at end of file diff --git a/barman/barman_entrypoint.sh b/barman/barman_entrypoint.sh new file mode 100644 index 00000000..373e34b2 --- /dev/null +++ b/barman/barman_entrypoint.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# copy ssh keys to root and barman users +set -ex +if [ -d "/tmp/ssh/" ]; then + cp -R /tmp/ssh/ /root/.ssh/ +chmod 700 /root/.ssh +chmod 644 /root/.ssh/id_rsa.pub +chmod 600 /root/.ssh/id_rsa +cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys +chmod 600 /root/.ssh/authorized_keys +cp -R /tmp/ssh/* ~barman/.ssh/ +ls -alh ~barman/.ssh/ +ls -alh /tmp/ssh/ +ls -alh /root/.ssh/ +chown barman:barman -R ~barman/.ssh/ + su - barman -c "chmod 700 ~barman/.ssh \ + && chmod 644 ~barman/.ssh/id_rsa.pub \ + && chmod 600 ~barman/.ssh/id_rsa \ + && cat ~barman/.ssh/id_rsa.pub >> ~barman/.ssh/authorized_keys \ + && chmod 600 ~barman/.ssh/authorized_keys" +/usr/sbin/sshd +fi +exec /entrypoint.sh "$@" \ No newline at end of file diff --git a/terraform/aws/config/barman/barman.conf b/terraform/aws/config/barman/barman.conf new file mode 100644 index 00000000..a1e76567 --- /dev/null +++ b/terraform/aws/config/barman/barman.conf @@ -0,0 +1,24 @@ +; Commented lines show the default values + +[barman] +; archiver = off +; backup_method = rsync +; backup_directory = %(barman_home)s/%(name)s + +; This must be set to the BARMAN_DATA_DIR environment variable +barman_home = /var/lib/barman + +; barman_lock_directory = %(barman_home)s +compression = gzip +configuration_files_direct +ory = /etc/barman/barman.d +;last_backup_maximum_age = 1 week +log_file = /var/lib/barman/barman.log +log_level = DEBUG +;minimum_redundancy = 1 +network_compression = true +retention_policy = RECOVERY WINDOW of 4 WEEKS +; retention_policy_mode = auto +reuse_backup = link +streaming_archiver = on +; wal_retention_policy = main \ No newline at end of file diff --git a/terraform/aws/config/barman/barman.d/pg.conf b/terraform/aws/config/barman/barman.d/pg.conf new file mode 100644 index 00000000..c81e1b20 --- /dev/null +++ b/terraform/aws/config/barman/barman.d/pg.conf @@ -0,0 +1,33 @@ +[pg] +; active = true +; archiver = off +; archiver_batch_size = 0 +; backup_directory = %(barman_home)s/%(name)s +backup_method = postgres +; backup_options = +; basebackup_retry_sleep = 30 +; basebackup_retry_times = 0 +; basebackups_directory = %(backup_directory)s/base +; check_timeout = 30 +conninfo = host=pg user=barman dbname=postgres +description = 'warpsql database' +; disabled = false +; errors_directory = %(backup_directory)s/errors +; immediate_checkpoint = false +; incoming_wals_directory = %(backup_directory)s/incoming +; minimum_redundancy = 0 +; network_compression = false +; path_prefix = /usr/lib/postgresql/9.5 +; recovery_options = +; retention_policy_mode = auto +; ssh_command = 'ssh -i /home/barman/.ssh/pg.id_rsa postgres@pg' +slot_name = barman +create_slot = auto +streaming_archiver = on +; streaming_archiver_batch_size = 0 +; streaming_archiver_name = barman_receive_wal +; streaming_backup_name = barman_streaming_backup +streaming_conninfo = host=pg user=streaming_barman dbname=postgres +; streaming_wals_directory = %(backup_directory)s/streaming +; wal_retention_policy = main +; wals_directory = %(backup_directory)s/wals' \ No newline at end of file diff --git a/terraform/aws/config/init/init.sh b/terraform/aws/config/init/init.sh new file mode 100644 index 00000000..38ec38e4 --- /dev/null +++ b/terraform/aws/config/init/init.sh @@ -0,0 +1,3 @@ +# !/bin/bash +set -e +echo "host replication all all scram-sha-256" >> /var/lib/postgresql/data/pg_hba.conf \ No newline at end of file diff --git a/terraform/aws/config/init/init.sql b/terraform/aws/config/init/init.sql new file mode 100644 index 00000000..a98e1ba7 --- /dev/null +++ b/terraform/aws/config/init/init.sql @@ -0,0 +1,2 @@ +CREATE USER barman WITH SUPERUSER PASSWORD 'barman'; +CREATE USER streaming_barman WITH REPLICATION PASSWORD 'streaming_barman'; \ No newline at end of file diff --git a/terraform/aws/main.tf b/terraform/aws/main.tf new file mode 100644 index 00000000..29a67c2f --- /dev/null +++ b/terraform/aws/main.tf @@ -0,0 +1,233 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 4.42.0" + } + } + required_version = ">= 0.14.5" +} + +provider "aws" { + region = var.region +} + +locals { + ami_id = "ami-053b0d53c279acc90" #ubuntu 22.04 LTS +} + +resource "aws_vpc" "vpc" { + cidr_block = var.cidr_vpc + enable_dns_support = true + enable_dns_hostnames = true +} + +resource "aws_internet_gateway" "igw" { + vpc_id = aws_vpc.vpc.id +} + +resource "aws_subnet" "subnet_public" { + vpc_id = aws_vpc.vpc.id + cidr_block = var.cidr_subnet +} + +resource "aws_route_table" "rtb_public" { + vpc_id = aws_vpc.vpc.id + + route { + cidr_block = "0.0.0.0/0" + gateway_id = aws_internet_gateway.igw.id + } +} + +resource "aws_route_table_association" "rta_subnet_public" { + subnet_id = aws_subnet.subnet_public.id + route_table_id = aws_route_table.rtb_public.id +} + +resource "aws_security_group" "sg_22_80" { + name_prefix = "warpsql" + vpc_id = aws_vpc.vpc.id + # SSH access from the VPC + ingress { + from_port = 22 + to_port = 22 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + # postgres access + ingress { + from_port = 5432 + to_port = 5432 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + ingress { + from_port = 7000 + to_port = 7000 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } +} + +resource "tls_private_key" "warpsql-rsa" { + algorithm = "RSA" + rsa_bits = 4096 +} +resource "aws_key_pair" "deployer" { + key_name_prefix = "warpsql" + public_key = tls_private_key.warpsql-rsa.public_key_openssh +} +resource "local_sensitive_file" "pem_file" { + # write the private key to local for ssh access + filename = pathexpand("./${aws_key_pair.deployer.key_name}.pem") + file_permission = "600" + content = tls_private_key.warpsql-rsa.private_key_pem +} + +resource "aws_instance" "warpsql" { + ami = local.ami_id + instance_type = "t2.micro" + subnet_id = aws_subnet.subnet_public.id + vpc_security_group_ids = [aws_security_group.sg_22_80.id] + associate_public_ip_address = true + key_name = aws_key_pair.deployer.key_name + root_block_device { + volume_size = var.warpsql_disk_size + } + user_data = <> /usr/local/share/postgresql/postgresql.conf.sample + +# Adding PG Vector + +RUN cd /tmp +RUN apk add --no-cache --virtual .build-deps \ + coreutils \ + dpkg-dev dpkg \ + gcc \ + git \ + krb5-dev \ + libc-dev \ + llvm15 \ + make \ + cmake \ + clang15 \ + util-linux-dev \ + && git clone --branch v0.4.1 https://github.com/pgvector/pgvector.git \ + && cd /pgvector \ + && ls \ + && make \ + && make install + +## Adding Citus + +# Install Citus dependencies +RUN apk add --no-cache --virtual .citus-deps \ + curl \ + jq + +# Install Citus +ARG CITUS_VERSION +RUN set -ex \ + && apk add --no-cache --virtual .citus-build-deps \ + gcc \ + libc-dev \ + make \ + curl-dev \ + lz4-dev \ + zstd-dev \ + clang \ + krb5-dev \ + icu-dev \ + libxslt-dev \ + libxml2-dev \ + llvm15-dev \ + && CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" \ + && curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" \ + && tar -C /tmp -xvf /tmp/citus.tar.gz \ + && chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} \ + && cd /tmp/citus-${CITUS_VERSION} \ + && PATH="/usr/local/pgsql/bin:$PATH" ./configure \ + && make \ + && make install \ + && cd ~ \ + && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \ + && apk del .citus-deps .citus-build-deps + + +ARG POSTGIS_VERSION +ARG POSTGIS_SHA256 + +RUN set -eux \ + \ + && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ + set -eux ; \ + export GEOS_ALPINE_VER=3.11 ; \ + export GDAL_ALPINE_VER=3.6.4-r4 ; \ + export PROJ_ALPINE_VER=9.2 ; \ + elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ + set -eux ; \ + export GEOS_ALPINE_VER=3.8 ; \ + export GDAL_ALPINE_VER=3.2 ; \ + export PROJ_ALPINE_VER=7.2 ; \ + \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.14/main' >> /etc/apk/repositories ; \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.14/community' >> /etc/apk/repositories ; \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.13/main' >> /etc/apk/repositories ; \ + echo 'https://dl-cdn.alpinelinux.org/alpine/v3.13/community' >> /etc/apk/repositories ; \ + \ + else \ + set -eux ; \ + echo ".... unknown \$POSTGIS_VERSION ...." ; \ + exit 1 ; \ + fi \ + \ + && apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + openssl \ + tar \ + \ + && wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/${POSTGIS_VERSION}.tar.gz" \ + && echo "${POSTGIS_SHA256} *postgis.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/postgis \ + && tar \ + --extract \ + --file postgis.tar.gz \ + --directory /usr/src/postgis \ + --strip-components 1 \ + && rm postgis.tar.gz \ + \ + && apk add --no-cache --virtual .build-deps \ + \ + gdal-dev~=${GDAL_ALPINE_VER} \ + geos-dev~=${GEOS_ALPINE_VER} \ + proj-dev~=${PROJ_ALPINE_VER} \ + \ + autoconf \ + automake \ + clang-dev \ + clang15 \ + cunit-dev \ + file \ + g++ \ + gcc \ + gettext-dev \ + git \ + json-c-dev \ + libtool \ + libxml2-dev \ + llvm-dev \ + llvm15 \ + make \ + pcre-dev \ + perl \ + protobuf-c-dev \ + \ +# build PostGIS + \ + && cd /usr/src/postgis \ + && gettextize \ + && ./autogen.sh \ + && ./configure \ + --with-pcredir="$(pcre-config --prefix)" \ + && make -j$(nproc) \ + && make install \ + \ +# add .postgis-rundeps + && apk add --no-cache --virtual .postgis-rundeps \ + \ + gdal~=${GDAL_ALPINE_VER} \ + geos~=${GEOS_ALPINE_VER} \ + proj~=${PROJ_ALPINE_VER} \ + \ + json-c \ + libstdc++ \ + pcre \ + protobuf-c \ + \ + ca-certificates \ +# clean + && cd / \ + && rm -rf /usr/src/postgis \ + && apk del .fetch-deps .build-deps + +ENV RUSTFLAGS="-C target-feature=-crt-static" +ARG PG_VER +RUN apk add --no-cache --virtual .zombodb-build-deps \ + git \ + curl \ + bash \ + ruby-dev \ + ruby-etc \ + musl-dev \ + make \ + gcc \ + coreutils \ + util-linux-dev \ + musl-dev \ + openssl-dev \ + clang15 \ + tar \ + && gem install --no-document fpm \ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \ + && PATH=$HOME/.cargo/bin:$PATH \ + && cargo install cargo-pgrx --version 0.9.3 \ + && cargo pgrx init --${PG_VER}=$(which pg_config) \ + && git clone https://github.com/zombodb/zombodb.git \ + && cd ./zombodb \ + && cargo pgrx install --release \ + && cd .. \ + && rm -rf ./zombodb \ + && apk del .zombodb-build-deps + +## Adding pg_repack +ARG PG_REPACK_VERSION +RUN set -eux \ + && apk add --no-cache --virtual .pg_repack-build-deps \ + openssl-dev \ + zstd-dev \ + lz4-dev \ + zlib-dev \ + make \ + clang15 \ + gawk \ + llvm15 \ + gcc \ + musl-dev \ +# build pg_repack + && wget -O /tmp/pg_repack-${PG_REPACK_VERSION}.zip "https://api.pgxn.org/dist/pg_repack/${PG_REPACK_VERSION}/pg_repack-${PG_REPACK_VERSION}.zip" \ + && unzip /tmp/pg_repack-${PG_REPACK_VERSION}.zip -d /tmp \ + && cd /tmp/pg_repack-${PG_REPACK_VERSION} \ + && make \ + && make install \ +# clean + && cd / \ + && rm -rf /tmp/pg_repack-${PG_REPACK_VERSION} /tmp/pg_repack.zip \ + && apk del .pg_repack-build-deps + +# Adding pgautofailover +ARG PG_AUTO_FAILOVER_VERSION +RUN set -eux \ + && apk add --no-cache --virtual .pg_auto_failover-build-deps \ + make \ + gcc \ + musl-dev \ + krb5-dev \ + openssl-dev \ + clang15 \ + ncurses-dev \ + linux-headers \ + zstd-dev \ + lz4-dev \ + zlib-dev \ + libedit-dev \ + libxml2-utils \ + libxslt-dev \ + llvm15 \ +# build pg_auto_failover + && wget -O /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION}.zip "https://github.com/hapostgres/pg_auto_failover/archive/refs/tags/v${PG_AUTO_FAILOVER_VERSION}.zip" \ + && unzip /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION}.zip -d /tmp \ + && ls -alh /tmp \ + && cd /tmp/pg_auto_failover-${PG_AUTO_FAILOVER_VERSION} \ + && make \ + && make install \ +# clean + && cd / \ + && rm -rf /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION} /tmp/pg_auto_failove-${PG_AUTO_FAILOVER_VERSION}.zip \ + && apk del .pg_auto_failover-build-deps + + +## Adding postgresql-hll +ARG POSTGRES_HLL_VERSION +RUN set -eux \ + && apk add --no-cache --virtual .postgresql-hll-build-deps \ + openssl-dev \ + zstd-dev \ + lz4-dev \ + zlib-dev \ + make \ + git \ + clang15 \ + gawk \ + llvm15 \ + g++ \ + musl-dev \ +# build postgresql-hll + && wget -O /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip "https://github.com/citusdata/postgresql-hll/archive/refs/tags/v${POSTGRES_HLL_VERSION}.zip" \ + && unzip /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip -d /tmp \ + && cd /tmp/postgresql-hll-${POSTGRES_HLL_VERSION} \ + && make \ + && make install \ +# clean + && cd / \ + && rm -rf /tmp/postgresql-hll-${POSTGRES_HLL_VERSION} /tmp/postgresql-hll-${POSTGRES_HLL_VERSION}.zip \ + && apk del .postgresql-hll-build-deps + + +# install barman client +RUN apk add --no-cache \ + gcc \ + python3 \ + rsync \ + py3-pip \ + python3-dev \ + git \ + openssh \ + musl-dev \ + && cd /tmp \ + && git clone https://github.com/EnterpriseDB/barman \ + && cd barman \ + && ./setup.py install \ + && ./setup.py build \ + cd / \ + && rm -rf /tmp/barman + +# Install SSH server +RUN apk add --no-cache openssh-server + + +# Permit root login via SSH +RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config + +# Unloack the postgres account for ssh +RUN passwd -u postgres + +# SSH port +EXPOSE 22 + +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT [ "/entrypoint.sh" ] +CMD ["postgres"] diff --git a/warpsql_ssh/Makefile b/warpsql_ssh/Makefile new file mode 100644 index 00000000..181317ff --- /dev/null +++ b/warpsql_ssh/Makefile @@ -0,0 +1,109 @@ +NAME=postgres +# Default is to timescaledev to avoid unexpected push to the main repo +# Set ORG to timescale in the caller +ORG=samagragovernance +PG_VER=pg15 +CITUS_VERSION="11.2.0" +POSTGIS_VERSION=3.3.2 +PG_REPACK_VERSION = 1.4.8 +PG_AUTO_FAILOVER_VERSION = 2.0 +POSTGRES_HLL_VERSION = 2.17 +POSTGIS_SHA256=2a6858d1df06de1c5f85a5b780773e92f6ba3a5dc09ac31120ac895242f5a77b +PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-) +TS_VERSION=main +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="samagragovernance/postgres:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)$(PREV_EXTRA)" +PREV_IMAGE=$(shell if docker pull "$(PREV_TS_IMAGE)" >/dev/null 2>&1; then echo "$(PREV_TS_IMAGE)"; else echo "timescale/timescaledb:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)$(PREV_EXTRA)"; fi ) +# Beta releases should not be tagged as latest, so BETA is used to track. +BETA=$(findstring rc,$(TS_VERSION)) +PLATFORM=linux/amd64,linux/arm64 + +# PUSH_MULTI can be set to nothing for dry-run without pushing during multi-arch build +PUSH_MULTI=--push +TAG_VERSION=$(ORG)/$(NAME):$(TS_VERSION)-$(PG_VER) +TAG_LATEST=$(ORG)/$(NAME):latest-$(PG_VER) +TAG=-t $(TAG_VERSION) $(if $(BETA),,-t $(TAG_LATEST)) +TAG_OSS=-t $(TAG_VERSION)-oss $(if $(BETA),,-t $(TAG_LATEST)-oss) + +DOCKER_BUILD_ARGS = --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 PG_REPACK_VERSION=$(PG_REPACK_VERSION) \ + --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ + --build-arg PG_AUTO_FAILOVER_VERSION=$(PG_AUTO_FAILOVER_VERSION) \ + --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \ + --build-arg POSTGIS_SHA256=$(POSTGIS_SHA256) \ + --build-arg POSTGRES_HLL_VERSION=$(POSTGRES_HLL_VERSION) + +default: image + +.multi_$(TS_VERSION)_$(PG_VER)_oss: Dockerfile + test -n "$(TS_VERSION)" # TS_VERSION + test -n "$(PREV_TS_VERSION)" # PREV_TS_VERSION + docker buildx create --platform $(PLATFORM) --name multibuild --use + docker buildx inspect multibuild --bootstrap + docker buildx build --platform $(PLATFORM) \ + --build-arg TS_VERSION=$(TS_VERSION) \ + --build-arg PG_VERSION=$(PG_VER_NUMBER) \ + --build-arg PREV_IMAGE=$(PREV_IMAGE) \ + --build-arg OSS_ONLY=" -DAPACHE_ONLY=1" \ + $(TAG_OSS) $(PUSH_MULTI) . + touch .multi_$(TS_VERSION)_$(PG_VER)_oss + docker buildx rm multibuild + +.multi_$(TS_VERSION)_$(PG_VER): Dockerfile + test -n "$(TS_VERSION)" # TS_VERSION + test -n "$(PREV_TS_VERSION)" # PREV_TS_VERSION + test -n "$(PREV_IMAGE)" # PREV_IMAGE + docker buildx create --platform $(PLATFORM) --name multibuild --use + docker buildx inspect multibuild --bootstrap + docker buildx build --platform $(PLATFORM) \ + --build-arg TS_VERSION=$(TS_VERSION) \ + --build-arg PREV_IMAGE=$(PREV_IMAGE) \ + --build-arg PG_VERSION=$(PG_VER_NUMBER) \ + $(TAG) $(PUSH_MULTI) . + touch .multi_$(TS_VERSION)_$(PG_VER) + docker buildx rm multibuild + +.build_$(TS_VERSION)_$(PG_VER)_oss: Dockerfile + docker build --build-arg OSS_ONLY=" -DAPACHE_ONLY=1" --build-arg PG_VERSION=$(PG_VER_NUMBER) $(TAG_OSS) . + touch .build_$(TS_VERSION)_$(PG_VER)_oss + +.build_$(TS_VERSION)_$(PG_VER): Dockerfile + docker build $(DOCKER_BUILD_ARGS) $(TAG) . + touch .build_$(TS_VERSION)_$(PG_VER) + +build-docker-cache: Dockerfile + docker buildx create --use --driver=docker-container + docker buildx build --progress=plain --load --cache-to "type=gha,mode=max" --cache-from type=gha $(DOCKER_BUILD_ARGS) $(TAG) . + touch .build_$(TS_VERSION)_$(PG_VER) + +image: .build_$(TS_VERSION)_$(PG_VER) + +oss: .build_$(TS_VERSION)_$(PG_VER)_oss + +push: image + docker push $(TAG_VERSION) + if [ -z "$(BETA)" ]; then \ + docker push $(TAG_LATEST); \ + fi + +push-oss: oss + docker push $(TAG_VERSION)-oss + if [ -z "$(BETA)" ]; then \ + docker push $(TAG_LATEST)-oss; \ + fi + +multi: .multi_$(TS_VERSION)_$(PG_VER) + +multi-oss: .multi_$(TS_VERSION)_$(PG_VER)_oss + +all: multi multi-oss + +clean: + rm -f *~ .build_* .multi_* + -docker buildx rm multibuild + +.PHONY: default image push push-oss oss multi multi-oss clean all build-docker-cache diff --git a/warpsql_ssh/entrypoint.sh b/warpsql_ssh/entrypoint.sh new file mode 100644 index 00000000..c098836f --- /dev/null +++ b/warpsql_ssh/entrypoint.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# copy ssh keys to root and postgres users +set -e +if [ -d "/tmp/ssh/" ]; then + cp -R /tmp/ssh/ /root/.ssh/ + chmod 700 /root/.ssh + chmod 644 /root/.ssh/id_rsa.pub + chmod 600 /root/.ssh/id_rsa + cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys + chmod 600 /root/.ssh/authorized_keys + cp -R /tmp/ssh/ ~postgres/.ssh/ + echo -e > ~postgres/.ssh/config "Host *\n\tStrictHostKeyChecking no" # prevent barman commands failing when using ssh + chown postgres:postgres -R ~postgres/.ssh/ + su - postgres -c "chmod 700 ~postgres/.ssh \ + && chmod 644 ~postgres/.ssh/id_rsa.pub \ + && chmod 600 ~postgres/.ssh/id_rsa \ + && chmod 600 ~postgres/.ssh/config \ + && cat ~postgres/.ssh/id_rsa.pub >> ~postgres/.ssh/authorized_keys \ + && chmod 600 ~postgres/.ssh/authorized_keys" +/usr/sbin/sshd #start the ssh server +fi + +exec /usr/local/bin/docker-entrypoint.sh "$@" \ No newline at end of file