From 4e28d2a40d8cd4f4abfee6d0baf4e6bbacc051a9 Mon Sep 17 00:00:00 2001 From: Rub21 Date: Fri, 7 Feb 2025 14:32:58 -0500 Subject: [PATCH] Add pg_cron extension in the tiler db --- images/tiler-db/Dockerfile | 2 +- images/tiler-db/scripts/update_db.sh | 3 ++- images/tiler-db/scripts/update_postgresql.sh | 26 -------------------- images/tiler-imposm/scripts/natural_earth.sh | 4 +-- values.staging.template.yaml | 4 +-- 5 files changed, 7 insertions(+), 32 deletions(-) delete mode 100644 images/tiler-db/scripts/update_postgresql.sh diff --git a/images/tiler-db/Dockerfile b/images/tiler-db/Dockerfile index b5aa28ed..951d8344 100644 --- a/images/tiler-db/Dockerfile +++ b/images/tiler-db/Dockerfile @@ -19,7 +19,7 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh RUN mkdir -p /docker-entrypoint-initdb.d COPY ./scripts/update_db.sh /docker-entrypoint-initdb.d/ -COPY ./scripts/update_postgresql.sh /docker-entrypoint-initdb.d/ +# COPY ./scripts/update_postgresql.sh /docker-entrypoint-initdb.d/ WORKDIR /usr/local/datefunctions RUN git clone https://github.com/OpenHistoricalMap/DateFunctions-plpgsql.git . diff --git a/images/tiler-db/scripts/update_db.sh b/images/tiler-db/scripts/update_db.sh index 0a4be078..efee2766 100644 --- a/images/tiler-db/scripts/update_db.sh +++ b/images/tiler-db/scripts/update_db.sh @@ -1,10 +1,11 @@ #!/bin/sh set -e -# Add hstore into the DB +# Add hstore and pg_cron into the DB for DB in template_postgis "$POSTGRES_DB" "${@}"; do echo "Updating extensions '$DB'" psql --dbname="$DB" -c " CREATE EXTENSION IF NOT EXISTS hstore; + CREATE EXTENSION IF NOT EXISTS pg_cron; " done diff --git a/images/tiler-db/scripts/update_postgresql.sh b/images/tiler-db/scripts/update_postgresql.sh deleted file mode 100644 index d9afacfa..00000000 --- a/images/tiler-db/scripts/update_postgresql.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# max_connections -if [[ "${POSTGRES_DB_MAX_CONNECTIONS}X" != "X" ]]; then - sed -i -e"s/^.*max_connections =.*$/max_connections = $POSTGRES_DB_MAX_CONNECTIONS/" $PGDATA/postgresql.conf -fi - -# shared_buffers -if [[ "${POSTGRES_DB_SHARED_BUFFERS}X" != "X" ]]; then - sed -i -e"s/^.*shared_buffers =.*$/shared_buffers = $POSTGRES_DB_SHARED_BUFFERS/" $PGDATA/postgresql.conf -fi - -# work_mem -if [[ "${POSTGRES_DB_WORK_MEM}X" != "X" ]]; then - sed -i -e"s/^.*#work_mem =.*$/work_mem = $POSTGRES_DB_WORK_MEM/" $PGDATA/postgresql.conf -fi - -# maintenance_work_mem -if [[ "${POSTGRES_DB_MAINTENANCE_WORK_MEM}X" != "X" ]]; then - sed -i -e"s/^.*maintenance_work_mem =.*$/maintenance_work_mem = $POSTGRES_DB_MAINTENANCE_WORK_MEM/" $PGDATA/postgresql.conf -fi - -# effective_cache_size -if [[ "${POSTGRES_DB_EFFECTIVE_CACHE_SIZE}X" != "X" ]]; then - sed -i -e"s/^.*effective_cache_size =.*$/effective_cache_size = $POSTGRES_DB_EFFECTIVE_CACHE_SIZE/" $PGDATA/postgresql.conf -fi diff --git a/images/tiler-imposm/scripts/natural_earth.sh b/images/tiler-imposm/scripts/natural_earth.sh index b6ad5102..ba1a9683 100755 --- a/images/tiler-imposm/scripts/natural_earth.sh +++ b/images/tiler-imposm/scripts/natural_earth.sh @@ -66,7 +66,7 @@ psql "dbname='postgres' host='$DB_HOST' port='$DB_PORT' user='$DB_USER' password # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_110m_geography_marine_polys.zip" # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_110m_geography_regions_polys.zip" # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_110m_rivers_lake_centerlines.zip" - # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_110m_lakes.zip" + "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_110m_lakes.zip" # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_110m_glaciated_areas.zip" # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_110m_land.zip" # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_110m_ocean.zip" @@ -75,7 +75,7 @@ psql "dbname='postgres' host='$DB_HOST' port='$DB_PORT' user='$DB_USER' password # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_50m_admin_0_boundary_lines_maritime_indicator.zip" # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_50m_admin_0_countries.zip" # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_50m_admin_0_map_subunits.zip" - # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_50m_admin_1_states_provinces_lakes.zip" + "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_50m_admin_1_states_provinces_lakes.zip" # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_50m_admin_1_states_provinces_lines.zip" # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_50m_populated_places.zip" # "https://osmseed-staging.s3.amazonaws.com/naciscdn/ne_50m_geographic_lines.zip" diff --git a/values.staging.template.yaml b/values.staging.template.yaml index 04e49f54..d8e70048 100644 --- a/values.staging.template.yaml +++ b/values.staging.template.yaml @@ -406,7 +406,7 @@ osm-seed: mountPath: /var/lib/postgresql/data subPath: postgresql-d # In case cloudProvider: aws - AWS_ElasticBlockStore_volumeID : vol-045cab2cfc3b5154d + AWS_ElasticBlockStore_volumeID : vol-0d054a1e92fe69168 AWS_ElasticBlockStore_size: 100Gi resources: enabled: false @@ -503,7 +503,7 @@ osm-seed: accessMode: ReadWriteOnce mountPath: /mnt/data # In case cloudProvider: aws - AWS_ElasticBlockStore_volumeID: vol-05b4435bac8bb37b4 + AWS_ElasticBlockStore_volumeID: vol-09f7acdae9e9f45a0 AWS_ElasticBlockStore_size: 50Gi resources: enabled: false