Skip to content

Commit

Permalink
feat(ci,docker): disable var-lib-apt cache (autowarefoundation#5004)
Browse files Browse the repository at this point in the history
Signed-off-by: Yutaka Kondo <[email protected]>
  • Loading branch information
youtalk authored Jul 18, 2024
1 parent ed46a7a commit 8be95f8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ runs:
with:
path: |
var-cache-apt
var-lib-apt
key: apt-get-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/package.xml') }}
restore-keys: |
apt-get-${{ inputs.platform }}-${{ inputs.name }}-
Expand All @@ -67,8 +66,7 @@ runs:
cache-map: |
{
"root-ccache": "/root/.ccache",
"var-cache-apt": "/var/cache/apt",
"var-lib-apt": "/var/lib/apt"
"var-cache-apt": "/var/cache/apt"
}
skip-extraction: true

Expand Down
5 changes: 1 addition & 4 deletions .github/actions/docker-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ runs:
with:
path: |
var-cache-apt
var-lib-apt
key: apt-get-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/package.xml') }}
restore-keys: |
apt-get-${{ inputs.platform }}-${{ inputs.name }}-
Expand All @@ -76,7 +75,6 @@ runs:
with:
path: |
var-cache-apt
var-lib-apt
key: apt-get-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/package.xml') }}
restore-keys: |
apt-get-${{ inputs.platform }}-${{ inputs.name }}-
Expand All @@ -88,8 +86,7 @@ runs:
cache-map: |
{
"root-ccache": "/root/.ccache",
"var-cache-apt": "/var/cache/apt",
"var-lib-apt": "/var/lib/apt"
"var-cache-apt": "/var/cache/apt"
}
skip-extraction: ${{ steps.cache-ccache.outputs.cache-hit && steps.cache-apt-get.outputs.cache-hit }}

Expand Down
7 changes: 0 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ARG ROS_DISTRO
RUN rm -f /etc/apt/apt.conf.d/docker-clean \
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
gosu \
ssh \
Expand All @@ -25,7 +24,6 @@ WORKDIR /autoware
# Set up base environment
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y --module base --runtime openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache \
Expand All @@ -46,7 +44,6 @@ RUN rm -f /etc/apt/apt.conf.d/docker-clean \
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y rosdep \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache
Expand Down Expand Up @@ -91,7 +88,6 @@ ENV CCACHE_DIR="/root/.ccache"
# Set up development environment
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y --module all ${SETUP_ARGS} --no-cuda-drivers openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache
Expand All @@ -100,7 +96,6 @@ RUN --mount=type=ssh \
COPY --from=rosdep-depend /rosdep-core-depend-packages.txt /tmp/rosdep-core-depend-packages.txt
# hadolint ignore=SC2002
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update \
&& cat /tmp/rosdep-core-depend-packages.txt | xargs apt-get install -y --no-install-recommends \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache
Expand Down Expand Up @@ -153,7 +148,6 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install development tools and artifacts
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y --module dev-tools --download-artifacts openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache
Expand All @@ -175,7 +169,6 @@ COPY --from=rosdep-depend /rosdep-exec-depend-packages.txt /tmp/rosdep-exec-depe
# hadolint ignore=SC2002
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y --module all ${SETUP_ARGS} --download-artifacts --no-cuda-drivers --runtime openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get update \
Expand Down

0 comments on commit 8be95f8

Please sign in to comment.