Skip to content

feat: include micro-xrce-dds in runtime container#58

Closed
Embers-of-the-Fire wants to merge 1 commit intoAlliance-Algorithm:mainfrom
Embers-of-the-Fire:feat/micro-xrce-dds
Closed

feat: include micro-xrce-dds in runtime container#58
Embers-of-the-Fire wants to merge 1 commit intoAlliance-Algorithm:mainfrom
Embers-of-the-Fire:feat/micro-xrce-dds

Conversation

@Embers-of-the-Fire
Copy link
Copy Markdown
Member

@Embers-of-the-Fire Embers-of-the-Fire commented Mar 21, 2026

功能特性

在运行时容器的 rmcs-base 阶段中直接从源码构建并包含 Micro XRCE-DDS Agent,可在容器内以可执行文件形式提供 MicroXRCEAgent。

变更详情

Dockerfile

  • 新增构建参数:

    • ARG FASTDDS_TAG=v2.12.2
    • ARG MICROXRCE_AGENT_TAG=v2.4.2
  • 在 rmcs-base 阶段新增一个 RUN 块以作为独立依赖构建步骤,主要操作:

    • 安装构建依赖 libasio-dev。
    • 克隆指定分支/标签的 Micro-XRCE-DDS-Agent(使用 MICROXRCE_AGENT_TAG)。
    • 修改其 CMakeLists.txt,将内部设置的 Fast-DDS 版本替换为 FASTDDS_TAG。
    • 使用 CMake(启用 UAGENT_SUPERBUILD 并关闭使用系统 Fast-CDR/Fast-DDS)配置并构建 uagent 可执行目标。
    • 将构建产物中的 MicroXRCEAgent 可执行文件安装到 /usr/local/bin/MicroXRCEAgent。
    • 卸载 libasio-dev,清理 apt 缓存与临时文件。
  • 在 rmcs-base 中,在挂载并安装 rmcs_ws 依赖(rosdep)之前完成上述 Micro XRCE-DDS Agent 的源码构建,使运行时镜像包含已编译的 agent 可执行文件。

导出/公共声明变更

  • Dockerfile 增加了两个构建参数(FASTDDS_TAG、MICROXRCE_AGENT_TAG)。

其他说明

  • 构建步骤采用 superbuild 方式构建 agent,可通过 FASTDDS_TAG 控制所用 Fast-DDS 版本;但 Dockerfile 中通过 CMake 配置关闭了使用系统 Fast-CDR/Fast-DDS(DUAGENT_USE_SYSTEM_FASTCDR=OFF、DUAGENT_USE_SYSTEM_FASTDDS=OFF),由 superbuild 处理依赖构建与链接。

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 21, 2026

Walkthrough

Dockerfile 中新增构建参数 FASTDDS_TAGMICROXRCE_AGENT_TAG,并在 rmcs-base 阶段添加一个 RUN 步骤:安装 libasio-dev、克隆并按指定 tag 构建 Micro‑XRCE‑DDS‑Agent(覆盖其内嵌 Fast‑DDS tag)、将生成的 MicroXRCEAgent 安装到 /usr/local/bin,随后清理依赖与缓存。

Changes

Cohort / File(s) Summary
Dockerfile: 构建参数与 Micro‑XRCE‑DDS‑Agent 源构建
Dockerfile
新增构建参数 ARG FASTDDS_TAG=v2.12.2ARG MICROXRCE_AGENT_TAG=v2.4.2;在 rmcs-base 阶段加入 RUN 块:安装 libasio-dev、克隆 Micro-XRCE-DDS-Agent(使用 MICROXRCE_AGENT_TAG)、修改 CMakeLists 以覆盖内嵌 FastDDS tag(为 FASTDDS_TAG),配置并构建 uagent 目标,定位并安装 MicroXRCEAgent/usr/local/bin,然后移除构建依赖并清理 apt 缓存与临时文件。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 我在容器里轻轻跳,
源码与 tag 在月光照,
编译出代理小而妙,
装进 /usr/local 去安好,
清理尘埃,镜面照。 ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding Micro XRCE-DDS Agent to the runtime container via Dockerfile modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
Dockerfile (1)

