Commit Graph

406 Commits

Author SHA1 Message Date
Siarhei Fedartsou
51a8486375
Fix performance issues after migration to sol2 3.3.0 (#6304)
* Fix performance issues after migration to sol2 3.3.0
2022-08-15 23:10:56 +01:00
Siarhei Fedartsou
440c00064e
Remove EXACT from find_package if using Conan (#6299)
* Remove EXACT from find_package if using Conan
2022-08-15 21:21:01 +01:00
Patrick Niklaus
e5450e8c68
Remove highway=bicycle safety bonus (#6296)
* Remove highway=bicycle safety bonus

This removes a bonus for a road class that doesn't exist (cycleway would
be correct), but the code was buggy since safety_bonus is nil and caused
an arithmetic exception. We only caught this 4 (!) years later since
recently a way was tagged with highway=bicycle and made it in our OSM
data leading to preprocessing failures.
2022-08-15 21:14:37 +01:00
Siarhei Fedartsou
f19247a7ca
Pass osm_node_ids by reference in osrm::updater::Updater class (#6298) 2022-08-15 21:12:58 +01:00
Siarhei Fedartsou
e7185b4bcb
Use Boost.Beast to parse HTTP request (#6294) 2022-08-02 21:12:05 +01:00
Siarhei Fedartsou
00816722dd
Configure Undefined Behaviour Sanitizer (#6290) 2022-08-01 22:40:26 +01:00
Siarhei Fedartsou
589becbfec
Use Conan instead of Mason to install code dependencies (#6284)
* Use Conan instead of Mason to install code dependencies
2022-08-01 21:21:20 +01:00
Siarhei Fedartsou
4e8ee288d9
Migrate to C++17. Update sol2 to 3.3.0. (#6279)
* Migrate to C++17. Update sol2 to 3.3.0.
2022-07-31 00:56:17 +01:00
Siarhei Fedartsou
204fdaff6e
Fix bug with reading Set values from Lua scripts. (#6285)
* Fix bug with reading Set values from Lua scripts.

* Add test for foot profile named-road suffixes

Co-authored-by: Michael Bell <michael@mjjbell.com>
2022-07-30 23:14:06 +01:00
Siarhei Fedartsou
1a3d0f7c20
Update macOS CI image to macos-11 (#6286)
* Update macOS CI image to macos-11
2022-07-30 13:40:21 +01:00
Siarhei Fedartsou
06b1b980bb
Enable even more clang-tidy checks (#6273) 2022-07-04 21:46:59 +01:00
Siarhei Fedartsou
19d2ec56b8
Configure CMake to not build flatbuffers tests and samples (#6274)
* Do not build flatbuffers tests and samples
2022-07-03 23:59:54 +01:00
Siarhei Fedartsou
3d2db20777
Enable more clang-tidy checks. (#6270)
* Enable more clang-tidy checks
2022-06-30 14:32:12 +01:00
Siarhei Fedartsou
59953172e8
Configure clang-tidy job on CI (#6261) 2022-06-28 00:14:28 +01:00
John Doe
79d4363d59
Enable arm docker build (#6172)
This issue enables dockerX for multi-arch docker image building. 
Resulting images can be run on x86 and arm processors (for example aws graviton).
2022-03-08 20:02:11 +00:00
John Doe
662a8d0a12
Split build command into two layers (#6175)
* Split build command into two layers

Co-authored-by: nurikk <ainur@yojee.com>
2022-02-16 21:18:28 +00:00
Michael Bell
1e70b645e4 Fix generation of NodeJS API documentation
NodeJS API docs are out of sync with NodeJS C++ wrapper documentation
due to the doc build breaking back in #4043.

The commit fixes the Node dev dependencies such that `npm run docs`
works again and re-enables the check in CI.
2021-12-23 11:10:39 +00:00
Michael Bell
2c81083406 Fix CI 32-bit build
A recent change to the Ubuntu Focal CI worker - either a CMake upgrade,
or default installation of the libexpat-dev library - leads to the
32-bit expat library to not be found by CMake.

FindPackage(EXPAT) finds the library via pkg-config, so the fix is
to explicitly include the i386 pkg-config directory in the
PKG_CONFIG_PATH environment variable list.
2021-12-22 23:25:19 +00:00
Michael Bell
472cce6742 Fix Mason CMake installation
During the CI migration to Github Actions, a bug was introduced
such that Mason CMake is not being added to the PATH environment
variable correctly, so it defaults to the CMake installed in the
OS environment.

Simple fixing the typo fails as the Mason CMake version requires
libssl 1.0 as a dependency, whilst the Ubuntu Focal runners are
on the newer libssl 1.1. Therefore, we also bump the Mason
CMake version to 3.21.2.
2021-12-22 23:25:19 +00:00
Daniel Patterson
d5cd702242
Enable all unit tests (#5248)
* Add missing profile name to library extract test.

* Support both tzid and TZID properties on timezone geometry.  Improve validation of timezone polygons.

* Missing tzid property wasn't a geojson validation issue, shouldn't have been tested there.

* Use filesystem glob to loop over all test executables so we don't miss any in the future.

Co-authored-by: Michael Bell <michael@mjjbell.com>
2021-10-22 22:10:25 +01:00
Torben Hørup
b120c971a0
Make osrm-routed optional (#6144)
* Make osrm-routed optional

* Updated changelog

* require boost 1.60

* Update CMakeLists.txt

* Update CHANGELOG.md

Co-authored-by: Michael Bell <michael@mjjbell.com>
2021-10-08 17:06:55 +01:00
Michael Bell
eb3bf5cfe3 Upgrade Ubuntu CI builds to use 20.04
Moves Linux CI builds to the latest Ubuntu LTS.
- Bumps the GCC matrix to versions {7,8,9,10,11}, making 9 the default
for testing non-standard builds.
- Bump Node matrix to {12,14,16,LTS,latest} now that 10 is EOL.
- Fixes to CI builds due to library changes on newer distro.
2021-09-30 22:51:12 +01:00
Michael Bell
56a427f839 Upgrade Boost to 1.70, fix inefficient connection handling
A request to osrm-routed can be assigned to a thread which
is currently busy processing another request, even when there
are other threads/cores available. This unnecessarily delays
the response, and can make requests appear to hang when
awaiting CPU intensive requests to finish.

The issue looks like a bug in Boost.Asio multithreaded
networking stack.

osrm-routed server implementation is
heavily influenced by the HTTP server 3 example in the
Boost.Asio docs. By upgrading to Boost 1.70 and updating the
server connections to match the example provided in the 1.70
release, the problem is resolved.

The diff of the changes to the Boost.Asio stack are
vast, so it's difficult to identify the exact cause. However
the implementation change is to push the strand of execution
into the socket (and timer) objects, which suggests it could
fix the type of threading issue we are observing.
2021-09-30 22:51:12 +01:00
Torben Hørup
73a2b91251
Add GH actions script for docker image (#6138)
* Add GH actions script for docker image

* Updated Changelog
2021-09-30 19:45:15 +01:00
Daniel Patterson
b739658681
Reset for next release. 2021-09-21 14:50:45 -07:00
Michael Bell
2d1e620429
Fix test cache to consider MLD executable changes (#6129)
* Fix test cache to consider MLD executable changes

Currently the test cache is not invalidated if changes to
osrm-partition or osrm-customize executables. This is problematic
when these executables make breaking changes to the data format.

We fix this by including both in the list of executables that
can invalidate the test cache.

* Executables use hyphens
2021-09-21 12:35:34 -07:00
Michael Bell
f6349a7fbe
Fix metric offset overflow for large MLD partitions (#6124)
Each MLD cell has source and destination nodes.
MLD is keeping a |source| x |destination| sized table
for various metrics (distances, durations, etc) from each
source to all destinations in a cell.

It stores all of the values for a metric in one large array, with
an offset for each cell to find its values. The offset is currently
limited to 32 bit values, which overflows on very large graphs
(e.g. Planet OSM).

We fix this by changing the offsets to be uint64_t types.
2021-09-21 19:25:30 +01:00
Michael Bell
f1f96166c5
Fix MLD level mask generation to support 64-bit masks. (#6123)
The generation of level masks for compactly storing partition cells
supports sizes that can be stored in 64 bits.

The current implementation fails if the total bit sum is 64 bits
exactly. A bit shift mechanism is used that is undefined when the
shift size is equal to the bit size of the underlying type. This
generates an incorrect mask value.

We fix this by adding a special case for a 64 bit offset. Given this
code is called at most |level| times, there will be no effect on
performance. We also update the assertions to reflect 64 bit masks
are now supported.
2021-09-21 18:09:38 +01:00
Michael Bell
f1a6056953 Immediately close bad connections to prevent file exhaustion
osrm-routed does not immediately clean up a keep-alive connection
when the client closes it. Instead it waits for five seconds
of inactivity before removing.

Given a setup with low file limits and clients opening and
closing a lot of keep-alive connections, it's possible for
osrm-routed to run out of file descriptors whilst it waits for
the clean-up to trigger.

Furthermore, this causes the connection acceptor loop to exit.
Even after the old connections are cleaned up, new ones
will not be created. Any new requests will block until the
server is restarted.

This commit improves the situation by:

- Immediately closing connections on error. This includes EOF errors
indicating that the client has closed the connection. This releases
resources early (including the open file) and doesn't wait for the
timer.

- Log when the acceptor loop exits. Whilst this means the behaviour
can still occur for reasons other than too many open files,
we will at least have visibility of the cause and can investigate further.
2021-09-04 01:55:36 +01:00
Michael Bell
d413d0639d Fix Boost link flags in pkg-config file.
In newer versions of cmake, FindBoost uses Imported Targets for library
component variables, rather than file paths to the Boost libraries.

cmake uses these targets when linking (e.g. target_link_library) and
knows how to correctly substitute the values. However, the OSRM
pkg-config file that we generate doesn't do this, and ends up writing
the actual target symbols, hence the errors trying to link Boost::<component>.

To fix this for newer cmake versions, we create an intermediate configure step
that references the linker files for the imported targets. This is followed
by a generate step that performs the correct substitution.
See this thread for more details: https://cmake.org/pipermail/cmake/2018-December/068812.html

This is backwards compatible to the existing min cmake version (3.1).
However, building using cmake 3.1 fails with a package.json parsing error,
so this commit also bumps the min version to 3.2.
2021-09-03 23:49:32 +01:00
Michael Bell
9884684701 Fix generation of inefficient MLD partitions
Duplicate restriction nodes in the edge-based-graph are currently
not in included in a mapping (.osrm.cnbg_to_ebg) from
node-based-graph edges to edge-based-graph nodes.
This mapping is used by the MLD partitioner to assign EBG nodes
to partitions.

The omission from the mapping means all restriction nodes are
included in a special 'invalid' partition. This special partition
will break the geolocation properties of the multi-level hierarchy.
The partition and its super levels will have a large number of
border nodes and very few internal paths between them.

Given the partitioner is the only consumer of the mapping, we fix
the issue by including the duplicate restriction nodes in the mapping,
so that they are correctly assigned to a partition.

This has measurable improvement on MLD routing.
For a country-sized routing network, the fix reduces routing and table
request computation time by ~2% and ~6% respectively.
2021-09-03 22:48:10 +01:00
Michael Bell
0911691008 Fix changelog entry 2021-09-03 18:35:01 +02:00
Michael Bell
eb0c089574 Replace Travis with Github Actions for CI builds
Replace Travis for continuous integration with Github Actions.
The Github Actions pipeline is functionally equivalent, with
all the same build permutations supported.
Whilst the Github Actions offering is broadly equivalent to
Travis, a few changes have been made as part of the migration.

- The 'core' and 'optional' Travis stages have been consolidated
into one build matrix. This is due to the current inability in
Github Actions to share build steps between jobs, so this avoids
having to duplicate the steps.
Optional stage jobs will now run in parallel with core jobs,
but they still remain optional in the sense that they don't fail
the build.

- A number of existing Github Action plugins are used to replace
functionality provided by Travis or other tools:
Node setup, caching, Codecov, publishing release artifacts.

- Linux builds are updated to build on Ubuntu 18.04.
MacOS builds are updated to run on 10.15. Similar to the
Travis Xenial upgrade attempt, some changes are required due
to underlying platform and compiler upgrades. This means some
Node 10 toolchains will no longer be supported.

Whilst there is opportunity to upgrade some dependencies and
make the CI steps more idiomatic, I've left this for future changes
and just focussed on functional replication.
2021-09-03 18:35:01 +02:00
Mateusz Konieczny
8af4f700f7 fix link in the changelog 2021-09-03 11:14:22 +02:00
Patrick Niklaus
ba4e7bfa11 Add changelog entry 2021-09-03 10:55:53 +02:00
Daniel Patterson
ec36319232
Reset main branch after release. 2021-05-17 14:59:48 -07:00
Daniel Patterson
051e931091
Final 5.25 release prep. 2021-05-17 14:57:10 -07:00
Daniel Patterson
3a029d476c
Try pushing tag again. 2021-05-17 14:16:35 -07:00
Daniel Patterson
d97fe2322d
Prep 5.25.0-rc.1 2021-05-17 12:15:04 -07:00
Michael Bell
baca7b70f1
Use Github Releases for hosting node binaries (#6030)
* Use Github Releases for hosting node binaries

Replaces S3 hosting of node binaries with Github Releases.
`node-pre-gyp publish` works exclusively with S3, so upload step
is now performed by the Travis deployment provider.

The behaviour for the package user should not change.
When building a new version tag, Travis will create a release for the
tag if it does not already exist.

* Switch to the osrm-release-automation machine account rather than personal credentials.

Co-authored-by: Daniel Patterson <danpat@danpat.net>
2021-05-17 11:54:08 -07:00
Michael Bell
50f5a753ea Increase PackedOSMIDs size to 34 bits
OSM node 2^33 was created in early April 2021. This and all
subsequently created IDs will be overflowing OSRM node storage
which only support 33 bit IDs.
Bump the number of bits to 34 to double node ID capacity. This
is a breaking change to the data format as it alters the layout
of .osrm.nbg_nodes.
2021-04-24 23:41:02 +01:00
Michael Bell
4ac827a849 Remove redundant loading of .osrm.cell_metrics
When using process memory, MLD cell metrics are loaded twice from
.osrm.cell_metrics - once when loading static data, and again when
loading updatable data. The former appears to be the mistake,
as .osrm.cell_metrics is only listed in `GetUpdatableFiles`.
2021-04-24 21:19:27 +01:00
Michael Bell
8d3ebc64dc Add kerb barrier exception to default car profile
OSM data contains many mistakes that tag kerbs as highway barriers
when instead they are only describing highway crossings.

This PR updates the default car profile to handle these mistakes
and unblock routing on the affected highways.
2021-03-31 01:17:19 +01:00
Jay Zhang
480807500b docs: changelog 2021-03-26 00:28:08 +00:00
Daniel Patterson
574060418a
Update node-pre-gyp to fix Node 12/14 installation problems in some environments. (#5991) 2021-03-23 10:11:46 -07:00
Daniel Patterson
9d81eb327a
Reset master versioning for next release. 2021-01-28 10:31:49 -08:00
Daniel Patterson
781a2ad0f8
Release 5.24.0 2021-01-28 06:11:02 -08:00
Karen Shea
a613375460
Validate source/destination indices correctly in nodejs support (#5595)
* validate source/destination indices correctly

Co-authored-by: Denis Chapligin <denis.chaplygin@wolt.com>
Co-authored-by: Daniel Patterson <danpat@danpat.net>
2021-01-28 06:02:01 -08:00
Richard Fairhurst
960269f95a
Merge pull request #5131 from themylogin/master
Fix turn.roads_on_the_left and turn.roads_on_the right for two-way roads
2021-01-28 14:00:17 +00:00
Daniel Patterson
d4e7b3d60b
Cleanup node dependencies. (#5945)
* Cleanup node dependencies.
2021-01-27 09:17:15 -08:00