Skip to content

Commit 4aa50a7

Browse files
committed
re-write the dependency installations and rely on vcpkg on GHA
1 parent 3eeb5ae commit 4aa50a7

File tree

7 files changed

+91
-68
lines changed

7 files changed

+91
-68
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ Adaptations:
66

77
- keep python static libraries so we can use them during the build
88
- install all dependencies to the image for Valhalla (`valhalla_python` branch) and OSRM (`osrm-python` branch)
9+
- install `protobuf == 21.1` (last before the `abseil` debacle), but not sure anymore why.. might be a relic from early days..
910

1011
Don't try to build locally, it's very painful and CI caches properly, so it shouldn't take forever.

docker/Dockerfile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,25 @@ ENTRYPOINT ["manylinux-entrypoint"]
3737
COPY build_scripts/install-runtime-packages.sh \
3838
build_scripts/update-system-packages.sh \
3939
build_scripts/build_utils.sh \
40+
build_scripts/install-runtime-packages-valhalla.sh \
4041
/build_scripts/
41-
RUN manylinux-entrypoint /build_scripts/install-runtime-packages.sh && rm -rf /build_scripts/
42+
RUN manylinux-entrypoint build_scripts/install-runtime-packages-valhalla.sh \
43+
&& manylinux-entrypoint /build_scripts/install-runtime-packages.sh \
44+
&& rm -rf /build_scripts/
4245

4346
COPY build_scripts/build_utils.sh /build_scripts/
4447

48+
COPY build_scripts/install-cmake.sh /build_scripts/
49+
RUN export CMAKE_ROOT=cmake-3.31.7 && \
50+
export CMAKE_HASH=a6d2eb1ebeb99130dfe63ef5a340c3fdb11431cce3d7ca148524c125924cea68 && \
51+
export CMAKE_DOWNLOAD_URL=https://github.com/Kitware/CMake/releases/download/v3.31.7 && \
52+
manylinux-entrypoint /build_scripts/install-cmake.sh
53+
54+
COPY build_scripts/install-prime_server.sh /build_scripts/
55+
RUN export PRIME_ROOT=0.7.0 && \
56+
export PRIME_DOWNLOAD_URL=https://github.com/kevinkreiser/prime_server/archive/refs/tags && \
57+
manylinux-entrypoint /build_scripts/install-prime_server.sh
58+
4559
COPY build_scripts/install-autoconf.sh /build_scripts/
4660
RUN export AUTOCONF_ROOT=autoconf-2.72 && \
4761
export AUTOCONF_HASH=afb181a76e1ee72832f6581c0eddf8df032b83e2e0239ef79ebedc4467d92d6e && \

