Skip to content

Commit 4b03235

Browse files
authored
Update Nominatim to 4.5 version (#357)
* Update nominatim version 4.5 * Disable livenessProbe for nominatim
1 parent 93bb4c9 commit 4b03235

File tree

3 files changed

+32
-73
lines changed

3 files changed

+32
-73
lines changed

envs/.env.nominatim.example

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ IMPORT_GB_POSTCODES=false
1212
IMPORT_TIGER_ADDRESSES=false
1313
THREADS=4
1414
NOMINATIM_PASSWORD=kiara
15-
PGDATA=/var/lib/postgresql/14/main
15+
PGDATA=/var/lib/postgresql/16/main
1616
NOMINATIM_ADDRESS_LEVEL_CONFIG_URL=https://raw.githubusercontent.com/OpenHistoricalMap/nominatim-ui/master/address-levels.json
1717
UPDATE_MODE=catch-up
1818
OSMSEED_WEB_API_DOMAIN=www.openstreetmap.org
19+
IMPORT_STYLE=extratags
20+
EXTRA_TAGS=start_date,start_date:edtf,end_date,end_date:edt

images/nominatim/Dockerfile

+18-54
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,24 @@
1-
FROM mediagis/nominatim:4.1
1+
FROM mediagis/nominatim:4.5
2+
23
RUN apt-get update && \
3-
apt-get -y install \
4-
build-essential \
5-
g++ \
6-
cmake \
7-
libpq-dev \
8-
zlib1g-dev \
9-
libbz2-dev \
10-
libproj-dev \
11-
libexpat1-dev \
12-
libboost-dev \
13-
libboost-system-dev \
14-
libboost-filesystem-dev \
15-
git \
16-
wget \
17-
cron
18-
# Nominatim install.
19-
RUN true \
20-
&& git clone https://github.com/osm-search/Nominatim.git \
21-
&& cd Nominatim \
22-
&& git checkout v4.1.0 \
23-
&& git submodule update --init
24-
COPY settings/placex_triggers.sql /app/Nominatim/lib-sql/functions/
25-
RUN wget -O Nominatim/data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz
26-
RUN mkdir build \
27-
&& cd build \
28-
&& cmake ../Nominatim \
29-
&& make -j`nproc` \
30-
&& make install
4+
apt-get -y install --no-install-recommends \
5+
cron \
6+
wget lua5.3 liblua5.3-dev && \
7+
apt-get clean && rm -rf /var/lib/apt/lists/*
8+
9+
WORKDIR /app
3110

32-
RUN true \
33-
# Remove development and unused packages.
34-
&& apt-get -y remove --purge \
35-
cpp-9 \
36-
gcc-9* \
37-
g++ \
38-
git \
39-
make \
40-
cmake* \
41-
llvm-10* \
42-
libc6-dev \
43-
linux-libc-dev \
44-
libclang-*-dev \
45-
build-essential \
46-
postgresql-server-dev-14 \
47-
&& apt-get clean \
48-
# Clear temporary files and directories.
49-
&& rm -rf \
50-
/tmp/* \
51-
/var/tmp/* \
52-
/root/.cache \
53-
/app/src/.git \
54-
/var/lib/apt/lists/* \
11+
# Download required Nominatim country grid
12+
RUN mkdir -p /app/Nominatim/data && \
13+
wget https://www.nominatim.org/data/country_grid.sql.gz -O /app/Nominatim/data/country_osm_grid.sql.gz
5514

56-
ENV PGDATA=/var/lib/postgresql/14/main
5715
COPY docker-entrypoint.sh /app/
5816
COPY update.sh /app/
59-
RUN crontab -l | { cat; echo "* * * * * cd /nominatim/ ; bash /app/update.sh >> /var/log/cron.log 2>&1"; } | crontab -
17+
18+
# Ensure scripts are executable
19+
RUN chmod +x /app/docker-entrypoint.sh /app/update.sh
20+
21+
# Setup cron job
22+
RUN echo "* * * * * cd /app/Nominatim && bash /app/update.sh >> /var/log/cron.log 2>&1" | crontab -
23+
6024
CMD ["/app/docker-entrypoint.sh"]

osm-seed/templates/nominatim-api/nominatim-api-statefulset.yaml

+11-18
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
environment: {{ .Values.environment }}
1010
release: {{ .Release.Name }}
1111
spec:
12-
replicas: 1 # we only ever want one replica of the nominatimApi
12+
replicas: 1
1313
selector:
1414
matchLabels:
1515
app: {{ template "osm-seed.name" . }}
@@ -66,26 +66,19 @@ spec:
6666
value: {{ .Values.nominatimApi.env.NOMINATIM_ADDRESS_LEVEL_CONFIG_URL }}
6767
- name: UPDATE_MODE
6868
value: {{ .Values.nominatimApi.env.UPDATE_MODE | default "none" | quote }}
69-
# command: ["/bin/sh"]
70-
# args: ["-c", "sh /app/start.sh"]
69+
- name: IMPORT_STYLE
70+
value: {{ .Values.nominatimApi.env.IMPORT_STYLE | default "full" | quote }}
71+
- name: EXTRA_TAGS
72+
value: {{ .Values.nominatimApi.env.EXTRA_TAGS | default "" | quote }}
73+
7174
# livenessProbe:
72-
# exec:
73-
# command:
74-
# - sh
75-
# - -c
76-
# - exec pg_isready --host $POD_IP
77-
# initialDelaySeconds: 120
75+
# httpGet:
76+
# path: /status
77+
# port: 8080
78+
# initialDelaySeconds: 40000
7879
# timeoutSeconds: 5
7980
# failureThreshold: 6
80-
# readinessProbe:
81-
# exec:
82-
# command:
83-
# - sh
84-
# - -c
85-
# - exec pg_isready --host $POD_IP
86-
# initialDelaySeconds: 5
87-
# timeoutSeconds: 3
88-
# periodSeconds: 5
81+
8982
volumeMounts:
9083
- name: nominatim-db-storage
9184
mountPath: {{ .Values.nominatimApi.persistenceDisk.mountPath }}

0 commit comments

Comments
 (0)