Skip to content

Commit d6f06ed

Browse files
authored
Update osm-seed to use PG 17 (#381)
* Update taginfo cronjob to use karpenter nodes * Add serviceAccount for taginfo cronjob * Update data processor for cronjob - taginfo * Update config for PGDATA - PG17 * Update replication job - osmosis version * Update minute replication container to use osmdbt * Update to pg17 * Update minute replication job * Update script to generate minute replication * Update liveness for minute replication * Update database to pg17 * Add zstd for backup compression * Use backup dump without compression * Update config to backup pg-17 * Update script to generate planet dump and pg client * Update script for minute replication * Fixed issue to backup database * Update containers
1 parent 55961ad commit d6f06ed

File tree

24 files changed

+868
-660
lines changed

24 files changed

+868
-660
lines changed

images/backup-restore/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
FROM python:3.9.9-slim
22

3-
# Install Postgres client, GCP CLI, and Azure CLI
3+
# Install Postgres client 17, GCP CLI, Azure CLI, and ZSTD compression tools
44
RUN apt-get update \
55
&& apt-get install -y curl apt-transport-https lsb-release gnupg \
66
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
77
&& curl -L https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
88
&& curl -sL https://aka.ms/InstallAzureCLIDeb | bash \
99
&& apt-get update \
10-
&& apt-get install -y postgresql-client-14 wget \
10+
&& apt-get install -y postgresql-client-17 wget zstd \
1111
&& apt-get clean \
1212
&& rm -rf /var/lib/apt/lists/*
1313

images/db/Dockerfile

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,39 @@
1-
FROM postgres:14
2-
RUN apt-get update \
3-
&& apt-get install -y \
4-
postgresql-server-dev-14 \
5-
make \
1+
# Stage 1: Compilar el plugin para PostgreSQL 17
2+
FROM postgres:17 AS builder
3+
4+
# Instalar dependencias de compilación
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
ca-certificates \
67
build-essential \
7-
postgresql-14-postgis-3 \
8-
&& apt-get clean && rm -rf /var/lib/apt/lists/*
8+
cmake \
9+
git \
10+
libboost-program-options-dev \
11+
libbz2-dev \
12+
libexpat1-dev \
13+
libosmium2-dev \
14+
libprotozero-dev \
15+
libyaml-cpp-dev \
16+
libpqxx-dev \
17+
postgresql-server-dev-17 \
18+
&& update-ca-certificates \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
# Clonar y compilar el plugin osmdbt para PostgreSQL 17
22+
RUN git clone https://github.com/openstreetmap/osmdbt.git /tmp/osmdbt && \
23+
cd /tmp/osmdbt && \
24+
git checkout v0.9 && \
25+
cd postgresql-plugin && \
26+
mkdir -p build && cd build && \
27+
cmake .. && \
28+
make
29+
30+
FROM postgres:17
31+
32+
COPY --from=builder /tmp/osmdbt/postgresql-plugin/build/osm-logical.so /usr/lib/postgresql/17/lib/osm-logical.so
33+
34+
RUN ln -s /usr/lib/postgresql/17/lib/osm-logical.so /usr/lib/postgresql/17/lib/osm_logical.so
935

10-
ADD functions/functions.sql /usr/local/share/osm-db-functions.sql
11-
ADD docker_postgres.sh /docker-entrypoint-initdb.d/
12-
RUN mkdir -p db
13-
RUN mkdir -p lib
14-
ADD functions/ db/functions/
15-
ADD lib/quad_tile/ lib/quad_tile/
16-
RUN make -C db/functions/
17-
RUN chown -R postgres lib/
18-
RUN chown -R postgres db/
36+
RUN chown postgres:postgres /usr/lib/postgresql/17/lib/osm-logical.so && \
37+
chown postgres:postgres /usr/lib/postgresql/17/lib/osm_logical.so && \
38+
chmod 755 /usr/lib/postgresql/17/lib/osm-logical.so && \
39+
chmod 755 /usr/lib/postgresql/17/lib/osm_logical.so

images/db/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Docker setup for postgres database instance
22

3-
The OSM `API server` database - builds off a postgres 10 docker image, and installs custom functions needed by `openstreetmap`.
3+
The OSM `API server` database - builds off a **PostgreSQL 17** docker image, and installs custom functions needed by `openstreetmap`.
4+
5+
The database includes the **osmdbt plugin v0.9** for logical replication support.
46

57
The functions currently are copied over from the `openstreetmap-website` code-base. There should ideally be a better way to do this.
68

@@ -35,3 +37,8 @@ In order to run this container we need environment variables, these can be found
3537
```sh
3638
pg_isready -h 127.0.0.1 -p 5432
3739
```
40+
41+
### Installed Components
42+
43+
- **PostgreSQL**: 17
44+
- **osmdbt plugin**: v0.9 (osm_logical replication plugin)

images/db/docker_postgres.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

images/db/functions/Makefile

Lines changed: 0 additions & 24 deletions
This file was deleted.

images/db/functions/functions.sql

Lines changed: 0 additions & 43 deletions
This file was deleted.

images/db/functions/maptile.c

Lines changed: 0 additions & 36 deletions
This file was deleted.

images/db/functions/quadtile.c

Lines changed: 0 additions & 25 deletions
This file was deleted.

images/db/functions/xid_to_int4.c

Lines changed: 0 additions & 23 deletions
This file was deleted.

images/db/lib/quad_tile/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)