Skip to content

Commit 45ab002

Browse files
committed
Add lyrical devel environment
Signed-off-by: Gerardo Puga <glpuga@gmail.com>
1 parent 84f1c39 commit 45ab002

9 files changed

Lines changed: 189 additions & 1 deletion

File tree

.github/workflows/colcon.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
- humble
3939
- jazzy
4040
- kilted
41+
- lyrical
4142
include:
4243
- ros_distro: humble
4344
upload_artifacts: true

.github/workflows/docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- humble
2626
- jazzy
2727
- kilted
28+
- lyrical
2829
- rolling
2930
steps:
3031
- name: Checkout repository

.github/workflows/weekly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- humble
2626
- jazzy
2727
- kilted
28+
- lyrical
2829
- rolling
2930
include:
3031
- ros_distro: humble

DEVELOPING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ To bring up a development environment:
3838
(cd beluga && ROSDISTRO=humble docker/run.sh)
3939
```
4040

41-
Supported distributions include `humble`, `jazzy`, `kilted`, and `rolling`.
41+
Supported distributions include `humble`, `jazzy`, `kilted`, `lyrical`, and `rolling`.
4242

4343
## Workflow
4444

beluga/test/beluga/algorithm/raycasting/test_bresenham.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020

2121
#include <range/v3/range/conversion.hpp>
2222

23+
#pragma GCC diagnostic push
24+
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
2325
#include "beluga/algorithm/raycasting/bresenham.hpp"
26+
#pragma GCC diagnostic pop
2427

2528
namespace beluga {
2629

beluga/test/beluga/views/test_random_intersperse.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121
#include <range/v3/algorithm/count.hpp>
2222
#include <range/v3/range/access.hpp>
2323
#include <range/v3/range/concepts.hpp>
24+
25+
#pragma GCC diagnostic push
26+
#pragma GCC diagnostic ignored "-Wuninitialized"
2427
#include <range/v3/range/conversion.hpp>
28+
#pragma GCC diagnostic pop
29+
2530
#include <range/v3/range/primitives.hpp>
2631
#include <range/v3/view/generate.hpp>
2732
#include <range/v3/view/iota.hpp>

docker/files/lyrical.repos

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repositories:
2+
navigation2:
3+
type: git
4+
url: https://github.com/ros-navigation/navigation2.git
5+
version: 3ecd10af3f0bf24d7a4d67b14ce263976e5552e9
6+
ompl:
7+
type: git
8+
url: https://github.com/ompl/ompl.git
9+
version: 92db5a31e0233e781602022c287be5ff60bb5bd0
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# Keep only the required nav2 packages and remove all others to avoid bringing packages
4+
# that are not yet ready for lyrical
5+
KEEP_DIRS=("nav2_amcl" "nav2_map_server" "nav2_lifecycle_manager" "nav2_ros_common" "nav2_common" "nav2_msgs" "nav2_util")
6+
7+
for dir in */; do
8+
dir="${dir%/}" # Remove trailing slash
9+
keep=false
10+
for keep_dir in "${KEEP_DIRS[@]}"; do
11+
if [[ "$dir" == "$keep_dir" ]]; then
12+
keep=true
13+
break
14+
fi
15+
done
16+
17+
if [[ "$keep" == false ]]; then
18+
echo "Removing $dir"
19+
rm -rf "$dir"
20+
else
21+
echo "Keeping $dir"
22+
fi
23+
done

docker/images/lyrical/Dockerfile

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Stage 1: Cache source dependencies
2+
FROM ros:lyrical-ros-base AS cacher
3+
4+
WORKDIR /ws/src
5+
6+
COPY docker/files/lyrical.repos .
7+
RUN vcs import < lyrical.repos
8+
9+
COPY docker/files/patches/lyrical /tmp/patches
10+
RUN bash -c '\
11+
for subdep in `ls`; do \
12+
pushd $subdep && \
13+
if [ -f /tmp/patches/$subdep.sh ]; then \
14+
echo "Post-processing $subdep source dependency" && /bin/bash /tmp/patches/$subdep.sh; \
15+
fi && \
16+
popd; \
17+
done'
18+
19+
COPY . beluga/
20+
21+
# Copy minimal workspace contents for dependency resolution
22+
RUN mkdir -p /tmp/ws/src \
23+
&& find ./ -name "package.xml" | xargs cp --parents -t /tmp/ws/src \
24+
&& find ./ -name "COLCON_IGNORE" | xargs cp --parents -t /tmp/ws/src \
25+
|| true
26+
27+
# Stage 2: Build timem from timemory
28+
FROM ros:lyrical-ros-base AS timem-builder
29+
30+
RUN apt-get update \
31+
&& apt-get install --no-install-recommends -y \
32+
git \
33+
&& rm -rf /var/lib/apt/lists/*
34+
35+
WORKDIR /opt
36+
37+
RUN git clone -b develop https://github.com/NERSC/timemory.git \
38+
&& cd timemory \
39+
&& git checkout 415650ee26f358218908983c87212b620c3a0328 \
40+
&& cmake -B ./build \
41+
-DTIMEMORY_INSTALL_HEADERS=OFF \
42+
-DTIMEMORY_INSTALL_CONFIG=OFF \
43+
-DTIMEMORY_INSTALL_ALL=OFF \
44+
-DTIMEMORY_BUILD_TIMEM=ON \
45+
. \
46+
&& cmake --build ./build --target timem
47+
48+
# Stage 3: Main builder image
49+
FROM ros:lyrical-ros-base AS builder
50+
51+
ENV DEBIAN_FRONTEND=noninteractive
52+
53+
# Install build/debug/dev tools
54+
RUN apt-get update \
55+
&& apt-get install --no-install-recommends -y \
56+
ccache \
57+
curl \
58+
gcovr \
59+
gdb \
60+
git \
61+
lcov \
62+
linux-perf \
63+
linux-tools-common \
64+
linux-tools-generic \
65+
python3-colcon-coveragepy-result \
66+
python3-colcon-lcov-result \
67+
python3-pip \
68+
tmux \
69+
&& rm -rf /var/lib/apt/lists/*
70+
71+
ENV PIP_BREAK_SYSTEM_PACKAGES=1
72+
RUN pip install \
73+
evo==1.21.0 \
74+
pre-commit==2.20.0
75+
76+
# Install timem from previous stage
77+
COPY --from=timem-builder --chown=developer:ekumen /opt/timemory/ /opt/timemory
78+
RUN cmake --build /opt/timemory/build --target install
79+
80+
# Check if perf is working, if not replace it with the perf version available
81+
RUN perf help || ( \
82+
mv /usr/bin/perf /usr/bin/perf.bkp && \
83+
ln -s $(ls -d /usr/lib/linux-tools/* | tail -n1)/perf /usr/bin/perf)
84+
85+
# Create developer user
86+
ARG USER=developer
87+
ARG GROUP=ekumen
88+
89+
RUN deluser ubuntu
90+
91+
RUN addgroup --gid 1001 $GROUP \
92+
&& adduser --uid 1001 --ingroup $GROUP --home /home/$USER --shell /bin/sh --disabled-password --gecos "" $USER \
93+
&& adduser $USER sudo \
94+
&& echo "$USER ALL=NOPASSWD: ALL" >> /etc/sudoers.d/$USER
95+
96+
# Install fixuid
97+
COPY docker/files/fixuid_config.yml /etc/fixuid/config.yml
98+
RUN /bin/bash -c '\
99+
ARCH=`uname -m` && if [ "$ARCH" == "aarch64" ]; then FIXUID_ARCH="arm64"; else FIXUID_ARCH="amd64"; fi \
100+
&& curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-$FIXUID_ARCH.tar.gz | tar -C /usr/local/bin -xzf - \
101+
&& chmod 4755 /usr/local/bin/fixuid \
102+
&& cd /etc/fixuid \
103+
&& sed -i "s/_USER_/$USER/" config.yml \
104+
&& sed -i "s/_GROUP_/$GROUP/" config.yml'
105+
106+
# Clone FlameGraph
107+
RUN cd /opt && git clone https://github.com/brendangregg/FlameGraph
108+
109+
# Switch to developer user
110+
USER $USER:$GROUP
111+
112+
ENV USER_WS=/ws
113+
WORKDIR $USER_WS
114+
115+
# Colcon mixins and workspace setup
116+
RUN colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml \
117+
&& colcon mixin update default
118+
COPY --chown=$USER:$GROUP docker/files/colcon_defaults.yaml /home/$USER/.colcon/defaults.yaml
119+
120+
RUN mkdir -p /home/$USER/.ccache $USER_WS/src
121+
122+
# Copy only minimal files from the cache stage for rosdep install
123+
COPY --from=cacher --chown=$USER:$GROUP /tmp/ws/ $USER_WS/
124+
125+
# Back to root to install dependencies
126+
USER root
127+
128+
ENV PIP_BREAK_SYSTEM_PACKAGES=1
129+
130+
RUN apt-get update \
131+
&& apt-get -y dist-upgrade \
132+
&& . /opt/ros/lyrical/setup.sh \
133+
&& rosdep update \
134+
&& rosdep install -i -y --from-path src --skip-keys 'slam_toolbox' \
135+
&& rosdep install -i -y --from-path src -t doc \
136+
&& rm -rf /var/lib/apt/lists/*
137+
138+
# Final source copy
139+
USER $USER:$GROUP
140+
COPY --from=cacher --chown=$USER:$GROUP /ws/ $USER_WS/
141+
142+
ENV WITHIN_DEV=1
143+
ENV SHELL=/bin/bash
144+
145+
ENTRYPOINT ["fixuid", "-q", "/ros_entrypoint.sh", "/bin/bash"]

0 commit comments

Comments
 (0)