Skip to content

Commit

Permalink
feat(docker): no longer support devel image (#5171)
Browse files Browse the repository at this point in the history
  • Loading branch information
youtalk authored Sep 5, 2024
1 parent ca34d28 commit 7148b77
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 40 deletions.
12 changes: 0 additions & 12 deletions .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,6 @@ runs:
latest=false
suffix=-universe-devel${{ inputs.tag-suffix }}
- name: Docker meta for autoware:devel
id: meta-devel
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: ${{ steps.set-docker-tags.outputs.tags }}
bake-target: docker-metadata-action-devel
flavor: |
latest=false
suffix=-devel${{ inputs.tag-suffix }}
- name: Docker meta for autoware:universe
id: meta-universe
uses: docker/metadata-action@v5
Expand Down Expand Up @@ -160,7 +149,6 @@ runs:
${{ steps.meta-base.outputs.bake-file }}
${{ steps.meta-core-devel.outputs.bake-file }}
${{ steps.meta-universe-devel.outputs.bake-file }}
${{ steps.meta-devel.outputs.bake-file }}
${{ steps.meta-universe.outputs.bake-file }}
provenance: false
set: |
Expand Down
33 changes: 13 additions & 20 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ RUN --mount=type=ssh \
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" > /etc/bash.bashrc

# Create entrypoint
COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh
RUN chmod +x /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["/bin/bash"]

# hadolint ignore=DL3006
Expand Down Expand Up @@ -110,10 +113,11 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG ROS_DISTRO
ENV CCACHE_DIR="/root/.ccache"

# Set up development environment
# Set up development environment and tools
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
./setup-dev-env.sh -y --module all openadkit \
&& ./setup-dev-env.sh -y --module dev-tools openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

Expand All @@ -138,6 +142,9 @@ RUN --mount=type=cache,target=${CCACHE_DIR} \
&& du -sh ${CCACHE_DIR} && ccache -s \
&& rm -rf /autoware/build

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

FROM core-devel AS universe-common-devel
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG ROS_DISTRO
Expand Down Expand Up @@ -170,6 +177,9 @@ RUN --mount=type=cache,target=${CCACHE_DIR} \
&& du -sh ${CCACHE_DIR} && ccache -s \
&& rm -rf /autoware/build

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

FROM universe-common-devel AS universe-sensing-perception-devel
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG ROS_DISTRO
Expand Down Expand Up @@ -199,6 +209,7 @@ RUN --mount=type=cache,target=${CCACHE_DIR} \
&& du -sh ${CCACHE_DIR} && ccache -s \
&& rm -rf /autoware/build

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

FROM universe-common-devel AS universe-devel
Expand Down Expand Up @@ -244,21 +255,6 @@ RUN --mount=type=cache,target=${CCACHE_DIR} \
&& du -sh ${CCACHE_DIR} && ccache -s \
&& rm -rf /autoware/build

CMD ["/bin/bash"]

FROM universe-devel AS devel
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install development tools and artifacts
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
./setup-dev-env.sh -y --module dev-tools openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

# Create entrypoint
COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh
RUN chmod +x /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["/bin/bash"]

Expand Down Expand Up @@ -293,8 +289,5 @@ COPY --from=universe-devel /opt/autoware /opt/autoware
COPY docker/etc/.bash_aliases /root/.bash_aliases
RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc

# Create entrypoint
COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh
RUN chmod +x /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]
CMD ["/bin/bash"]
9 changes: 1 addition & 8 deletions docker/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
group "default" {
targets = ["base", "core-devel", "universe-devel", "devel", "universe"]
targets = ["base", "core-devel", "universe-devel", "universe"]
}

// For docker/metadata-action
target "docker-metadata-action-base" {}
target "docker-metadata-action-core-devel" {}
target "docker-metadata-action-universe-devel" {}
target "docker-metadata-action-devel" {}
target "docker-metadata-action-universe" {}

target "base" {
Expand All @@ -27,12 +26,6 @@ target "universe-devel" {
target = "universe-devel"
}

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

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

0 comments on commit 7148b77

Please sign in to comment.