Skip to content

Commit

Permalink
Merge pull request #684 from GIScience/release_6.1
Browse files Browse the repository at this point in the history
Release 6.1
  • Loading branch information
takb authored Mar 23, 2020
2 parents 870d4df + a5283ea commit d73b758
Show file tree
Hide file tree
Showing 110 changed files with 1,741 additions and 729 deletions.
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,34 @@
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
### Fixed
### Changed
### Deprecated

## [6.1.0] - 2020-03-06
### Added
- Hebrew language support (thanks to [citizen-dror](https://github.com/GIScience/openrouteservice/commits?author=citizen-dror) for the translation)
- Configuration options to limit avoid_polygon routing option by area and/or extent ([#629](https://github.com/GIScience/openrouteservice/issues/629))
- Configuration options to limit count parameter and distance when using alternative routes algorithm ([#651](https://github.com/GIScience/openrouteservice/issues/651))
- Configuration options to limit distance when using round trip routing algorithm ([#658](https://github.com/GIScience/openrouteservice/issues/658))
- Enable CALT routing algorithm for cycling profiles ([#662](https://github.com/GIScience/openrouteservice/issues/662))
- Configuration options to send conditional system messages with API responses ([#664](https://github.com/GIScience/openrouteservice/issues/664))
### Fixed
- more consistent language API parameters (ISO 639-1 codes & IETF tags)
- Nepali language support can be selected through API
- Fixed invalid JSON and GeoJSON when including elevation ([#640](https://github.com/GIScience/openrouteservice/issues/640))
- Added graph date for isochrones and matrix service and fixed the 0 output ([#648](https://github.com/GIScience/openrouteservice/issues/648))
- Fixed memory issue at graph building ([#659](https://github.com/GIScience/openrouteservice/issues/659))
- Improve way category assignment for ferry connections ([#678](https://github.com/GIScience/openrouteservice/issues/678))
### Changed
- Make Docker setup more flexible wrt customizations ([#627](https://github.com/GIScience/openrouteservice/issues/627))
- Updated GraphHopper to newer version (0.13)
- Give more details to green and quiet routing API descriptions ([#632](https://github.com/GIScience/openrouteservice/issues/632))
### Deprecated

## [6.0.0] - 2019-12-03
### Added
- Indonesian Translation Language
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ We :heart: pull requests! We also aspire to make our commit history cleaner and
We'd like all pull requests to adhere to the following rules:

- a PR has to **close an issue**. If there is none yet for yours, please [create one](https://github.com/GIScience/openrouteservice/issues/new)
- branch off [development](https://github.com/GIScience/openrouteservice/tree/development)
- branch off [master](https://github.com/GIScience/openrouteservice/tree/master)
- name your branch according to `<[hotfix/bugfix/feat/algo]>/<issue#>-<purpose>`, e.g. `[feat]/#381-simplify_geometry`
- if you introduce new functions/classes, write unit or API tests
- **limit the number of commits to a minimum**, i.e. use [`git commit --amend [--no-edit]`](https://www.atlassian.com/git/tutorials/rewriting-history#git-commit--amend)
Expand All @@ -73,7 +73,7 @@ git stash pop

Be extra careful using `rebase` commands when collaborating on a branch with other people.

**Don't merge** `development` branch into your feature branch.
**Don't merge** `master` branch into your feature branch.

### Contributing code

Expand Down
30 changes: 10 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ FROM openjdk:8-jdk
ENV MAVEN_OPTS="-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
ENV MAVEN_CLI_OPTS="--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"

ARG APP_CONFIG=docker/conf/app.config.sample
ARG OSM_FILE=docker/data/heidelberg.osm.gz
ARG JAVA_OPTS
ARG CATALINA_OPTS
ARG APP_CONFIG=./docker/conf/app.config.sample
ARG OSM_FILE=./docker/data/heidelberg.osm.gz
# Install tomcat
RUN wget -q https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.32/bin/apache-tomcat-8.0.32.tar.gz -O /tmp/tomcat.tar.gz

# Install required deps
RUN apt-get update -qq
RUN apt-get install -qq -y locales wget nano maven
RUN apt-get update -qq && apt-get install -qq -y locales wget nano maven

# Set the locale
RUN locale-gen en_US.UTF-8
Expand All @@ -31,22 +30,13 @@ WORKDIR /ors-core
# Build openrouteservice
RUN mvn -q -f ./openrouteservice/pom.xml package -DskipTests

# Install tomcat
RUN mkdir /usr/local/tomcat
RUN wget -q https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.32/bin/apache-tomcat-8.0.32.tar.gz -O /tmp/tomcat.tar.gz

RUN cd /tmp && tar xvfz tomcat.tar.gz
RUN cp -R /tmp/apache-tomcat-8.0.32/* /usr/local/tomcat/

# Add tomcat custom settings if provided
RUN touch /usr/local/tomcat/bin/setenv.sh
RUN echo "CATALINA_OPTS=\"$CATALINA_OPTS\"" >> /usr/local/tomcat/bin/setenv.sh
RUN echo "JAVA_OPTS=\"$JAVA_OPTS\"" >> /usr/local/tomcat/bin/setenv.sh
RUN cd /tmp && tar xvfz tomcat.tar.gz && mkdir /usr/local/tomcat && cp -R /tmp/apache-tomcat-8.0.32/* /usr/local/tomcat/

# Copy ors app into tomcat webapps
RUN cp /ors-core/openrouteservice/target/*.war /usr/local/tomcat/webapps/ors.war
RUN cp -f /ors-core/openrouteservice/target/*.war /usr/local/tomcat/webapps/ors.war

COPY ./docker-entrypoint.sh /docker-entrypoint.sh

# Start the container
EXPOSE 8080
CMD /usr/local/tomcat/bin/catalina.sh run

ENTRYPOINT ["/bin/bash", "/docker-entrypoint.sh"]
2 changes: 1 addition & 1 deletion PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Pull Request Checklist
<!--- Please make sure you have completed the following items BEFORE submitting a pull request (put an x in each box when you have checked you have done them): -->
- [ ] 1. I have [**rebased**](https://github.com/GIScience/openrouteservice/blob/master/CONTRIBUTE.md#pull-request-guidelines) the latest version of the development branch into my feature branch and all conflicts have been resolved.
- [ ] 1. I have [**rebased**](https://github.com/GIScience/openrouteservice/blob/master/CONTRIBUTE.md#pull-request-guidelines) the latest version of the master branch into my feature branch and all conflicts have been resolved.
- [ ] 2. I have added information about the change/addition to functionality to the CHANGELOG.md file under the [Unreleased] heading.
- [ ] 3. I have documented my code using JDocs tags.
- [ ] 4. I have removed unnecessary commented out code, imports and System.out.println statements.
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Openrouteservice offers a set of endpoints for different spatial purposes. They

## API Documentation

For an easy and interactive way to test the api, visit our documentation at [openrouteservice.org](https://openrouteservice.org).
For an easy and interactive way to test the api, visit our documentation at [openrouteservice.org](https://openrouteservice.org/dev/#/api-docs).
After obtaining your key you can try out the different endpoints instantly and start firing requests.


Expand All @@ -97,6 +97,4 @@ For questions please use our [community forum](https://ask.openrouteservice.org)

## Translations

If you notice any thing wrong with translations, or you want to add a new language to the ORS instructions, please add/edit files in the src/main/resources/locales folder. You can use the ors_en.resources file as a template as to what information needs to be present.
As a guide, for each instruction there are two formats - one where there is a named place (i.e. 47 Berlinerstraße) and one without. It is important to keep the {way_name} tag in the text, but it should be moved to the correct location.
To show ORS what language is being used, you should alter the name of the file to include the ISO identifier (i.e. for Austrian German the filename would be ors_de_AT.resources).
If you notice any thing wrong with translations, or you want to add a new language to the ORS instructions, we have some instructions on our [wiki page](https://github.com/GIScience/openrouteservice/wiki/Contributing-Translations) about how you can submit an update. You can also look over at our [maps client GitHub](https://github.com/GIScience/openrouteservice-app/#translations) if you want to contribute the language to there aswell (adding or editing the language in the openrouteservice GitHub repo only affects the instructions - any new language also needs adding to the client).
22 changes: 22 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

graphs=/ors-core/data/graphs

if [ -z "${CATALINA_OPTS}" ]; then
export CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.rmi.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost"
fi

if [ -z "${JAVA_OPTS}" ]; then
export JAVA_OPTS="-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g"
fi

echo "CATALINA_OPTS=\"$CATALINA_OPTS\"" > /usr/local/tomcat/bin/setenv.sh
echo "JAVA_OPTS=\"$JAVA_OPTS\"" >> /usr/local/tomcat/bin/setenv.sh

if [ "${BUILD_GRAPHS}" = "True" ]; then
if [ -d "$graphs" ]; then rm -Rf "$graphs"; fi
fi

/usr/local/tomcat/bin/catalina.sh run
# Keep docker running easy
exec "$@"
57 changes: 47 additions & 10 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,61 @@

Installing the openrouteservice backend service with **Docker** is quite straightforward.

Please clone the repository and run the following command within this `docker/` directory:
Please clone the repository and run the following command within the `docker/` directory:

```bash
cd docker
docker-compose up -d
```

This will:

1. Build the openrouteservice [war file](https://www.wikiwand.com/en/WAR_(file_format)) from the local codebase with the `docker/conf/app.config.sample` as the config file and the OpenStreetMap dataset for Heidelberg under `docker/data/` as sample data.
2. Launch the openrouteservice service on port `8080` within a tomcat container.
1. Build the openrouteservice [war file](https://www.wikiwand.com/en/WAR_(file_format)) from the local codebase and on container startup it sets `docker/conf/app.config.sample` as the config file and the OpenStreetMap dataset for Heidelberg under `docker/data/heidelberg.osm.gz` as sample data.
2. Launch the openrouteservice service on port `8080` within a tomcat container at the address `http://localhost:8080/ors`.

By default the service status is queryable via the `http://localhost:8080/ors/health` endpoint. When the service is ready, you will be able to request `http://localhost:8080/ors/status` for further information on the running services.
If you use the default dataset you will be able to request `http://localhost:8080/ors/routes?profile=foot-walking&coordinates=8.676581,49.418204|8.692803,49.409465` for test purposes.
## Environment variables

- `BUILD_GRAPHS`: Forces ORS to rebuild the routings graph(s) when set to `True`. Useful when another PBF is specified in the Docker volume mapping to `/ors-core/data/osm_file.pbf`
- `JAVA_OPTS`: Custom Java runtime options, such as `-Xms` or `-Xmx`
- `CATALINA_OPTS`: Custom Catalina options

Specify either during container startup or in `docker-compose.yml`.

## Build arguments

When building the image, the following arguments are customizable:

- `APP_CONFIG`: Can be changed to specify the location of a custom `app.config` file. Default: `./docker/conf/app.config.sample`.
- `OSM_FILE`: Can be changed to point to a local custom OSM file.

These settings are also configurable during container startup in various ways.

## Customization

Once you have a built image you can decide to start a container with differently configured openrouteservice, e.g. changing the OSM file or other settings in the `app.config.sample`.

## Run with your own OpenStreetMap dataset
### Different OSM file

Save your OSM dataset (formats supported are `.osm`, `.osm.gz`, `.osm.zip` and `.pbf`) in the `docker/data/` directory and then adapt `docker-compose.yml`.
Afterwards run `docker-compose up -d` (if you want to rebuild graphs with a new OSM file first of all delete the contents of the `docker/graphs` folder and restart the service with `docker-compose up -d`).
Either you point the build argument `OSM_FILE` to your desired OSM file during building the image.

It should be mentioned that if your dataset is very large, please adjust the `-Xmx` parameter of `JAVA_OPTS` in `docker-compose.yml`.
According to our experience, this should be at least `180g` for the whole globe if you are planning to use 3 or more modes of transport at the same time.
Or to change the PBF file when restarting a container:
- change the volume that `/ors-core/data/osm_file.pbf` is mapping to your file location, e.g. `docker run -d -p 8080:8080 -v ./data/andorra-latest.osm.pbf:/ors-core/data/osm_file.pbf docker_ors-app` or in `docker-compose.yml`
- set the `BUILD_GRAPHS` variable to `True`, e.g. `docker run -d -p 8080:8080 -e BUILD_GRAPHS=True ./data/andorra-latest.osm.pbf:/ors-core/data/osm_file.pbf docker_ors-app` or in `docker-compose.yml`

It should be mentioned that if your dataset is very large, please adjust the `-Xmx` parameter of `JAVA_OPTS` environment variable. A good rule of thumb is to give Java 2 x file size of the PBF **per profile**.

Note, `.osm`, `.osm.gz`, `.osm.zip` and `.pbf` file format are supported for OSM files.

### Customize `app.config.sample`

Either you point the build argument `APP_CONFIG` to your custom `app.config` file.

Or to change the configuration for ORS when restarting a container:
- change (or even rename) the `/conf/app.config.sample` file
- set the config file as volume mapping to `/ors-core/openrouteservice/target/classes/app.config`, e.g. `docker run -d -p 8080:8080 -v ./conf/app.config.sample:/ors-core/openrouteservice/target/classes/app.config docker_ors-app` or in `docker-compose.yml`

## Checking

By default the service status is queryable via the `http://localhost:8080/ors/health` endpoint. When the service is ready, you will be able to request `http://localhost:8080/ors/status` for further information on the running services.

If you use the default dataset you will be able to request `http://localhost:8080/ors/routes?profile=foot-walking&coordinates=8.676581,49.418204|8.692803,49.409465` for test purposes.
36 changes: 35 additions & 1 deletion docker/conf/app.config.sample
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@
"instructions": true,
"maximum_distance": 100000,
"maximum_segment_distance_with_dynamic_weights": 100000,
"maximum_distance_round_trip_routes": 100000,
"maximum_waypoints": 50
"maximum_avoid_polygon_area": 200000000,
"maximum_avoid_polygon_extent": 20000,
},
"profile-vehicles-car":{
"profiles":"driving-car",
Expand Down Expand Up @@ -285,6 +288,37 @@
"level_file": "PRODUCTION_LOGGING.json",
"location": "/var/log/ors",
"stdout": true
}
},
system_message: [
{
active: false,
text: "This message would be sent with every routing bike fastest request",
condition: {
"request_service": "routing",
"request_profile": "cycling-regular,cycling-mountain,cycling-road,cycling-electric",
"request_preference": "fastest"
}
},
{
active: false,
text: "This message would be sent with every request for geojson response",
condition: {
"api_format": "geojson"
}
},
{
active: false,
text: "This message would be sent with every request on API v1 from January 2020 until June 2050",
condition: {
"api_version": 1,
"time_after": "2020-01-01T00:00:00Z",
"time_before": "2050-06-01T00:00:00Z"
}
},
{
active: false,
text: "This message would be sent with every request"
}
]
}
}
37 changes: 20 additions & 17 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
version: '3'
services:
ors-app:
container_name: ors-app
ports:
- 8080:8080
build:
context: ../
args:
APP_CONFIG: ./docker/conf/app.config.sample
OSM_FILE: ./docker/data/heidelberg.osm.gz
JAVA_OPTS: -Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g
CATALINA_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.rmi.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost
volumes:
- ./graphs:/ors-core/data/graphs
- ./elevation_cache:/ors-core/data/elevation_cache
- ./logs/ors/:/var/log/ors/
- ./logs/tomcat/:/usr/local/tomcat/logs

ors-app:
container_name: ors-app
ports:
- 8080:8080
build:
context: ../
args:
APP_CONFIG: ./docker/conf/app.config.sample
OSM_FILE: ./docker/data/heidelberg.osm.gz
volumes:
- ./graphs:/ors-core/data/graphs
- ./elevation_cache:/ors-core/data/elevation_cache
- ./logs/ors/:/var/log/ors/
- ./logs/tomcat/:/usr/local/tomcat/logs
- ./conf/app.config.sample:/ors-core/openrouteservice/target/classes/app.config
- ./data/heidelberg.osm.gz:/ors-core/data/osm_file.pbf
environment:
- BUILD_GRAPHS=False # Forces the container to rebuild the graphs, e.g. when PBF is changed in app.config
- JAVA_OPTS="-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g"
- CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.rmi.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost"
Loading

0 comments on commit d73b758

Please sign in to comment.