-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #448 from rinigus/docker-import
Switch to import using Docker containers
- Loading branch information
Showing
33 changed files
with
668 additions
and
664 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,7 @@ | |
/.clickable/ | ||
/clickable.yaml | ||
/click_release/ | ||
|
||
# import | ||
/scripts/import/data | ||
/scripts/import/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# planet or region | ||
AREA=monaco | ||
PBF=${AREA}.osm.pbf | ||
|
||
# USER | ||
USER_ID=1000 | ||
GROUP_ID=1000 | ||
|
||
# storage | ||
STORE_PLANET=./data/planet | ||
STORE_OUTPUT=./data/output | ||
|
||
# final import | ||
STORE_IMPORTED=${STORE_OUTPUT}/Imported | ||
|
||
# intermediate imports | ||
STORE_MBTILES=${STORE_OUTPUT}/mbtiles-planet | ||
STORE_NOMINATIM=${STORE_OUTPUT}/nominatim | ||
STORE_VALHALLA=${STORE_OUTPUT}/valhalla | ||
|
||
STORE_MISC=${STORE_OUTPUT}/misc | ||
|
||
# planetiler: memory options | ||
JAVA_TOOL_OPTIONS=-Xmx32g # use -Xmx130g for planet | ||
PLANETILER_STORAGE_TMP=mmap # comment out to use ram which is faster but needs more ram | ||
|
||
# RAM | ||
RAM_DEFALT_LIMIT=10g | ||
RAM_NOMINATIM_LIMIT=32g | ||
RAM_PLANETILER_LIMIT=40g | ||
RAM_VALHALLA_LIMIT=32g | ||
|
||
# number of parallel imports for geocoder-nlp | ||
GEOCODER_JOBS=8 | ||
|
||
# password for the database - set it to some random value | ||
NOMINATIM_PASSWORD=randomPassword | ||
|
||
### do not change below | ||
# versions | ||
VALHALLA_VERSION=3.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# build | ||
FROM debian:bookworm AS build | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y\ | ||
git make cmake \ | ||
g++ gcc \ | ||
autoconf libtool \ | ||
nlohmann-json3-dev \ | ||
libmarisa-dev libkyotocabinet-dev \ | ||
libsqlite3-dev libpqxx-dev \ | ||
libboost-program-options-dev | ||
|
||
WORKDIR /app | ||
|
||
# libpostal | ||
RUN git clone https://github.com/openvenues/libpostal.git | ||
WORKDIR /app/libpostal | ||
RUN git checkout 8f2066b1d30f4290adf59cacc429980f139b8545 | ||
|
||
RUN ./bootstrap.sh | ||
RUN ./configure \ | ||
--prefix=/usr \ | ||
--datadir=/planet_pbf/libpostal \ | ||
--disable-data-download | ||
RUN make -j${nproc} && make install | ||
|
||
WORKDIR /app | ||
|
||
# geocoder-nlp | ||
RUN git clone https://github.com/rinigus/geocoder-nlp.git | ||
WORKDIR /app/geocoder-nlp | ||
RUN git checkout 2c9fc2bd2f51ca2c36b1266bf5b58db593b5dd4d | ||
RUN git submodule init && \ | ||
git submodule update | ||
|
||
RUN cmake -B build -DCMAKE_INSTALL_PREFIX:PATH=/usr | ||
RUN make -C build -j${nproc} && \ | ||
make -C build install | ||
|
||
WORKDIR /app | ||
|
||
############# | ||
# runtime | ||
FROM debian:bookworm | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y \ | ||
python3 python3-venv \ | ||
bzip2 gzip \ | ||
curl | ||
|
||
# copy from build | ||
COPY --from=build /usr/bin/geocoder-importer /usr/bin/ | ||
COPY --from=build /app/geocoder-nlp/importer/data /app/geocoder-nlp | ||
COPY --from=build /usr/bin/libpostal_data /usr/bin/ | ||
COPY --from=build /usr/lib/libpostal.so* /usr/lib/ | ||
|
||
RUN apt-get install -y \ | ||
make \ | ||
libmarisa0 \ | ||
libkyotocabinet16v5 \ | ||
libpqxx-6.4 \ | ||
libboost-program-options1.74.0 | ||
|
||
WORKDIR /app | ||
|
||
# create and activate venv | ||
RUN python3 -m venv venv | ||
ENV PATH=/app/venv/bin:$PATH | ||
|
||
RUN pip install \ | ||
numpy \ | ||
mercantile \ | ||
psutil \ | ||
shapely \ | ||
tabulate | ||
|
||
# copy used scripts | ||
COPY ./run_postprocess.sh ./pack.sh ./check_import.py ./prepare_distribution.py /app | ||
COPY ./build_geocoder.sh /app/build_geocoder.sh | ||
|
||
COPY ./mapbox_planetiler_split.py ./hierarchy.py /app | ||
|
||
RUN mkdir mapbox_scripts | ||
COPY ./mapbox/make_packs.py /app/mapbox_scripts/ | ||
|
||
RUN mkdir valhalla_scripts | ||
COPY ./valhalla/make_packs.py /app/valhalla_scripts/ | ||
|
||
COPY \ | ||
./prepare_countries.py \ | ||
./mapbox_country_pack.py \ | ||
./valhalla_country_pack.py \ | ||
/app | ||
|
||
# command | ||
CMD /app/run_postprocess.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM alpine | ||
RUN apk --update add openssl wget && rm -rf /var/cache/apk/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.