Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.2.3 update & fix curl #444

Merged
merged 8 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ jobs:
- version: "4.1"
update_command: docker exec -i nominatim sudo -u nominatim nominatim replication --project-dir /nominatim --once
postgres_version: 14
user_agent: mediagis/nominatim-docker-action:4.1
- version: "4.2"
update_command: docker exec -i nominatim sudo -u nominatim nominatim replication --project-dir /nominatim --once
postgres_version: 14
user_agent: mediagis/nominatim-docker-action:4.2

runs-on: ubuntu-latest
steps:
Expand All @@ -42,6 +44,7 @@ jobs:
docker run -i --rm \
-e PBF_URL=http://download.geofabrik.de/europe/monaco-${four_days_ago}.osm.pbf \
-e REPLICATION_URL=http://download.geofabrik.de/europe/monaco-updates/ \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-p 8001:8080 \
--name nominatim \
nominatim &
Expand All @@ -57,6 +60,7 @@ jobs:
docker run -i --rm \
-e PBF_URL=http://download.geofabrik.de/europe/monaco-latest.osm.pbf \
-e REPLICATION_URL=http://download.geofabrik.de/europe/monaco-updates/ \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-v nominatim-data:/var/lib/postgresql/${{ matrix.nominatim.postgres_version }}/main \
-p 8002:8080 \
nominatim &
Expand All @@ -71,6 +75,7 @@ jobs:
docker run -i --rm \
-e PBF_URL=http://download.geofabrik.de/europe/monaco-${four_days_ago}.osm.pbf \
-e REPLICATION_URL=http://download.geofabrik.de/europe/monaco-updates/ \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-v /tmp/nominatim-data:/var/lib/postgresql/${{ matrix.nominatim.postgres_version }}/main \
-p 8003:8080 \
--name nominatim \
Expand All @@ -87,6 +92,7 @@ jobs:
docker run -i --rm \
-e PBF_URL=http://download.geofabrik.de/europe/monaco-${four_days_ago}.osm.pbf \
-e REPLICATION_URL=http://download.geofabrik.de/europe/monaco-updates/ \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-v /tmp/nominatim-data:/var/lib/postgresql/${{ matrix.nominatim.postgres_version }}/main \
-p 8004:8080 \
--name nominatim \
Expand All @@ -107,6 +113,7 @@ jobs:
-e PBF_URL=http://download.geofabrik.de/europe/monaco-${four_days_ago}.osm.pbf \
-e REPLICATION_URL=http://download.geofabrik.de/europe/monaco-updates/ \
-e UPDATE_MODE=once \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-v nominatim-update-volume:/var/lib/postgresql/${{ matrix.nominatim.postgres_version }}/main \
-p 8004:8080 \
--name nominatim \
Expand All @@ -127,6 +134,7 @@ jobs:
-e PBF_URL=http://download.geofabrik.de/europe/monaco-${days_ago}.osm.pbf \
-e REPLICATION_URL=http://download.geofabrik.de/europe/monaco-updates/ \
-e UPDATE_MODE=continuous \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-v /tmp/nominatim-update-bindmount:/var/lib/postgresql/${{ matrix.nominatim.postgres_version }}/main \
-p 8004:8080 \
--name nominatim \
Expand All @@ -144,6 +152,7 @@ jobs:
-e PBF_URL=http://download.geofabrik.de/europe/monaco-latest.osm.pbf \
-e REPLICATION_URL=http://download.geofabrik.de/europe/monaco-updates/ \
-e IMPORT_STYLE=full \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-p 8005:8080 \
nominatim &
sleep 120
Expand All @@ -156,6 +165,7 @@ jobs:
-e PBF_URL=http://download.geofabrik.de/europe/monaco-latest.osm.pbf \
-e REPLICATION_URL=http://download.geofabrik.de/europe/monaco-updates/ \
-e IMPORT_STYLE=admin \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-p 8006:8080 \
nominatim &
sleep 120
Expand All @@ -168,6 +178,7 @@ jobs:
docker run -i --rm \
-e PBF_PATH=/nominatim/data/monaco-latest.osm.pbf \
-e REPLICATION_URL=http://download.geofabrik.de/europe/monaco-updates/ \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-v nominatim7-data:/var/lib/postgresql/${{ matrix.nominatim.postgres_version }}/main \
-v /tmp/data:/nominatim/data \
-p 8007:8080 \
Expand All @@ -183,6 +194,7 @@ jobs:
run: |-
docker run -i --rm \
-e PBF_URL=http://download.geofabrik.de/europe/monaco-latest.osm.pbf \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-p 8008:8080 \
nominatim &
sleep 120
Expand All @@ -193,36 +205,39 @@ jobs:
run: |-
docker run -i --rm \
-e PBF_URL=http://download.geofabrik.de/europe/monaco-latest.osm.pbf \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-e FREEZE="true" \
-p 8008:8080 \
-p 8009:8080 \
nominatim &
sleep 120
./assert-non-empty-json "http://localhost:8008/search.php?q=avenue%20pasteur"
./assert-non-empty-json "http://localhost:8009/search.php?q=avenue%20pasteur"

- name: Check GB postcode import
working-directory: .github/workflows
run: |-
docker run -i --rm \
-e PBF_URL=https://download.geofabrik.de/europe/great-britain/england/rutland-latest.osm.pbf \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-e IMPORT_GB_POSTCODES="true" \
-p 8009:8080 \
-p 8010:8080 \
nominatim &
sleep 600
./assert-non-empty-json "http://localhost:8009/search.php?postalcode=LE15+8TX"
./assert-non-empty-json "http://localhost:8009/search.php?postalcode=PE9+3SY"
./assert-non-empty-json "http://localhost:8009/search.php?postalcode=PE9+4ES"
./assert-non-empty-json "http://localhost:8010/search.php?postalcode=LE15+8TX"
./assert-non-empty-json "http://localhost:8010/search.php?postalcode=PE9+3SY"
./assert-non-empty-json "http://localhost:8010/search.php?postalcode=PE9+4ES"

- name: Check when using REVERSE_ONLY
working-directory: .github/workflows
run: |-
docker run -i --rm \
-e PBF_URL=http://download.geofabrik.de/europe/monaco-latest.osm.pbf \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-e REVERSE_ONLY="true" \
-p 8010:8080 \
-p 8011:8080 \
nominatim &
sleep 120
./assert-reverse-only "http://localhost:8010/search.php?q=avenue%20pasteur"
./assert-non-empty-json "http://localhost:8010/reverse.php?lat=43.734&lon=7.42&format=jsonv2"
./assert-reverse-only "http://localhost:8011/search.php?q=avenue%20pasteur"
./assert-non-empty-json "http://localhost:8011/reverse.php?lat=43.734&lon=7.42&format=jsonv2"

- name: Login to DockerHub
if: ${{ github.ref == 'refs/heads/master' && github.repository_owner == 'mediagis' }}
Expand Down
4 changes: 2 additions & 2 deletions 4.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ RUN pip3 install osmium

# Nominatim install.
ENV NOMINATIM_VERSION=4.1.2
ARG USER_AGENT="mediagis/nominatim-docker:$NOMINATIM_VERSION"
ARG USER_AGENT=mediagis/nominatim-docker:$NOMINATIM_VERSION

RUN true \
&& curl -A $USER_AGENT https://nominatim.org/release/Nominatim-$NOMINATIM_VERSION.tar.bz2 -o nominatim.tar.bz2 \
Expand Down Expand Up @@ -135,7 +135,7 @@ ENV NOMINATIM_PASSWORD=qaIACxO6wMR3
ENV THREADS=16

# i cannot figure out a way to remove this duplication, if anyone knows, please get in touch
ENV USER_AGENT="mediagis/nominatim-docker:4.1.2"
ENV USER_AGENT=mediagis/nominatim-docker:4.1.2

ENV PROJECT_DIR=/nominatim

Expand Down
13 changes: 7 additions & 6 deletions 4.1/init.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash -ex

OSMFILE=${PROJECT_DIR}/data.osm.pbf
CURL="curl -L -A \"${USER_AGENT}\" --fail-with-body"

CURL=("curl" "-L" "-A" "${USER_AGENT}" "--fail-with-body")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for figuring that out!


if [ "$IMPORT_WIKIPEDIA" = "true" ]; then
echo "Downloading Wikipedia importance dump"
${CURL} https://nominatim.org/data/wikimedia-importance.sql.gz -o ${PROJECT_DIR}/wikimedia-importance.sql.gz
"${CURL[@]}" https://nominatim.org/data/wikimedia-importance.sql.gz -o ${PROJECT_DIR}/wikimedia-importance.sql.gz
elif [ -f "$IMPORT_WIKIPEDIA" ]; then
# use local file if asked
ln -s "$IMPORT_WIKIPEDIA" ${PROJECT_DIR}/wikimedia-importance.sql.gz
Expand All @@ -14,7 +15,7 @@ else
fi;

if [ "$IMPORT_GB_POSTCODES" = "true" ]; then
${CURL} https://nominatim.org/data/gb_postcodes.csv.gz -o ${PROJECT_DIR}/gb_postcodes.csv.gz
"${CURL[@]}" https://nominatim.org/data/gb_postcodes.csv.gz -o ${PROJECT_DIR}/gb_postcodes.csv.gz
elif [ -f "$IMPORT_GB_POSTCODES" ]; then
# use local file if asked
ln -s "$IMPORT_GB_POSTCODES" ${PROJECT_DIR}/gb_postcodes.csv.gz
Expand All @@ -23,7 +24,7 @@ else \
fi;

if [ "$IMPORT_US_POSTCODES" = "true" ]; then
${CURL} https://nominatim.org/data/us_postcodes.csv.gz -o ${PROJECT_DIR}/us_postcodes.csv.gz
"${CURL[@]}" https://nominatim.org/data/us_postcodes.csv.gz -o ${PROJECT_DIR}/us_postcodes.csv.gz
elif [ -f "$IMPORT_US_POSTCODES" ]; then
# use local file if asked
ln -s "$IMPORT_US_POSTCODES" ${PROJECT_DIR}/us_postcodes.csv.gz
Expand All @@ -32,7 +33,7 @@ else
fi;

if [ "$IMPORT_TIGER_ADDRESSES" = "true" ]; then
${CURL} https://nominatim.org/data/tiger2021-nominatim-preprocessed.csv.tar.gz -o ${PROJECT_DIR}/tiger-nominatim-preprocessed.csv.tar.gz
"${CURL[@]}" https://nominatim.org/data/tiger2021-nominatim-preprocessed.csv.tar.gz -o ${PROJECT_DIR}/tiger-nominatim-preprocessed.csv.tar.gz
elif [ -f "$IMPORT_TIGER_ADDRESSES" ]; then
# use local file if asked
ln -s "$IMPORT_TIGER_ADDRESSES" ${PROJECT_DIR}/tiger-nominatim-preprocessed.csv.tar.gz
Expand All @@ -42,7 +43,7 @@ fi

if [ "$PBF_URL" != "" ]; then
echo Downloading OSM extract from "$PBF_URL"
${CURL} "$PBF_URL" -C - --create-dirs -o $OSMFILE
"${CURL[@]}" "$PBF_URL" -C - --create-dirs -o $OSMFILE
fi

if [ "$PBF_PATH" != "" ]; then
Expand Down
6 changes: 3 additions & 3 deletions 4.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ RUN true \
RUN pip3 install osmium

# Nominatim install.
ENV NOMINATIM_VERSION=4.2.1
ARG USER_AGENT="mediagis/nominatim-docker:${NOMINATIM_VERSION}"
ENV NOMINATIM_VERSION=4.2.3
ARG USER_AGENT=mediagis/nominatim-docker:${NOMINATIM_VERSION}

RUN true \
&& curl -A $USER_AGENT https://nominatim.org/release/Nominatim-$NOMINATIM_VERSION.tar.bz2 -o nominatim.tar.bz2 \
Expand Down Expand Up @@ -137,7 +137,7 @@ ENV THREADS=16
ENV PROJECT_DIR=/nominatim

# i cannot figure out a way to remove this duplication, if anyone knows, please get in touch
ENV USER_AGENT="mediagis/nominatim-docker:4.2.1"
ENV USER_AGENT=mediagis/nominatim-docker:4.2.3

WORKDIR /app

Expand Down
12 changes: 6 additions & 6 deletions 4.2/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

OSMFILE=${PROJECT_DIR}/data.osm.pbf

CURL="curl -L -A \"${USER_AGENT}\" --fail-with-body"
CURL=("curl" "-L" "-A" "${USER_AGENT}" "--fail-with-body")

if [ "$IMPORT_WIKIPEDIA" = "true" ]; then
echo "Downloading Wikipedia importance dump"
${CURL} https://nominatim.org/data/wikimedia-importance.sql.gz -o ${PROJECT_DIR}/wikimedia-importance.sql.gz
"${CURL[@]}" https://nominatim.org/data/wikimedia-importance.sql.gz -o ${PROJECT_DIR}/wikimedia-importance.sql.gz
elif [ -f "$IMPORT_WIKIPEDIA" ]; then
# use local file if asked
ln -s "$IMPORT_WIKIPEDIA" ${PROJECT_DIR}/wikimedia-importance.sql.gz
Expand All @@ -15,7 +15,7 @@ else
fi;

if [ "$IMPORT_GB_POSTCODES" = "true" ]; then
${CURL} https://nominatim.org/data/gb_postcodes.csv.gz -o ${PROJECT_DIR}/gb_postcodes.csv.gz
"${CURL[@]}" https://nominatim.org/data/gb_postcodes.csv.gz -o ${PROJECT_DIR}/gb_postcodes.csv.gz
elif [ -f "$IMPORT_GB_POSTCODES" ]; then
# use local file if asked
ln -s "$IMPORT_GB_POSTCODES" ${PROJECT_DIR}/gb_postcodes.csv.gz
Expand All @@ -24,7 +24,7 @@ else \
fi;

if [ "$IMPORT_US_POSTCODES" = "true" ]; then
${CURL} https://nominatim.org/data/us_postcodes.csv.gz -o ${PROJECT_DIR}/us_postcodes.csv.gz
"${CURL[@]}" https://nominatim.org/data/us_postcodes.csv.gz -o ${PROJECT_DIR}/us_postcodes.csv.gz
elif [ -f "$IMPORT_US_POSTCODES" ]; then
# use local file if asked
ln -s "$IMPORT_US_POSTCODES" ${PROJECT_DIR}/us_postcodes.csv.gz
Expand All @@ -33,7 +33,7 @@ else
fi;

if [ "$IMPORT_TIGER_ADDRESSES" = "true" ]; then
${CURL} https://nominatim.org/data/tiger2021-nominatim-preprocessed.csv.tar.gz -o ${PROJECT_DIR}/tiger-nominatim-preprocessed.csv.tar.gz
"${CURL[@]}" https://nominatim.org/data/tiger2021-nominatim-preprocessed.csv.tar.gz -o ${PROJECT_DIR}/tiger-nominatim-preprocessed.csv.tar.gz
elif [ -f "$IMPORT_TIGER_ADDRESSES" ]; then
# use local file if asked
ln -s "$IMPORT_TIGER_ADDRESSES" ${PROJECT_DIR}/tiger-nominatim-preprocessed.csv.tar.gz
Expand All @@ -43,7 +43,7 @@ fi

if [ "$PBF_URL" != "" ]; then
echo Downloading OSM extract from "$PBF_URL"
${CURL} "$PBF_URL" -C - --create-dirs -o $OSMFILE
"${CURL[@]}" "$PBF_URL" -C - --create-dirs -o $OSMFILE
fi

if [ "$PBF_PATH" != "" ]; then
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ See relevant installation and usage instructions for each version in the ```<ver

# Supported Nominatim versions #

- [`4.2.1`, `4.2`](https://github.com/mediagis/nominatim-docker/tree/master/4.2)
- [`4.2.3`, `4.2`](https://github.com/mediagis/nominatim-docker/tree/master/4.2)
- [`4.1.2`, `4.1`](https://github.com/mediagis/nominatim-docker/tree/master/4.1)

# Deprecated Nominatim versions #
Expand Down