Repository navigation
Adapt graphhopper script for dropwizard branch - #1319
Conversation
…ameter is required if empty); avoid starting admin connector
| fi | ||
|
|
||
| # default init, https://stackoverflow.com/a/28085062/194609 | ||
| : "${CONFIG:=config.yml}" |
There was a problem hiding this comment.
: is a easy-to-miss synonym for true. This form is clearer (or at least far more common):
CONFIG=${CONFIG:-config.yml}
and doesn't require studying a stackoverflow post.
There was a problem hiding this comment.
Nice update.
I was reading again the flags, and I have perhaps others suggestions:
- -r for --datareader.file
- -d for --run-backgound or --detach (which is really common for different software)
- -f for --force-download (it can still be -fd!)
There was a problem hiding this comment.
@legraina Thanks! For -r I'm not sure. I think -f for "file" is not uncommon. Maybe -i or -in for input as we have -o for output ...
and doesn't require studying a stackoverflow post.
@justinmk2 the other method requires typing the variable twice ;) (maybe useful later for long variables) and to be honest the :- is not 100% clear too and the := smells more intuitive
…0.0, then we can start admin panel and remove IPFilter
… and the gtfs input file
|
Have updated also with look to comments from @legraina. For me this seems to be ok for now and we should try this a bit and improve step by step, e.g. some actions do not work at all but this would require some more class similar to the import action. Using GTFS is also possible now with this script E.g. the short form looks like: long form: (the test failure is something else I tried to fix in another commit but obviously it wasn't that successful) update: the short form looks like: long form: |
| echo "-c | --config: specify the application configuration" | ||
| echo "-host: specify to which host the service should be bound" | ||
| echo "-port: start web server at specific port" | ||
| echo "-jar: specify the jar file (useful if you want to reuse this script for custom builds)" |
There was a problem hiding this comment.
or should we better do something like -h | --host and -p | --port (clashes with --profiles) and -j | --jar?
There was a problem hiding this comment.
Yes, it will be nice. I think you should use -p for port, and perhaps just --profile without a short version.
There was a problem hiding this comment.
ok. Maybe -v for --vehicle-profiles but yes, --profiles is also ok
There was a problem hiding this comment.
-h for --host would clash with -h for help :)
There was a problem hiding this comment.
And -v should be used for version. So I currently prefer to use --host and --port and --jar
|
Looks good to me.. Nice to see that the script could get shorter. |
…'-' prefix; use -- for parameters longer than 2 characters; added possibility to print version
* Initial attempt at dropwizardifying * Remove CmdArgsModule * For example: ChangeGraph * For example: Nearest * No more Guice, no more Servlets * Bundle configuration; mergin of system properties * config-example.yml * Add OSM file name to example * Add port number to example config * Dropwizard import command * ChangeGraphResource is disabled by default * rename hk2 factories to *Factory * redirect to webapp from root * dropwizard 1.1.2 * Add banner.txt * Restore tests for http error status codes, and fix it. * Insert separate fields for planned/predicted departure/arrival time Signed-off-by: Michael Zilske <[email protected]> * Set the expected times fields only when there is an update. Signed-off-by: Michael Zilske <[email protected]> * Insert separate fields for planned/predicted departure/arrival time * Bump Dropwizard version; declare J2EE dependencies (for Java 9) Signed-off-by: Michael Zilske <[email protected]> * Use the same Jackson version in the client. Signed-off-by: Michael Zilske <[email protected]> * Remove client-duplicate, as in master Signed-off-by: Michael Zilske <[email protected]> * Adapt to refactoring Signed-off-by: Michael Zilske <[email protected]> * Use shade plug-in as per Dropwizard doc Signed-off-by: Michael Zilske <[email protected]> * Disable Dropwizard admin port in default config Signed-off-by: Michael Zilske <[email protected]> * Remove empty files Signed-off-by: Michael Zilske <[email protected]> * Fix banner Signed-off-by: Michael Zilske <[email protected]> * Move webapp from /webapp to /maps Signed-off-by: Michael Zilske <[email protected]> * Disable request log Signed-off-by: Michael Zilske <[email protected]> * Add a (not very strong) Dropwizard health check to each of the two API variants. I think this is okay for now -- they are thinking more of testing the health of external services such as databases. Signed-off-by: Michael Zilske <[email protected]> * Adapt graphhopper script for dropwizard branch (#1319) * adapt graphhopper.sh script for dropwizard * now variable JETTY_PORT works (empty would result in random so no parameter is required if empty); avoid starting admin connector * minor fix * improve security and bind to private localhost instead of public 0.0.0.0, then we can start admin panel and remove IPFilter * improve script and include some shortcut to specifiy vehicle profiles and the gtfs input file * remove logging echo statement * 'detaching' does not need a value * minor improvements * forward parameters as there won't be compatibility issues due to the '-' prefix; use -- for parameters longer than 2 characters; added possibility to print version * minor cleanup * sort alphabetically * added author when adapting graphhopper.sh script for dropwizard #1319 * avoid unnecessary dependency like commons logging * merged master * use WebApplicationException * no tools jar possible, use web jar via ImportCommand * updated docs * revert change explicitely #1313
And replaces #1244
some more short parameters (test measurement and torture)doesn't work at all. we should fix in different PRconvert all unknown parameters intoProblem is that this could hide compatibility issues between this and the old arguments. We can do this in one of the next releases as for now other parameters are possible via the old-Dgraphhopper.<unknown>instead of printing the error?export GH_WEB_OPTS=xyapproachmake old approach working:useexport JETTY_PORT=8990;./graphhopper.sh web ~/Downloads/berlin-latest.osm.pbfeven when port is removed from config-portcommand line option insteadeven if not configured the admin stuff is started!no problem when we bind to localhosttest IPFiltercan be remove since we bind to localhostLet us also document the old vs. the new way of configuring something: