Skip to content

Commit 733ebd7

Browse files
Merge pull request #396 from rustprooflabs/adjust-for-osm2pgsql-replication-check
Adjust for changes to osm2pgsql RE replication initialization
2 parents 0498f4b + 6bd6726 commit 733ebd7

File tree

3 files changed

+32
-39
lines changed

3 files changed

+32
-39
lines changed

Makefile

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ RAM=2
3030
# to make unit test results visible at the end.
3131
.PHONY: all
3232
all: docker-exec-region docker-exec-input-file \
33-
docker-exec-replication-w-input-file \
3433
docker-exec-default unit-tests
3534

3635
.PHONY: docker-clean
@@ -115,44 +114,6 @@ docker-exec-input-file: build-run-docker
115114

116115

117116

118-
.PHONE: docker-exec-replication-w-input-file
119-
docker-exec-replication-w-input-file: build-run-docker
120-
# NOTE: This step tests --replication file for an initial load.
121-
# It does **NOT** test the actual replication process for updating data
122-
# using replication mode. Testing actual replication over time in this format
123-
# will not be trivial. The historic file used (2021-01-13) cannot be used
124-
# to seed a replication process, there is a time limit in upstream software
125-
# that requires more recency to the source data. This also cannot simply
126-
# download a file from Geofabrik, as the "latest" file will not have a diff
127-
# to apply so also will not test the actual replication.
128-
#
129-
# Open a PR, Issue, discussion on https://github.com/rustprooflabs/pgosm-flex
130-
# if you have an idea on how to implement this testing functionality.
131-
132-
# copy with arbitrary file name to test --input-file
133-
docker cp tests/data/district-of-columbia-2021-01-13.osm.pbf \
134-
pgosm:/app/output/$(INPUT_FILE_NAME)
135-
136-
# allow files created in later step to be created
137-
docker exec -it pgosm \
138-
chown $(CURRENT_UID):$(CURRENT_GID) /app/output/
139-
# Needed for unit-tests
140-
docker exec -it pgosm \
141-
chown $(CURRENT_UID):$(CURRENT_GID) /app/docker/
142-
143-
# process it, this time without providing the region but directly the filename
144-
docker exec -it \
145-
-e POSTGRES_PASSWORD=mysecretpassword \
146-
-e POSTGRES_USER=postgres \
147-
-u $(CURRENT_UID):$(CURRENT_GID) \
148-
pgosm python3 docker/pgosm_flex.py \
149-
--layerset=minimal \
150-
--ram=$(RAM) \
151-
--replication \
152-
--input-file=/app/output/$(INPUT_FILE_NAME) \
153-
--skip-qgis-style --skip-nested # Make this test run faster
154-
155-
156117
.PHONE: docker-exec-region
157118
docker-exec-region: build-run-docker
158119
# copy for simulating region

docs/src/docker-build.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,29 @@ docker pull postgis/postgis:16-3.4
8989
docker build --no-cache -t rustprooflabs/pgosm-flex:dev .
9090
```
9191

92+
93+
## Building PgOSM Flex from an `osm2pgsql` feature branch
94+
95+
There are times it is helpful to build the PgOSM Flex Docker image with a
96+
specific feature branch. To do this, change the `OSM2PGSQL_BRANCH`
97+
and/or `OSM2PGSQL_REPO` arguments as necessary at the beginning of the Dockerfile.
98+
The production setup looks like the following example.
99+
100+
101+
```Dockerfile
102+
ARG OSM2PGSQL_BRANCH=master
103+
ARG OSM2PGSQL_REPO=https://github.com/osm2pgsql-dev/osm2pgsql.git
104+
```
105+
106+
To test the feature branch associated with
107+
[osm2pgsql #2212](https://github.com/osm2pgsql-dev/osm2pgsql/pull/2212)
108+
the updated version was set like the following example.
109+
This changes the `OSM2PGSQL_BRANCH` to `check-date-on-replication-init`
110+
and changes the username in the `OSM2PGSQL_REPO` to `lonvia`.
111+
112+
113+
```Dockerfile
114+
ARG OSM2PGSQL_BRANCH=check-date-on-replication-init
115+
ARG OSM2PGSQL_REPO=https://github.com/lonvia/osm2pgsql.git
116+
```
117+

docs/src/replication.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ your specific database and process.**
3434

3535
----
3636

37+
## Not tested by `make`
38+
39+
The function exposed by `--replication` is not tested via PgOSM's `Makefile`.
40+
41+
42+
3743
## Max connections
3844

3945
The other important change when using replication is to increase Postgres' `max_connections`.

0 commit comments

Comments
 (0)