Skip to content

build(docker): skip the packages of the core image in the universe build - #7392

Draft
xmfcx wants to merge 1 commit into
mainfrom
build/skip-core-packages-in-universe
Draft

xmfcx wants to merge 1 commit into
mainfrom
build/skip-core-packages-in-universe

Conversation

@xmfcx

@xmfcx xmfcx commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Description

The universe-devel stage runs colcon on all of src. So it builds every package of its core image again, and installs it over the prebuilt copy in /opt/autoware. This PR makes the stage skip those packages. This is PR 6 of the plan in:

The stage now reads the names of the prebuilt packages from /opt/autoware/*/share/colcon-core/packages/ and passes them to --packages-ignore. The universe packages then find the core packages in the underlay, because the stage sources /opt/autoware/setup.sh before the build.

The list comes from the image, not from a fixed list in the Dockerfile. So it fits both variants:

Target Core image Prebuilt packages that the stage skips
universe-devel core-devel The core packages, without src/core/cuda
universe-devel-cuda core-devel-cuda The core packages and src/core/cuda

The CPU core images do not hold src/core/cuda. So the CPU universe-devel still builds autoware_cuda, cuda_blackboard and negotiated, the same as before.

The # hadolint ignore=SC2086 line allows the unquoted ${core_packages}, so that each name is one argument. core.Dockerfile uses the same pattern for ${cuda_paths}. Package names have no spaces. A bash array fails Hadolint, because Hadolint checks this RUN as POSIX sh.

The universe-dependencies stage and the universe stage do not change. Their rosdep install steps already pass --ignore-src, and the prebuilt packages are in the underlay.

How was this PR tested?

See the verification block below.

AI usage

AI usage: Claude Code made the change from the plan in the issue above, ran the checks below, and wrote this description.

Self-review: Not reviewed yet.

Verification: Hadolint passed, and the shell lines of the change ran under dash in a local core-devel-jazzy image with colcon list. No image build ran yet.

pre-commit

  • pre-commit run --files docker/universe.Dockerfile passed, Hadolint included.
  • My first version used a bash array (mapfile and "${core_packages[@]}"). Hadolint reported SC3054 warning: In POSIX sh, array references are undefined., also with a SHELL ["/bin/bash", ...] line in the stage. The second version uses a plain variable and passed.

Package list in a local core image

A local autoware:core-devel-jazzy image (CPU), with the src of my workspace mounted. This image is older than that src.

  • basename -a /opt/autoware/*/share/colcon-core/packages/* printed 134 names. /bin/sh is /usr/bin/dash.
  • colcon list --base-paths /tmp/autoware/src listed 502 packages. With --packages-ignore ${core_packages}, it listed 368 and exited 0.
  • The 368 packages hold src/core/cuda (autoware_cuda_dependency_meta, autoware_cuda_utils, autoware_tensorrt_common, cuda_blackboard). They also hold 6 core packages that this older image does not have, for example autoware_utils_launch. In CI, the core image and src come from the same commit.
  • An unknown name in --packages-ignore prints WARNING:colcon.colcon_core.package_discovery:ignoring unknown package and does not stop the build.

Not run

  • A build of universe-devel or universe-devel-cuda with this change. The health-check CI of this PR builds the CPU universe-devel for Humble and Jazzy on amd64.
  • The CUDA targets and arm64. A workflow_dispatch run of docker-build-and-push on this branch can build them.
  • The time saved. For comparison, on main run 41462201289 the jazzy-amd64 / build-universe / ci-universe job printed Summary: 496 packages finished [41min 51s].

The universe-devel stage runs colcon on all of src, so it builds every
package of the core image again and installs it over the prebuilt copy
in /opt/autoware.

The stage now reads the package names of the core image from
/opt/autoware/*/share/colcon-core/packages and passes them to
--packages-ignore. The universe packages then use the prebuilt core
packages from the underlay. The CPU core images do not hold
src/core/cuda, so the CPU universe stage still builds it.

Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
@xmfcx xmfcx added type:build Tooling and infrastructure around building the Autoware. type:containers Docker containers, containerization of components, or container orchestration. run:health-check Run health-check labels Nov 4, 2026
@xmfcx xmfcx self-assigned this Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

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

Labels

run:health-check Run health-check type:build Tooling and infrastructure around building the Autoware. type:containers Docker containers, containerization of components, or container orchestration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant