Skip to content

Commit 19afc3f

Browse files
authored
Improve build in Docker (#2432)
* Test * Fixes * Updating docs
1 parent c70af9e commit 19afc3f

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

Dockerfile.dev

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ RUN apt-get update && \
2727
wget \
2828
cmake \
2929
build-essential \
30+
ccache \
3031
lsb-release \
3132
software-properties-common \
3233
gnupg \
@@ -51,6 +52,14 @@ RUN mkdir -p /root/.vnc && \
5152
ENV TZ=America/New_York
5253
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
5354

55+
# Configure ccache for faster rebuilds
56+
ENV CCACHE_DIR=/root/.ccache
57+
ENV CCACHE_COMPRESS=1
58+
ENV CCACHE_COMPRESSLEVEL=1
59+
ENV CCACHE_MAXSIZE=5G
60+
ENV CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime,include_file_ctime
61+
RUN ccache -M 5G || true
62+
5463
# Clone RoboJackets RoboCup software
5564
RUN git clone https://github.com/RoboJackets/robocup-software.git /root/robocup-software
5665

@@ -68,7 +77,7 @@ RUN git clone https://github.com/robotics-erlangen/framework.git /root/framework
6877
# Build our stack
6978
RUN bash -c "source /opt/ros/humble/setup.bash && \
7079
cd /root/robocup-software && \
71-
colcon build --parallel-workers 1 --executor sequential && \
80+
make perf_docker && \
7281
source install/setup.bash"
7382

7483
# Clone, build ER-Force's autoref

docs/source/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ that ``colcon`` takes up, by running:
114114

115115
.. code-block:: bash
116116
117-
colcon build --parallel-workers 1 --executor sequential
117+
make perf_docker
118118
119119
After building, we need to source our custom ROS setup. Run the following in
120120
the ``robocup-software`` directory:
121121

122122
.. code-block:: bash
123123
124-
source install/setup.bash
124+
source install/setup.bash
125125
126126
(Again, if you're on zsh, source the ``.zsh`` version instead.)
127127

makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ release: all-release
5858
again:
5959
colcon build --parallel-workers 4
6060

61+
perf_docker:
62+
MAKEFLAGS='-j5' colcon build --parallel-workers 1 --executor sequential --cmake-args \
63+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
64+
-DCMAKE_BUILD_TYPE=Debug \
65+
-DCMAKE_CXX_FLAGS_DEBUG="-g1"
66+
6167
# run soccer with default flags
6268
# TODO: lots of the default flags are for sim, except run_sim
6369
# fix this so defaults launch sim, with special cases for real

0 commit comments

Comments
 (0)