docker/build_scripts/finalize.sh

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -97,65 +97,7 @@ clean_pyc /opt/_internal
9797
# remove cache
9898
rm -rf /tmp/* || true
9999

100-
<<<<<<< HEAD
101-
# /MOD START: install valhalla and osrm dependencies
102-
if [ "${AUDITWHEEL_POLICY}" == "manylinux2010" ] || [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ]; then
103-
PACKAGE_MANAGER=yum
104-
COMPILE_DEPS="boost-devel sqlite-devel libspatialite-devel protobuf-devel libcurl-devel luajit-devel geos-devel boost-devel"
105-
elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_24" ]; then
106-
PACKAGE_MANAGER=apt
107-
# valhalla
108-
COMPILE_DEPS="libspatialite-dev libgeos-dev libluajit-5.1-dev libcurl4-openssl-dev libgeos++-dev libboost-all-dev"
109-
# install protobuf v3.21.1
110-
git clone https://github.com/protocolbuffers/protobuf.git && cd protobuf
111-
git checkout v21.1 # aka 3.21.1
112-
git submodule update --init --recursive
113-
cmake -B build "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true"
114-
make -C build -j$(nproc)
115-
make -C build install
116-
elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then
117-
PACKAGE_MANAGER=dnf
118-
# valhalla
119-
COMPILE_DEPS="libcurl-devel luajit-devel geos-devel libspatialite-devel boost-devel"
120-
# install protobuf v3.21.1, not sure anymore why we're doing this?!
121-
git clone --recurse-submodules https://github.com/protocolbuffers/protobuf.git && cd protobuf
122-
git checkout v21.1 # aka 3.21.1
123-
git submodule update --init --recursive
124-
cmake -B build "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
125-
make -C build -j$(nproc)
126-
make -C build install
127-
else
128-
echo "Unsupported policy: '${AUDITWHEEL_POLICY}'"
129-
exit 1
130-
fi
131-
132-
if [ "${PACKAGE_MANAGER}" == "yum" ]; then
133-
yum -y install ${COMPILE_DEPS}
134-
yum clean all
135-
rm -rf /var/cache/yum
136-
elif [ "${PACKAGE_MANAGER}" == "apt" ]; then
137-
export DEBIAN_FRONTEND=noninteractive
138-
apt-get update -qq
139-
apt-get install -qq -y --no-install-recommends ${COMPILE_DEPS}
140-
apt-get clean -qq
141-
rm -rf /var/lib/apt/lists/*
142-
elif [ "${PACKAGE_MANAGER}" == "dnf" ]; then
143-
dnf -y update
144-
dnf -y install epel-release
145-
dnf -y update
146-
dnf -y install --allowerasing ${COMPILE_DEPS}
147-
dnf clean all
148-
rm -rf /var/cache/dnf
149-
else
150-
echo "${PACKAGE_MANAGER} is not implemented"
151-
exit 1
152-
fi
153-
154-
155-
hardlink -cv /opt/_internal
156-
=======
157100
hardlink -c /opt/_internal
158-
>>>>>>> upstream/main
159101

160102
# update system packages
161103
LC_ALL=C "${MY_DIR}/update-system-packages.sh"

docker/build_scripts/install-build-packages.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ if [ "${OS_ID_LIKE}" = "rhel" ]; then
2424
else
2525
COMPILE_DEPS+=(libidn2-devel tk-devel)
2626
fi
27-
COMPILE_DEPS+=(boost-devel sqlite-devel libspatialite-devel libcurl-devel luajit-devel geos-devel boost-devel gdal-devel)
28-
# install protobuf v3.21.1, not sure anymore why we're upgrading this?!
29-
git clone --recurse-submodules https://github.com/protocolbuffers/protobuf.git && cd protobuf
30-
git checkout v21.1 # aka 3.21.1
31-
git submodule update --init --recursive
32-
cmake -B build "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
33-
make -C build -j$(nproc)
34-
make -C build install
3527
elif [ "${OS_ID_LIKE}" == "debian" ]; then
3628
COMPILE_DEPS=(libbz2-dev libncurses-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libpcap-dev liblzma-dev openssl libssl-dev libkeyutils-dev libkrb5-dev comerr-dev libidn2-0-dev libcurl4-openssl-dev uuid-dev libffi-dev linux-headers-generic)
3729
elif [ "${OS_ID_LIKE}" == "alpine" ]; then

docker/build_scripts/install-cmake.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
# Top-level build script called from Dockerfile
3+
4+
# Stop at any error, show all commands
5+
set -exuo pipefail
6+
7+
# Get script directory
8+
MY_DIR=$(dirname "${BASH_SOURCE[0]}")
9+
10+
# Get build utilities
11+
# shellcheck source-path=SCRIPTDIR
12+
source "${MY_DIR}/build_utils.sh"
13+
14+
# Install cmake
15+
check_var "${CMAKE_ROOT}"
16+
check_var "${CMAKE_HASH}"
17+
check_var "${CMAKE_DOWNLOAD_URL}"
18+
19+
fetch_source "${CMAKE_ROOT}.tar.gz" "${CMAKE_DOWNLOAD_URL}"
20+
check_sha256sum "${CMAKE_ROOT}.tar.gz" "${CMAKE_HASH}"
21+
tar -zxf "${CMAKE_ROOT}.tar.gz"
22+
pushd "${CMAKE_ROOT}"
23+
./bootstrap
24+
DESTDIR=/manylinux-rootfs make install
25+
popd
26+
rm -rf "${CMAKE_ROOT}" "${CMAKE_ROOT}.tar.gz"
27+
28+
# Strip what we can
29+
strip_ /manylinux-rootfs
30+
31+
# Install
32+
cp -rlf /manylinux-rootfs/* /
33+
34+
# Remove temporary rootfs
35+
rm -rf /manylinux-rootfs
36+
37+
hash -r
38+
cmake --version
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
# Top-level build script called from Dockerfile
3+
4+
# Stop at any error, show all commands
5+
set -exuo pipefail
6+
7+
# Get script directory
8+
MY_DIR=$(dirname "${BASH_SOURCE[0]}")
9+
10+
# Get build utilities
11+
# shellcheck source-path=SCRIPTDIR
12+
source "${MY_DIR}/build_utils.sh"
13+
14+
# Install cmake
15+
check_var "${PRIME_ROOT}"
16+
check_var "${PRIME_DOWNLOAD_URL}"
17+
18+
fetch_source "${PRIME_ROOT}.tar.gz" "${PRIME_DOWNLOAD_URL}"
19+
tar -zxf "${PRIME_ROOT}.tar.gz"
20+
pushd "${PRIME_ROOT}"
21+
./autogen.sh
22+
DESTDIR=/manylinux-rootfs do_standard_install
23+
popd
24+
rm -rf "${PRIME_ROOT}" "${PRIME_ROOT}.tar.gz"
25+
26+
# Strip what we can
27+
strip_ /manylinux-rootfs
28+
29+
# Install
30+
cp -rlf /manylinux-rootfs/* /
31+
32+
# Remove temporary rootfs
33+
rm -rf /manylinux-rootfs
34+
35+
hash -r

docker/build_scripts/install-runtime-packages.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ else
4545
fi
4646

4747
# RUNTIME_DEPS: Runtime dependencies. c.f. install-build-packages.sh
48+
# MOD: install a few more RUNTIME_DEPS for rhel to build Valhalla
4849
if [ "${OS_ID_LIKE}" == "rhel" ]; then
49-
RUNTIME_DEPS=(zlib bzip2 expat ncurses readline gdbm libpcap xz openssl keyutils-libs libkadm5 libcom_err libcurl uuid libffi libdb)
50+
RUNTIME_DEPS=(czmq-devel ccache wget git zlib bzip2 expat ncurses readline gdbm libpcap xz openssl keyutils-libs libkadm5 libcom_err libcurl uuid libffi libdb)
5051
if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ]; then
5152
RUNTIME_DEPS+=(libidn libXft)
5253
elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then

0 commit comments

Comments
 (0)