Skip to content

Commit

Permalink
chore: Remove pg_cron (#1291)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippemnoel authored Jun 25, 2024
1 parent 019fcd9 commit 9361c5c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 28 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ ParadeDB is currently in Public Beta. Star and watch this repository to get noti
- [x] Kubernetes Helm chart & [deployment instructions](https://docs.paradedb.com/deploy/helm)
- [x] Specialized Workloads
- [x] Support for geospatial data with [PostGIS](https://github.com/postgis/postgis)
- [x] Support for cron jobs with [pg_cron](https://github.com/citusdata/pg_cron)

## Get Started

Expand Down
9 changes: 0 additions & 9 deletions docker/01_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ PGPASSWORD=$SUPERUSER_PASSWORD psql -U postgres -d "$POSTGRESQL_DATABASE" -c "GR

echo "Installing PostgreSQL extensions..."

# This setting is required by pg_cron to CREATE EXTENSION properly. It can only be installed in one database, so we install it in
# the user database. Creating the `pg_cron` extension requires a restart of the PostgreSQL server, so we can't do it here. A restart
# is already part of the launch process of the Bitnami PostgreSQL container post this point, so the extension can be created by the
# user after the container has been launched.
#
# For simplicity, and because we don't expect most users to use pg_cron, we don't force a restart here and we don't pre-create the
# extension, leaving it to the user to do it if they want to use it.
echo "cron.database_name = '$POSTGRESQL_DATABASE'" >> "/opt/bitnami/postgresql/conf/postgresql.conf"

# Pre-install all required PostgreSQL extensions to the user database via the `postgres` superuser
PGPASSWORD=$SUPERUSER_PASSWORD psql -U postgres -d "$POSTGRESQL_DATABASE" -c "CREATE EXTENSION IF NOT EXISTS pg_search CASCADE;"
PGPASSWORD=$SUPERUSER_PASSWORD psql -U postgres -d "$POSTGRESQL_DATABASE" -c "CREATE EXTENSION IF NOT EXISTS pg_lakehouse CASCADE;"
Expand Down
19 changes: 1 addition & 18 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,6 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
cargo pgrx package --pg-config "/usr/lib/postgresql/${PG_VERSION_MAJOR}/bin/pg_config"; \
fi

######################
# pg_cron
######################

FROM builder as builder-pg_cron

# Build the extension
WORKDIR /tmp
RUN git clone --branch v1.6.2 https://github.com/citusdata/pg_cron.git
WORKDIR /tmp/pg_cron
RUN echo "trusted = true" >> pg_cron.control && \
make clean -j && \
make USE_PGXS=1 -j

######################
# pg_ivm
######################
Expand Down Expand Up @@ -175,9 +161,6 @@ COPY --from=builder-pgvector /tmp/pgvector/*.control /opt/bitnami/postgresql/sha
COPY --from=builder-pgvector /tmp/pgvector/sql/*.sql /opt/bitnami/postgresql/share/extension/
COPY --from=builder-pgvectorscale /tmp/pgvectorscale/pgvectorscale/target/release/vectorscale-pg${PG_VERSION_MAJOR}/usr/lib/postgresql/${PG_VERSION_MAJOR}/lib/* /opt/bitnami/postgresql/lib/
COPY --from=builder-pgvectorscale /tmp/pgvectorscale/pgvectorscale/target/release/vectorscale-pg${PG_VERSION_MAJOR}/usr/share/postgresql/${PG_VERSION_MAJOR}/extension/* /opt/bitnami/postgresql/share/extension/
COPY --from=builder-pg_cron /tmp/pg_cron/*.so /opt/bitnami/postgresql/lib/
COPY --from=builder-pg_cron /tmp/pg_cron/*.control /opt/bitnami/postgresql/share/extension/
COPY --from=builder-pg_cron /tmp/pg_cron/*.sql /opt/bitnami/postgresql/share/extension/
COPY --from=builder-pg_ivm /tmp/pg_ivm/*.so /opt/bitnami/postgresql/lib/
COPY --from=builder-pg_ivm /tmp/pg_ivm/*.control /opt/bitnami/postgresql/share/extension/
COPY --from=builder-pg_ivm /tmp/pg_ivm/*.sql /opt/bitnami/postgresql/share/extension/
Expand All @@ -198,7 +181,7 @@ COPY ./docker/01_bootstrap.sh /docker-entrypoint-initdb.d/

# Configure shared_preload_libraries
# Note: pgaudit is needed here as it comes pre-packaged in the Bitnami image
ENV POSTGRESQL_SHARED_PRELOAD_LIBRARIES="pgaudit,pg_cron,pg_search,pg_lakehouse"
ENV POSTGRESQL_SHARED_PRELOAD_LIBRARIES="pgaudit,pg_lakehouse,pg_search"

# We set a default password to enable users to get started quickly, as it is a required
# environment variable for the Bitnami image.
Expand Down

0 comments on commit 9361c5c

Please sign in to comment.