63-104: 构建流程实现合理。

整体实现正确:

  • 使用静态链接(BUILD_SHARED_LIBS=OFF)确保生成独立可执行文件
  • 构建顺序正确:Fast-CDR → Fast-DDS → Micro-XRCE-DDS-Agent
  • 清理逻辑完整,移除了构建依赖和临时文件

几点建议:

  1. 日志功能被禁用(Line 94):UAGENT_LOGGER_PROFILE=OFF 会使运行时调试变得困难。如果是有意为之请忽略,否则建议保留日志功能。

  2. 清理命令轻微冗余(Lines 101-102):apt-get purge -y --auto-remove 已经包含了 autoremove 功能。

♻️ 可选:简化清理命令
-    apt-get purge -y --auto-remove libasio-dev && \
-    apt-get autoremove -y && apt-get clean && \
+    apt-get purge -y --auto-remove libasio-dev && \
+    apt-get clean && \
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile` around lines 63 - 104, The build disables agent logging by
setting CMake flag UAGENT_LOGGER_PROFILE=OFF; change it to ON (or make it
configurable via a build ARG like MICROXRCE_LOGGER_PROFILE and pass
-DUAGENT_LOGGER_PROFILE=${MICROXRCE_LOGGER_PROFILE}) so runtime logs are
available, and simplify cleanup by removing the redundant apt-get autoremove
call after apt-get purge (keep either purge --auto-remove or a single
autoremove), updating the Dockerfile lines that set UAGENT_LOGGER_PROFILE and
the apt cleanup commands accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Dockerfile`:
- Around line 16-18: The Dockerfile currently pins FASTCDR_TAG to v1.1.1 which
is incompatible with FASTDDS_TAG v2.12.2; update the FASTCDR_TAG argument to a
2.x release (for example change FASTCDR_TAG to v2.3.0 or a newer v2.y.z) so
Fast-DDS requirements are met, then rebuild to verify the image; locate the ARG
FASTCDR_TAG declaration near ARG FASTDDS_TAG and ARG MICROXRCE_AGENT_TAG and
replace the tag string accordingly.

---

Nitpick comments:
In `@Dockerfile`:
- Around line 63-104: The build disables agent logging by setting CMake flag
UAGENT_LOGGER_PROFILE=OFF; change it to ON (or make it configurable via a build
ARG like MICROXRCE_LOGGER_PROFILE and pass
-DUAGENT_LOGGER_PROFILE=${MICROXRCE_LOGGER_PROFILE}) so runtime logs are
available, and simplify cleanup by removing the redundant apt-get autoremove
call after apt-get purge (keep either purge --auto-remove or a single
autoremove), updating the Dockerfile lines that set UAGENT_LOGGER_PROFILE and
the apt cleanup commands accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 82af3c05-5375-4375-bba0-d5fb31fcbec7

📥 Commits

Reviewing files that changed from the base of the PR and between a5f2820 and ffb6d12.

📒 Files selected for processing (1)
  • Dockerfile

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Dockerfile`:
- Around line 16-17: The Dockerfile currently only patches _fastdds_tag but not
the upstream hardcoded _fastdds_version, which can lead to version mismatches
and silent failures because sed can succeed without changing anything; update
the patch step (the lines that reference FASTDDS_TAG, _fastdds_tag and
UAGENT_SUPERBUILD) to replace both _fastdds_tag and _fastdds_version to match
ARG FASTDDS_TAG and derive the version portion (e.g., strip the leading "v" and
minor patch) and then immediately verify both substitutions succeeded (check
that both expected strings are present) and exit non‑zero if either verification
fails so the build stops on a failed patch.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d256d348-5e21-4d67-9637-b2170d31aba0

📥 Commits

Reviewing files that changed from the base of the PR and between ffb6d12 and c45238a.

📒 Files selected for processing (1)
  • Dockerfile

@github-project-automation github-project-automation bot moved this from Todo to Done in RMCS Apr 7, 2026
@Embers-of-the-Fire
Copy link
Copy Markdown
Member Author

Closed because of solution changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant