Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): add autoware:core image #165

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@ runs:
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash

- name: Docker meta for autoware:core
id: meta-core
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=core-${{ inputs.platform }}
type=raw,value=core-${{ steps.date.outputs.date }}-${{ inputs.platform }}
type=ref,event=tag,prefix=core-,suffix=-${{ inputs.platform }}
bake-target: docker-metadata-action-core
flavor: |
latest=false

- name: Docker meta for autoware:core-devel
id: meta-core-devel
uses: docker/metadata-action@v5
Expand Down Expand Up @@ -248,6 +261,7 @@ runs:
push: true
files: |
docker/docker-bake.hcl
${{ steps.meta-core.outputs.bake-file }}
${{ steps.meta-core-devel.outputs.bake-file }}
${{ steps.meta-universe-sensing-perception-devel.outputs.bake-file }}
${{ steps.meta-universe-sensing-perception.outputs.bake-file }}
Expand Down
31 changes: 30 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ COPY src/core /autoware/src/core
RUN rosdep update && /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \
> /rosdep-core-depend-packages.txt \
&& cat /rosdep-core-depend-packages.txt
RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} --dependency-types=exec \
> /rosdep-core-exec-depend-packages.txt \
&& cat /rosdep-core-exec-depend-packages.txt

COPY src/universe/external /autoware/src/universe/external
COPY src/universe/autoware.universe/common /autoware/src/universe/autoware.universe/common
Expand All @@ -43,7 +46,7 @@ COPY src/universe/autoware.universe/visualization /autoware/src/universe/autowar
RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \
> /rosdep-universe-visualization-depend-packages.txt \
&& cat /rosdep-universe-visualization-depend-packages.txt
RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \
RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} --dependency-types=exec \
> /rosdep-universe-visualization-exec-depend-packages.txt \
&& cat /rosdep-universe-visualization-exec-depend-packages.txt

Expand Down Expand Up @@ -405,6 +408,32 @@ COPY --from=universe-devel /opt/autoware /opt/autoware
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["/bin/bash"]

# hadolint ignore=DL3006
FROM $AUTOWARE_BASE_IMAGE AS core
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG ROS_DISTRO
ARG LIB_DIR

# Set up runtime environment
COPY --from=rosdep-depend /rosdep-core-exec-depend-packages.txt /tmp/rosdep-core-exec-depend-packages.txt
# hadolint ignore=SC2002
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
./setup-dev-env.sh -y --module all --no-nvidia --no-cuda-drivers --runtime openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get update \
&& cat /tmp/rosdep-core-exec-depend-packages.txt | xargs apt-get install -y --no-install-recommends \
&& /autoware/cleanup_system.sh $LIB_DIR $ROS_DISTRO

COPY --from=core-devel /opt/autoware /opt/autoware

# Copy bash aliases
COPY docker/etc/.bash_aliases /root/.bash_aliases
RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc

ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["/bin/bash"]

# hadolint ignore=DL3006
FROM $AUTOWARE_BASE_IMAGE AS universe-sensing-perception
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
Expand Down
8 changes: 8 additions & 0 deletions docker/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
group "default" {
targets = [
"core",
"core-devel",
"universe-sensing-perception-devel",
"universe-sensing-perception",
Expand All @@ -17,6 +18,7 @@ group "default" {
}

// For docker/metadata-action
target "docker-metadata-action-core" {}
target "docker-metadata-action-core-devel" {}
target "docker-metadata-action-universe-sensing-perception-devel" {}
target "docker-metadata-action-universe-sensing-perception" {}
Expand All @@ -31,6 +33,12 @@ target "docker-metadata-action-universe-visualization" {}
target "docker-metadata-action-universe-devel" {}
target "docker-metadata-action-universe" {}

target "core" {
inherits = ["docker-metadata-action-core"]
dockerfile = "docker/Dockerfile"
target = "core"
}

target "core-devel" {
inherits = ["docker-metadata-action-core-devel"]
dockerfile = "docker/Dockerfile"
Expand Down
Loading