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

Docker image for Overpass #374

Closed
wants to merge 16 commits into from
Closed

Conversation

wiktorn
Copy link
Contributor

@wiktorn wiktorn commented Mar 12, 2017

Based on NGINX image. Uses supervisord to run:

  • nginx
  • fastcgi wrapper
  • Overpass dispatcher
  • fetch_osc.sh
  • apply_osc_to_db.sh

On first run initializes itself with the data. Details provided in README_Docker.md.

This depends on changes in: #373. apply_osc_to_db.sh may start before dispatcher is ready. Thanks to changes in #373 it will die and start again, when dispatcher is fully working.

Changes in src/bin/fetch_osc.sh skips the download of files already available locally on restart of the container.

wiktorn added 2 commits March 12, 2017 23:10
Based on NGINX image. Uses supervisord to run:
* nginx
* fastcgi wrapper
* Overpass dispatcher
* fetch_osc.sh
* apply_osc_to_db.sh

On first run initializes itself with the data. Details provided in README_Docker.md.
@mmd-osm
Copy link
Contributor

mmd-osm commented Mar 13, 2017

Thanks! This needs some cross checking with what has already been done in #318 and the +/- 5 other Docker images proposed so far. One example is the topic of area creation and running an area dispatcher.

@wiktorn
Copy link
Contributor Author

wiktorn commented Mar 13, 2017

I was using some of the Dockerfiles as inspiration. The only part that I'm aware, that's missing is:

  • area creation
  • attic support

If for areas support I need two extra processes:

  • $EXEC_DIR/bin/dispatcher --areas --db-dir=$DB_DIR
  • EXEC_DIR/bin/rules_loop.sh $DB_DIR

And populate $DB_DIR with src/rules on initialization, then it looks like an easy way forward.

@mmd-osm
Copy link
Contributor

mmd-osm commented Mar 13, 2017

Compression settings could also be interesting beyond area and attic support.

wiktorn and others added 6 commits March 14, 2017 00:30
Add liblz4 to image so Overpass will support additional compression algorithm.
Add two processes:
* dispatcher_areas - for calculating areas
* areas_rules - rules loop

Added src/rules to databases directory

Added OVERPASS_COMPRESSION environment variable

Added `attic` value to OVERPASS_META variable
@wiktorn
Copy link
Contributor Author

wiktorn commented Mar 14, 2017

I've just added area creation, attic support.

I've tried added compression but though i added --enable-lz4 and it looks like it's properly identified, bin/update_database doesn't report --compression=lz4.
configure log:

checking lz4.h usability... yes
checking lz4.h presence... yes
checking for lz4.h... yes
checking for LZ4_compress in -llz4... yes
$ cat /app/src/config.h | grep LZ4
#define HAVE_LZ4 1

$ /app/bin/update_database -h
Unkown argument: -h
Usage: /app/bin/update_database [--db-dir=DIR] [--version=VER] [--meta|--keep-attic] [--flush_size=FLUSH_SIZE] [--compression_method=(no|gz)]

@mmd-osm
Copy link
Contributor

mmd-osm commented Mar 15, 2017

bin/update_database doesn't report --compression=lz4.

I think that's a bug in the coding (

std::cerr<<"Usage: "<<argv[0]<<" [--db-dir=DIR] [--version=VER] [--meta|--keep-attic] [--flush_size=FLUSH_SIZE]"
): the help/usage text doesn't correctly reflect the available compression options. It should be similar to line 97 in update_database.cc.

Obviously, the parameter itself is also incorrect: --compression_method is given in the usage text, while the coding expects --compression-method . And of course, there's also a --map-compression-method parameter, which is not mentioned at all. At this time the usage text is not really that helpful.

wiktorn added a commit to wiktorn/Overpass-API-old that referenced this pull request Mar 16, 2017
As mentioned in drolbr#374 (comment)
I'm adding missing lz4 information.
META="--meta=$OVERPASS_META"
fi
mkdir -p /db/db \
&& /app/bin/download_clone.sh --db-dir=/db/db --source=http://dev.overpass-api.de/api_drolbr/ $META "--compresion_method=$OVERPASS_COMPRESSION" \
Copy link
Contributor

@mmd-osm mmd-osm Mar 17, 2017

Choose a reason for hiding this comment

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

download_clone.sh just downloads existing files from dev.overpass-api.de with a predefined compression setting, i.e. there's not much point to provide a compression method parameter, as it will not have any impact.

Your documentation above correctly mentions that this only works in init mode, though.


if [ "$OVERPASS_MODE" = "init" ]; then
lftp -c "get -c \"$OVERPASS_PLANET_URL\" -o /db/planet; exit" \
&& /app/bin/init_osm3s.sh /db/planet /db/db /app "--meta=$OVERPASS_META" \
Copy link
Contributor

Choose a reason for hiding this comment

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

compression setting is better suited here.

`OVERPASS_COMPRESSION` makes sense only for init_osm3s not for download_clone.

Reported by: @mmd-osm
@wiktorn
Copy link
Contributor Author

wiktorn commented Mar 17, 2017

God catch, thanks.

@@ -23,7 +23,7 @@ if [ ! -d /db/db ] ; then

if [ "$OVERPASS_MODE" = "init" ]; then
lftp -c "get -c \"$OVERPASS_PLANET_URL\" -o /db/planet; exit" \
&& /app/bin/init_osm3s.sh /db/planet /db/db /app "--meta=$OVERPASS_META" \
&& /app/bin/init_osm3s.sh /db/planet /db/db /app "--meta=$OVERPASS_META" "--compresion_method=$OVERPASS_COMPRESSION" \
Copy link
Contributor

@mmd-osm mmd-osm Mar 17, 2017

Choose a reason for hiding this comment

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

... and the parameter should be --compression-method= with a dash (not an underscore, the usage text is wrong) and two "s" in compression.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll create a seperate pull request for usage text

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#381 it is

mmd-osm added a commit to mmd-osm/Overpass-API that referenced this pull request Mar 17, 2017
commit f2560c7
Author: W <[email protected]>
Date:   Fri Mar 17 16:14:07 2017 +0100

    Add --map-compression-method to usage message

commit c71d26e
Author: W <[email protected]>
Date:   Fri Mar 17 16:00:12 2017 +0100

    Fix spelling of parameter name in usage message

commit 122ea06
Author: W <[email protected]>
Date:   Thu Mar 16 22:56:00 2017 +0100

    Fix help message for LZ4 compilation.

    As mentioned in drolbr#374 (comment)
    I'm adding missing lz4 information.
@wiktorn wiktorn closed this May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants