Skip to content

Commit

Permalink
Update Nominatim to 4.5 version (#357)
Browse files Browse the repository at this point in the history
* Update nominatim version 4.5

* Disable livenessProbe for nominatim
  • Loading branch information
Rub21 authored Feb 26, 2025
1 parent 93bb4c9 commit 4b03235
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 73 deletions.
4 changes: 3 additions & 1 deletion envs/.env.nominatim.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ IMPORT_GB_POSTCODES=false
IMPORT_TIGER_ADDRESSES=false
THREADS=4
NOMINATIM_PASSWORD=kiara
PGDATA=/var/lib/postgresql/14/main
PGDATA=/var/lib/postgresql/16/main
NOMINATIM_ADDRESS_LEVEL_CONFIG_URL=https://raw.githubusercontent.com/OpenHistoricalMap/nominatim-ui/master/address-levels.json
UPDATE_MODE=catch-up
OSMSEED_WEB_API_DOMAIN=www.openstreetmap.org
IMPORT_STYLE=extratags
EXTRA_TAGS=start_date,start_date:edtf,end_date,end_date:edt
72 changes: 18 additions & 54 deletions images/nominatim/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,24 @@
FROM mediagis/nominatim:4.1
FROM mediagis/nominatim:4.5

RUN apt-get update && \
apt-get -y install \
build-essential \
g++ \
cmake \
libpq-dev \
zlib1g-dev \
libbz2-dev \
libproj-dev \
libexpat1-dev \
libboost-dev \
libboost-system-dev \
libboost-filesystem-dev \
git \
wget \
cron
# Nominatim install.
RUN true \
&& git clone https://github.com/osm-search/Nominatim.git \
&& cd Nominatim \
&& git checkout v4.1.0 \
&& git submodule update --init
COPY settings/placex_triggers.sql /app/Nominatim/lib-sql/functions/
RUN wget -O Nominatim/data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz
RUN mkdir build \
&& cd build \
&& cmake ../Nominatim \
&& make -j`nproc` \
&& make install
apt-get -y install --no-install-recommends \
cron \
wget lua5.3 liblua5.3-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /app

RUN true \
# Remove development and unused packages.
&& apt-get -y remove --purge \
cpp-9 \
gcc-9* \
g++ \
git \
make \
cmake* \
llvm-10* \
libc6-dev \
linux-libc-dev \
libclang-*-dev \
build-essential \
postgresql-server-dev-14 \
&& apt-get clean \
# Clear temporary files and directories.
&& rm -rf \
/tmp/* \
/var/tmp/* \
/root/.cache \
/app/src/.git \
/var/lib/apt/lists/* \
# Download required Nominatim country grid
RUN mkdir -p /app/Nominatim/data && \
wget https://www.nominatim.org/data/country_grid.sql.gz -O /app/Nominatim/data/country_osm_grid.sql.gz

ENV PGDATA=/var/lib/postgresql/14/main
COPY docker-entrypoint.sh /app/
COPY update.sh /app/
RUN crontab -l | { cat; echo "* * * * * cd /nominatim/ ; bash /app/update.sh >> /var/log/cron.log 2>&1"; } | crontab -

# Ensure scripts are executable
RUN chmod +x /app/docker-entrypoint.sh /app/update.sh

# Setup cron job
RUN echo "* * * * * cd /app/Nominatim && bash /app/update.sh >> /var/log/cron.log 2>&1" | crontab -

CMD ["/app/docker-entrypoint.sh"]
29 changes: 11 additions & 18 deletions osm-seed/templates/nominatim-api/nominatim-api-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
environment: {{ .Values.environment }}
release: {{ .Release.Name }}
spec:
replicas: 1 # we only ever want one replica of the nominatimApi
replicas: 1
selector:
matchLabels:
app: {{ template "osm-seed.name" . }}
Expand Down Expand Up @@ -66,26 +66,19 @@ spec:
value: {{ .Values.nominatimApi.env.NOMINATIM_ADDRESS_LEVEL_CONFIG_URL }}
- name: UPDATE_MODE
value: {{ .Values.nominatimApi.env.UPDATE_MODE | default "none" | quote }}
# command: ["/bin/sh"]
# args: ["-c", "sh /app/start.sh"]
- name: IMPORT_STYLE
value: {{ .Values.nominatimApi.env.IMPORT_STYLE | default "full" | quote }}
- name: EXTRA_TAGS
value: {{ .Values.nominatimApi.env.EXTRA_TAGS | default "" | quote }}

# livenessProbe:
# exec:
# command:
# - sh
# - -c
# - exec pg_isready --host $POD_IP
# initialDelaySeconds: 120
# httpGet:
# path: /status
# port: 8080
# initialDelaySeconds: 40000
# timeoutSeconds: 5
# failureThreshold: 6
# readinessProbe:
# exec:
# command:
# - sh
# - -c
# - exec pg_isready --host $POD_IP
# initialDelaySeconds: 5
# timeoutSeconds: 3
# periodSeconds: 5

volumeMounts:
- name: nominatim-db-storage
mountPath: {{ .Values.nominatimApi.persistenceDisk.mountPath }}
Expand Down

0 comments on commit 4b03235

Please sign in to comment.