Skip to content

Commit 45bea7d

Browse files
authored
Merge branch 'master' into fix-large-osmids-json-rendering
2 parents ef96e49 + 69bdd3a commit 45bea7d

File tree

5 files changed

+75
-182
lines changed

5 files changed

+75
-182
lines changed

.github/workflows/osrm-backend.yml

Lines changed: 10 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193

194194
- name: clang-18-release
195195
continue-on-error: false
196-
node: 18
196+
node: 20
197197
runs-on: ubuntu-24.04
198198
BUILD_TOOLS: ON
199199
BUILD_TYPE: Release
@@ -430,30 +430,12 @@ jobs:
430430
- name: Give tar root ownership
431431
if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON'
432432
run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar
433-
- name: Cache Boost
434-
if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON'
435-
id: cache-boost
436-
uses: actions/cache@v4
437-
with:
438-
path: |
439-
/usr/local/include/boost
440-
/usr/local/lib/libboost*
441-
key: v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }}
442-
restore-keys: |
443-
v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }}
444433

445-
- name: Install Boost
446-
if: steps.cache-boost.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON'
447-
run: |
448-
BOOST_VERSION="1.85.0"
449-
BOOST_VERSION_UNDERSCORE="${BOOST_VERSION//./_}"
450-
wget -q https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_UNDERSCORE}.tar.gz
451-
tar xzf boost_${BOOST_VERSION_UNDERSCORE}.tar.gz
452-
cd boost_${BOOST_VERSION_UNDERSCORE}
453-
sudo ./bootstrap.sh
454-
sudo ./b2 install
455-
cd ..
456-
sudo rm -rf boost_${BOOST_VERSION_UNDERSCORE}*
434+
- name: Install boost
435+
uses: MarkusJx/install-boost@v2
436+
id: install-boost
437+
with:
438+
boost_version: 1.85.0
457439

458440
- name: Install dev dependencies
459441
run: |
@@ -557,6 +539,8 @@ jobs:
557539
echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV
558540
fi
559541
popd
542+
env:
543+
Boost_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
560544
- name: Build example
561545
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }}
562546
run: |
@@ -657,130 +641,9 @@ jobs:
657641
ccache -p
658642
ccache -s
659643
660-
benchmarks:
661-
if: github.event_name == 'pull_request'
662-
needs: [format-taginfo-docs]
663-
runs-on: self-hosted
664-
env:
665-
CCOMPILER: clang-16
666-
CXXCOMPILER: clang++-16
667-
CC: clang-16
668-
CXX: clang++-16
669-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
670-
PR_NUMBER: ${{ github.event.pull_request.number }}
671-
GITHUB_REPOSITORY: ${{ github.repository }}
672-
RUN_BIG_BENCHMARK: ${{ contains(github.event.pull_request.labels.*.name, 'Performance') }}
673-
steps:
674-
- name: Checkout PR Branch
675-
uses: actions/checkout@v4
676-
with:
677-
ref: ${{ github.head_ref }}
678-
path: pr
679-
- name: Activate virtualenv
680-
run: |
681-
python3 -m venv .venv
682-
source .venv/bin/activate
683-
echo PATH=$PATH >> $GITHUB_ENV
684-
pip install "conan<2.0.0" "requests==2.31.0" "numpy==1.26.4"
685-
- name: Prepare data
686-
run: |
687-
if [ "$RUN_BIG_BENCHMARK" = "true" ]; then
688-
rm -rf ~/data.osm.pbf
689-
wget http://download.geofabrik.de/europe/poland-latest.osm.pbf -O ~/data.osm.pbf --quiet
690-
gunzip -c ./pr/test/data/poland_gps_traces.csv.gz > ~/gps_traces.csv
691-
else
692-
if [ ! -f "~/data.osm.pbf" ]; then
693-
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf -O ~/data.osm.pbf
694-
else
695-
echo "Using cached data.osm.pbf"
696-
fi
697-
gunzip -c ./pr/test/data/berlin_gps_traces.csv.gz > ~/gps_traces.csv
698-
fi
699-
- name: Prepare environment
700-
run: |
701-
echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
702-
mkdir -p $HOME/.ccache
703-
ccache --zero-stats
704-
ccache --max-size=256M
705-
- name: Checkout Base Branch
706-
uses: actions/checkout@v4
707-
with:
708-
ref: ${{ github.event.pull_request.base.ref }}
709-
path: base
710-
- name: Build Base Branch
711-
run: |
712-
cd base
713-
npm ci --ignore-scripts
714-
cd ..
715-
mkdir base/build
716-
cd base/build
717-
cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON ..
718-
make -j$(nproc)
719-
make -j$(nproc) benchmarks
720-
cd ..
721-
make -C test/data
722-
- name: Build PR Branch
723-
run: |
724-
cd pr
725-
npm ci --ignore-scripts
726-
cd ..
727-
mkdir -p pr/build
728-
cd pr/build
729-
cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON ..
730-
make -j$(nproc)
731-
make -j$(nproc) benchmarks
732-
cd ..
733-
make -C test/data
734-
# we run benchmarks in tmpfs to avoid impact of disk IO
735-
- name: Create folder for tmpfs
736-
run: |
737-
# if by any chance it was mounted before(e.g. due to previous job failed), unmount it
738-
sudo umount ~/benchmarks | true
739-
rm -rf ~/benchmarks
740-
mkdir -p ~/benchmarks
741-
# see https://llvm.org/docs/Benchmarking.html
742-
- name: Run PR Benchmarks
743-
run: |
744-
sudo cset shield -c 2-3 -k on
745-
sudo mount -t tmpfs -o size=4g none ~/benchmarks
746-
cp -rf pr/build ~/benchmarks/build
747-
cp -rf pr/lib ~/benchmarks/lib
748-
mkdir -p ~/benchmarks/test
749-
cp -rf pr/test/data ~/benchmarks/test/data
750-
cp -rf pr/profiles ~/benchmarks/profiles
751-
752-
sudo cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/pr_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv
753-
sudo umount ~/benchmarks
754-
sudo cset shield --reset
755-
- name: Run Base Benchmarks
756-
run: |
757-
sudo cset shield -c 2-3 -k on
758-
sudo mount -t tmpfs -o size=4g none ~/benchmarks
759-
cp -rf base/build ~/benchmarks/build
760-
cp -rf base/lib ~/benchmarks/lib
761-
mkdir -p ~/benchmarks/test
762-
cp -rf base/test/data ~/benchmarks/test/data
763-
cp -rf base/profiles ~/benchmarks/profiles
764-
765-
# TODO: remove it when base branch will have this file at needed location
766-
if [ ! -f ~/benchmarks/test/data/portugal_to_korea.json ]; then
767-
cp base/src/benchmarks/portugal_to_korea.json ~/benchmarks/test/data/portugal_to_korea.json
768-
fi
769-
# we intentionally use scripts from PR branch to be able to update them and see results in the same PR
770-
sudo cset shield --exec -- cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/base_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv
771-
sudo umount ~/benchmarks
772-
sudo cset shield --reset
773-
- name: Post Benchmark Results
774-
run: |
775-
python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results
776-
- name: Show CCache statistics
777-
run: |
778-
ccache -p
779-
ccache -s
780-
781644
ci-complete:
782-
runs-on: ubuntu-22.04
783-
needs: [build-test-publish, docker-image-matrix, windows-release-node, benchmarks]
645+
runs-on: ubuntu-latest
646+
needs: [build-test-publish, docker-image-matrix, windows-release-node]
784647
steps:
785648
- run: echo "CI complete"
786649

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ endif()
5656
if (POLICY CMP0074)
5757
cmake_policy(SET CMP0074 NEW)
5858
endif()
59+
if (POLICY CMP0167)
60+
cmake_policy(SET CMP0167 NEW)
61+
endif()
5962
project(OSRM C CXX)
6063

