Skip to content

Simplify the docker images and workflows #6852

@xmfcx

Description

@xmfcx

This issue aims to create simpler docker images and simpler docker build and push workflows.

This issue doesn't aim to remove any of the existing images or workflows.

That task is tracked here:

🎯 Goals

🐋 Docker images

💖 Docker Images Graph: https://xmfcx.github.io/autoware-new-docker-graph/

🖱️Click here to expand for ugly mermaid instead 🔛
graph TD
    ROS["ros:${ROS_DISTRO}-ros-base"]

    subgraph Build Chain
        BASE["base<br/><i>sudo, pipx, ansible, rmw, user aw, gosu</i>"]
        CORE_DEPS["core-dependencies<br/><i>ccache, rosdep deps, build src/core/ pkgs</i>"]
        CORE_DEVEL["core-devel<br/><i>rosdep deps for autoware_core, build &amp; install</i>"]
        UNI_DEPS["universe-dependencies<br/><i>ansible roles, rosdep deps for universe</i>"]
        UNI_DEPS_CUDA["universe-dependencies-cuda<br/><i>+ CUDA dev</i>"]
        UNI_DEVEL["universe-devel<br/><i>build autoware.repos → /opt/autoware</i>"]
        UNI_DEVEL_CUDA["universe-devel-cuda<br/><i>build autoware.repos → /opt/autoware</i>"]
    end

    subgraph Runtime Chain
        CORE_RT["core<br/><i>rosdep exec deps for src/core/</i>"]
        UNI_RT_DEPS["universe-runtime-dependencies<br/><i>runtime ansible deps, rosdep exec deps</i>"]
        UNI_RT["universe<br/><i>runtime image</i>"]
        UNI_RT_CUDA["universe-cuda<br/><i>+ CUDA runtime</i>"]
    end

    ROS --> BASE

    BASE --> CORE_DEPS
    CORE_DEPS --> CORE_DEVEL
    CORE_DEVEL --> UNI_DEPS
    UNI_DEPS --> UNI_DEPS_CUDA
    UNI_DEPS --> UNI_DEVEL
    UNI_DEPS_CUDA --> UNI_DEVEL_CUDA

    BASE --> CORE_RT
    CORE_RT --> UNI_RT_DEPS
    UNI_RT_DEPS --> UNI_RT
    UNI_RT_DEPS --> UNI_RT_CUDA

    CORE_DEVEL -.->|"COPY /opt/autoware"| CORE_RT
    UNI_DEVEL -.->|"COPY /opt/autoware"| UNI_RT
    UNI_DEVEL_CUDA -.->|"COPY /opt/autoware"| UNI_RT_CUDA

    classDef external fill:#4a5568,stroke:#718096,color:#fff
    classDef build fill:#2b6cb0,stroke:#3182ce,color:#fff
    classDef runtime fill:#276749,stroke:#38a169,color:#fff
    classDef cuda fill:#9b2c2c,stroke:#e53e3e,color:#fff

    class ROS external
    class BASE,CORE_DEPS,CORE_DEVEL,UNI_DEPS,UNI_DEVEL build
    class CORE_RT,UNI_RT_DEPS,UNI_RT runtime
    class UNI_DEPS_CUDA,UNI_DEVEL_CUDA,UNI_RT_CUDA cuda
Loading

🏗️ Build Chain

base FROM ros:${ROS_DISTRO}-ros-base

  • sudo
  • pipx
  • ansible
  • rmw
  • user creation / gosu

core-dependencies FROM base

This will be used for the CI of autoware_core repository.

  • install ccache
  • install rosdep dependencies of src/core/ folder (except the autoware_rviz_plugins and autoware_core)
  • build the packages of src/core/ (except the autoware_rviz_plugins and autoware_core)
  • install them into /opt/autoware

core-devel FROM core-dependencies

This can be used by the developers to mount and develop autoware_core since all its rosdeps are installed.
They can choose to source pre-built stuff from /opt/autoware as well.

This can also be used by the CI for any package that depends on autoware_core.

  • install rosdep dependencies of autoware_core
  • build autoware_core
  • install into /opt/autoware

universe-dependencies FROM core-devel

This will be used for the CI of autoware_universe repository (and maybe more).

  • install ansible roles for the universe packages
  • install rosdep dependencies of all universe autoware.repos to prioritize speed

universe-dependencies-cuda⚡ FROM universe-dependencies

This will be used for the CI of autoware_universe repository (and maybe more).

  • install cuda

universe-devel FROM universe-dependencies

  • build autoware.repos
  • install into /opt/autoware

universe-devel-cuda⚡ FROM universe-dependencies-cuda

  • build autoware.repos
  • install into /opt/autoware

🚀 Runtime Chain

core FROM base

The runtime image for core.

  • rosdep install exec deps for src/core/
  • copy /opt/autoware from core-devel

universe-runtime-dependencies FROM core

  • install necessary runtime ansible deps (need to be investigated)
  • install rosdep exec deps from autoware.repos

universe FROM universe-runtime-dependencies

Runtime image for universe.

  • copy /opt/autoware from universe-devel

universe-cuda⚡ FROM universe-runtime-dependencies

  • install cuda runtime stuff?
  • copy /opt/autoware from universe-devel-cuda

🖇️ Related PRs

Metadata

Metadata

Assignees

Labels

type:buildTooling and infrastructure around building the Autoware.type:containersDocker containers, containerization of components, or container orchestration.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions