Skip to content

Commit c9bb31f

Browse files
authored
Merge pull request #489 from OpenHistoricalMap/staging
Adding osm_land provider and Map-styles updates
2 parents 3081cb8 + a0aef67 commit c9bb31f

9 files changed

+89
-127
lines changed

hetzner/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ Ensure you are using the correct Docker images for production deployment, https:
1111

1212
```sh
1313
docker compose -f hetzner/tiler.production.yml up -d
14+
# docker compose -f hetzner/tiler.production.yml up tiler_production -d
15+
# docker compose -f hetzner/tiler.production.yml up imposm_production -d
16+
# docker compose -f hetzner/tiler.production.yml up cache_production -d
17+
# docker compose -f hetzner/tiler.production.yml up global_seeding_production -d
18+
# docker compose -f hetzner/tiler.production.yml up tile_coverage_seeding_production -d
19+
1420
```
1521

1622
🛠 Deploying to Staging
@@ -30,3 +36,4 @@ docker compose -f hetzner/tiler.staging.yml up tile_coverage_seeding -d
3036
• Ensure that you are using the correct Docker images for each environment.
3137
• Manually update the images before deploying production services.
3238
• For troubleshooting, check logs using:
39+

hetzner/seed.sh

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/bash
2+
3+
seed_global() {
4+
while true; do
5+
echo "Starting global seeding..."
6+
pkill -f "tegola" && sleep 5
7+
8+
# Seed all areas (min 0 to max 5)
9+
tegola cache seed tile-name "0/0/0" \
10+
--config=/opt/tegola_config/config.toml \
11+
--map=osm \
12+
--min-zoom=0 \
13+
--max-zoom=5 \
14+
--concurrency=32 \
15+
--overwrite=true
16+
17+
# Seed land areas separately (zoom 6-7)
18+
for zoom in $(seq 6 7); do
19+
echo "Downloading tile list for zoom level $zoom..."
20+
wget -O /opt/tile-list.tiles "https://s3.amazonaws.com/planet.openhistoricalmap.org/tile_coverage/tiles_boundary_$zoom.list"
21+
22+
tegola cache seed tile-list /opt/tile-list.tiles \
23+
--config=/opt/tegola_config/config.toml \
24+
--map=osm \
25+
--min-zoom="$zoom" \
26+
--max-zoom="$zoom" \
27+
--concurrency=32 \
28+
--overwrite=true
29+
done
30+
echo "Global seeding completed. Sleeping for 1 hour..."
31+
sleep 3600
32+
done
33+
}
34+
35+
seed_coverage() {
36+
while true; do
37+
echo "Starting coverage seeding..."
38+
wget -O /opt/tile-list.tiles "https://s3.amazonaws.com/planet.openhistoricalmap.org/tile_coverage/tiles_14.list"
39+
pkill -f "tegola" && sleep 5
40+
41+
tegola cache seed tile-list /opt/tile-list.tiles \
42+
--config=/opt/tegola_config/config.toml \
43+
--map=osm \
44+
--min-zoom=0 \
45+
--max-zoom=14 \
46+
--concurrency=32 \
47+
--overwrite=false
48+
sleep 300
49+
done
50+
}
51+
52+
if [ "$#" -ne 1 ]; then
53+
echo "Usage: $0 <global|coverage>"
54+
exit 1
55+
fi
56+
57+
case "$1" in
58+
global)
59+
seed_global
60+
;;
61+
coverage)
62+
seed_coverage
63+
;;
64+
*)
65+
echo "Invalid option. Use 'global' or 'coverage'."
66+
exit 1
67+
;;
68+
esac

hetzner/tiler.production.yml

+7-27
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ services:
4848
- tiler_network
4949
# Tiler server
5050
tiler_production:
51-
image: ghcr.io/openhistoricalmap/tiler-server:0.0.1-0.dev.git.2241.hba0f0a5
51+
image: ghcr.io/openhistoricalmap/tiler-server:0.0.1-0.dev.git.2248.he042bfb
5252
ports:
5353
- "9090:9090"
5454
env_file:
@@ -75,23 +75,13 @@ services:
7575
image: ghcr.io/openhistoricalmap/tiler-server:0.0.1-0.dev.git.2234.hfa6976e
7676
env_file:
7777
- .env.production
78+
volumes:
79+
- ./seed.sh:/opt/seed.sh
7880
entrypoint:
7981
- /bin/bash
8082
- "-c"
8183
- |
82-
set -x
83-
while true; do
84-
pkill -f "tegola" && sleep 5
85-
echo "0/0/0" > /opt/tile-list.tiles
86-
tegola cache seed tile-list /opt/tile-list.tiles \
87-
--config=/opt/tegola_config/config.toml \
88-
--map=osm \
89-
--min-zoom=0 \
90-
--max-zoom=7\
91-
--concurrency=32 \
92-
--overwrite=true
93-
sleep 3600
94-
done
84+
/opt/seed.sh global
9585
deploy:
9686
resources:
9787
limits:
@@ -104,23 +94,13 @@ services:
10494
image: ghcr.io/openhistoricalmap/tiler-server:0.0.1-0.dev.git.2234.hfa6976e
10595
env_file:
10696
- .env.production
97+
volumes:
98+
- ./seed.sh:/opt/seed.sh
10799
entrypoint:
108100
- /bin/bash
109101
- "-c"
110102
- |
111-
set -x
112-
while true; do
113-
wget -O tile-list.tiles https://s3.amazonaws.com/planet.openhistoricalmap.org/tile_coverage/tiles.list
114-
pkill -f "tegola" && sleep 5
115-
tegola cache seed tile-list tile-list.tiles \
116-
--config=/opt/tegola_config/config.toml \
117-
--map=osm \
118-
--min-zoom=8 \
119-
--max-zoom=14 \
120-
--concurrency=32 \
121-
--overwrite=false
122-
sleep 3600
123-
done
103+
/opt/seed.sh coverage
124104
deploy:
125105
resources:
126106
limits:

hetzner/tiler.staging.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ services:
4343
cpus: '1'
4444
memory: 1G
4545
tiler:
46-
image: ghcr.io/openhistoricalmap/tiler-server:0.0.1-0.dev.git.2234.hfa6976e
46+
image: ghcr.io/openhistoricalmap/tiler-server:0.0.1-0.dev.git.2248.he042bfb
4747
ports:
4848
- "9091:9090"
4949
env_file:

images/tiler-server/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ RUN mkdir /opt/tegola_config
3232
RUN cd /opt/ && python build_config.py \
3333
--output=/opt/tegola_config/config.toml \
3434
--provider_names \
35-
"land,\
36-
admin_boundaries_lines,\
35+
"admin_boundaries_lines,\
3736
admin_boundaries.centroids,\
3837
admin_boundaries_maritime,\
3938
place_areas,\

images/tiler-server/config/providers/land.toml

-92
This file was deleted.

images/web/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ RUN apache2ctl configtest
8686
RUN chown -R www-data: $workdir
8787

8888
# Clone Map-styles
89-
ENV OPENHISTORICALMAP_MAP_STYLES_GITSHA=6de6e329569ab6561d1fa6ab2cebb42df7fd17c7
89+
ENV OPENHISTORICALMAP_MAP_STYLES_GITSHA=7a70bbef491db6928f28256a3a68d3158a6f9710
9090
RUN git clone --branch staging --depth 1 https://github.com/OpenHistoricalMap/map-styles.git $workdir/public/map-styles
9191
RUN cd $workdir/public/map-styles && git fetch --depth 1 origin $OPENHISTORICALMAP_MAP_STYLES_GITSHA && git checkout $OPENHISTORICALMAP_MAP_STYLES_GITSHA
9292
RUN rm -rf $workdir/public/map-styles/.git

values.production.template.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ ohm:
983983
label_value: web_large
984984

985985
tilerCacheSeedCoverage:
986-
enabled: true
986+
enabled: false
987987
schedule: '0 * * * *'
988988
env:
989989
CONCURRENCY: 128

values.staging.template.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ osm-seed:
6868
nodeSelector:
6969
enabled: true
7070
label_key: nodegroup_type
71-
label_value: db_large
71+
label_value: web_medium
7272
env:
7373
POSTGRES_DB: {{STAGING_DB}}
7474
POSTGRES_USER: {{STAGING_DB_USER}}
@@ -137,7 +137,7 @@ osm-seed:
137137
nodeSelector:
138138
enabled: true
139139
label_key: nodegroup_type
140-
label_value: db_large
140+
label_value: web_medium
141141
replicaCount: 1
142142
# Set staticIp, if you are using cloudProvider=gcp
143143
staticIp: c
@@ -249,7 +249,7 @@ osm-seed:
249249
nodeSelector:
250250
enabled: true
251251
label_key: nodegroup_type
252-
label_value: db_large
252+
label_value: web_medium
253253
env:
254254
ENABLE_SEND_SLACK_MESSAGE: "true"
255255
SLACK_WEBHOOK_URL: {{OHM_SLACK_WEBHOOK_URL}}

0 commit comments

Comments
 (0)