6164

@@ -400,7 +403,7 @@ if(ENABLE_CONAN)
400403
# expat and bzip2 are used from conan rather than the system
401404
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
402405
else()
403-
find_package(Boost 1.70 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
406+
find_package(Boost REQUIRED CONFIG COMPONENTS ${BOOST_COMPONENTS})
404407
add_dependency_includes(${Boost_INCLUDE_DIRS})
405408

406409
find_package(TBB REQUIRED)

docker/Dockerfile-alpine

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
1-
FROM alpine:3.20.0 as alpine-mimalloc
1+
FROM alpine:3.21.2 AS alpine-mimalloc
22

3-
RUN apk add --no-cache mimalloc
3+
RUN apk update && \
4+
apk upgrade && \
5+
apk add --no-cache \
6+
boost-iostreams \
7+
boost-program_options \
8+
boost-thread \
9+
mimalloc
410

511
ENV LD_PRELOAD=/usr/lib/libmimalloc.so.2
612
ENV MIMALLOC_LARGE_OS_PAGES=1
713

814

9-
FROM alpine-mimalloc as builder
15+
FROM alpine-mimalloc AS builder
1016
ARG DOCKER_TAG
1117
ARG BUILD_CONCURRENCY
12-
RUN mkdir -p /src && mkdir -p /opt
1318

14-
RUN apk add --no-cache \
15-
cmake make git clang libbz2 libxml2 \
16-
boost-dev boost-program_options boost-filesystem boost-iostreams boost-thread \
17-
lua5.4-dev onetbb-dev expat-dev
19+
RUN mkdir -p /src /opt && \
20+
apk add --no-cache \
21+
boost-dev \
22+
boost-filesystem \
23+
clang \
24+
cmake \
25+
expat-dev \
26+
git \
27+
libbz2 \
28+
libxml2 \
29+
lua5.4-dev \
30+
make \
31+
onetbb-dev
1832

1933
COPY . /src
2034
WORKDIR /src
@@ -39,16 +53,18 @@ RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
3953
rm -rf /src
4054

4155

42-
# Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds
56+
# Multistage build to reduce image size - https://docs.docker.com/build/building/multi-stage/#use-multi-stage-builds
4357
# Only the content below ends up in the image, this helps remove /src from the image (which is large)
44-
FROM alpine-mimalloc as runstage
58+
FROM alpine-mimalloc AS runstage
4559

4660
COPY --from=builder /usr/local /usr/local
4761
COPY --from=builder /opt /opt
4862

4963
RUN apk add --no-cache \
50-
boost-program_options boost-date_time boost-iostreams boost-thread \
51-
expat lua5.4 onetbb && \
64+
boost-date_time \
65+
expat \
66+
lua5.4 \
67+
onetbb && \
5268
ldconfig /usr/local/lib
5369

5470
RUN /usr/local/bin/osrm-extract --help && \
@@ -60,3 +76,4 @@ RUN /usr/local/bin/osrm-extract --help && \
6076
WORKDIR /opt
6177

6278
EXPOSE 5000
79+

docker/Dockerfile-debian

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
FROM debian:bookworm-slim as builder
1+
FROM debian:bookworm-slim AS builder
22
ARG DOCKER_TAG
33
ARG BUILD_CONCURRENCY
4-
RUN mkdir -p /src && mkdir -p /opt
54

6-
RUN apt-get update && \
7-
apt-get -y --no-install-recommends install ca-certificates cmake make git gcc g++ libbz2-dev libxml2-dev wget \
8-
libzip-dev libboost1.81-all-dev lua5.4 liblua5.4-dev pkg-config -o APT::Install-Suggests=0 -o APT::Install-Recommends=0
9-
10-
RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
11-
ldconfig /usr/local/lib && \
12-
git clone --branch v2021.12.0 --single-branch https://github.com/oneapi-src/oneTBB.git && \
13-
cd oneTBB && \
14-
mkdir build && \
15-
cd build && \
16-
cmake -DTBB_TEST=OFF -DCMAKE_BUILD_TYPE=Release .. && \
17-
cmake --build . && \
18-
cmake --install .
5+
RUN mkdir -p /src /opt && \
6+
apt-get update && \
7+
apt-get -y --no-install-recommends --no-install-suggests install \
8+
ca-certificates \
9+
cmake \
10+
g++ \
11+
gcc \
12+
git \
13+
libboost1.81-all-dev \
14+
libbz2-dev \
15+
liblua5.4-dev \
16+
libtbb-dev \
17+
libxml2-dev \
18+
libzip-dev \
19+
lua5.4 \
20+
make \
21+
pkg-config
1922

2023
COPY . /src
2124
WORKDIR /src
@@ -41,19 +44,24 @@ RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
4144
rm -rf /src
4245

4346

44-
# Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds
47+
# Multistage build to reduce image size - https://docs.docker.com/build/building/multi-stage/#use-multi-stage-builds
4548
# Only the content below ends up in the image, this helps remove /src from the image (which is large)
46-
FROM debian:bookworm-slim as runstage
49+
FROM debian:bookworm-slim AS runstage
4750

4851
COPY --from=builder /usr/local /usr/local
4952
COPY --from=builder /opt /opt
5053

5154
RUN apt-get update && \
52-
apt-get install -y --no-install-recommends \
53-
libboost-program-options1.81.0 libboost-date-time1.81.0 libboost-iostreams1.81.0 libboost-thread1.81.0 \
54-
expat liblua5.4-0 && \
55+
apt-get install -y --no-install-recommends --no-install-suggests \
56+
expat \
57+
libboost-date-time1.81.0 \
58+
libboost-iostreams1.81.0 \
59+
libboost-program-options1.81.0 \
60+
libboost-thread1.81.0 \
61+
liblua5.4-0 \
62+
libtbb12 && \
5563
rm -rf /var/lib/apt/lists/* && \
56-
# add /usr/local/lib to ldconfig to allow loading libraries from there
64+
# Add /usr/local/lib to ldconfig to allow loading libraries from there
5765
ldconfig /usr/local/lib
5866

5967
RUN /usr/local/bin/osrm-extract --help && \
@@ -65,3 +73,4 @@ RUN /usr/local/bin/osrm-extract --help && \
6573
WORKDIR /opt
6674

6775
EXPOSE 5000
76+

third_party/sol2/include/sol/sol.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6752,7 +6752,8 @@ namespace sol {
67526752
static_assert(std::is_constructible<T, Args&&...>::value, "T must be constructible with Args");
67536753

67546754
*this = nullopt;
6755-
this->construct(std::forward<Args>(args)...);
6755+
new (static_cast<void*>(this)) optional(std::in_place, std::forward<Args>(args)...);
6756+
return **this;
67566757
}
67576758

67586759
/// Swaps this optional with the other.

0 commit comments

Comments
 (0)