Skip to content

Commit

Permalink
Reorganize ccache paths (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
doganulus authored Jul 24, 2024
1 parent d67ed9b commit 3fead00
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/buildah-build-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ name: buildah-build-builder
on:
workflow_dispatch:
schedule:
- cron: '30 12 * * 0' # 12:30 UTC every Sunday
- cron: "30 12 * * 0" # 12:30 UTC every Sunday
push:
paths:
- .github/workflows/buildah-build-builder.yml # Self-trigger
- containers/autoware-builder/**
- .github/workflows/buildah-build-builder.yml # Self-trigger

env:
REGISTRY: ghcr.io/bounverif
Expand All @@ -30,11 +31,11 @@ jobs:
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 2048 # Reserve disk space for repository
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
remove-codeql: "true"
remove-docker-images: "true"
build-mount-path: ${{ env.CONTAINERS_ROOT }} # The remaining space only for container build

- run: mkdir -p $TMPDIR
Expand Down Expand Up @@ -63,8 +64,7 @@ jobs:
oci: true
build-args: |
AUTOWARE_VERSION=${{ env.AUTOWARE_VERSION }}
extra-args:
--target autoware-builder
extra-args: --target autoware-builder
--cache-to=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/cache
containerfiles: |
containers/autoware-builder/Dockerfile
Expand All @@ -80,13 +80,13 @@ jobs:
oci: true
build-args: |
AUTOWARE_VERSION=${{ env.AUTOWARE_VERSION }}
extra-args:
--target autoware-builder-with-cache
extra-args: --target autoware-builder-with-cache
--cache-from=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/cache
containerfiles: |
containers/autoware-builder/Dockerfile
- name: Push to GitHub Container Repository
if: github.ref == 'refs/heads/main'
id: push-builder-ghcr
uses: redhat-actions/push-to-registry@v2
with:
Expand All @@ -95,6 +95,7 @@ jobs:
tags: ${{ steps.build-builder.outputs.tags }}

- name: Push to GitHub Container Repository
if: github.ref == 'refs/heads/main'
id: push-builder-with-cache-ghcr
uses: redhat-actions/push-to-registry@v2
with:
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/buildah-build-devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- completed
push:
paths:
- .github/workflows/buildah-build-devel.yml # Self-trigger
- .github/workflows/buildah-build-devel.yml # Self-trigger

env:
REGISTRY: ghcr.io/bounverif
Expand All @@ -29,16 +29,17 @@ permissions:
jobs:
autoware-devel-build:
runs-on: ubuntu-24.04
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 2048 # Reserve disk space for repository
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
remove-codeql: "true"
remove-docker-images: "true"
build-mount-path: ${{ env.CONTAINERS_ROOT }} # The remaining space only for container build

- run: mkdir -p $TMPDIR
Expand All @@ -62,12 +63,12 @@ jobs:
tags: latest-devel
layers: true
oci: true
extra-args:
--target autoware-devel
extra-args: --target autoware-devel
containerfiles: |
containers/autoware-devel/Dockerfile
- name: Push to GitHub Container Repository
if: github.ref == 'refs/heads/main'
id: push-devel-ghcr
uses: redhat-actions/push-to-registry@v2
with:
Expand Down
13 changes: 8 additions & 5 deletions containers/autoware-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ LABEL org.opencontainers.image.title="Autoware"
# Autoware variables
ARG AUTOWARE_VERSION=latest
ENV AUTOWARE_VERSION=${AUTOWARE_VERSION}
ENV AUTOWARE_SOURCE_DIR=/usr/local/src/autoware
ENV AUTOWARE_BUILD_DIR=/tmp/build/autoware
ENV AUTOWARE_ROOT=/root/autoware
ENV AUTOWARE_SOURCE_DIR=${AUTOWARE_ROOT}/src
ENV AUTOWARE_BUILD_DIR=${AUTOWARE_ROOT}/build
ENV AUTOWARE_INSTALL_DIR=/opt/autoware/humble

# Debian containers save no deb archives by default.
Expand Down Expand Up @@ -103,7 +104,7 @@ ENV CMAKE_GENERATOR=Ninja
ENV CMAKE_C_COMPILER_LAUNCHER=ccache
ENV CMAKE_CXX_COMPILER_LAUNCHER=ccache
ENV CMAKE_CUDA_COMPILER_LAUNCHER=ccache
ENV CCACHE_BASEDIR=${AUTOWARE_SOURCE_DIR}
ENV CCACHE_BASEDIR=${AUTOWARE_ROOT}
ENV CCACHE_DIR=/var/cache/ccache

# Set environment variables for all users
Expand Down Expand Up @@ -150,7 +151,7 @@ RUN --mount=type=bind,from=autoware-source,source=${AUTOWARE_SOURCE_DIR},target=
. /opt/ros/humble/setup.sh && \
colcon --log-base /dev/null build \
--base-paths ${AUTOWARE_SOURCE_DIR} \
--build-base /tmp/build \
--build-base ${AUTOWARE_BUILD_DIR} \
--install-base /tmp/install \
--packages-up-to autoware_launch \
--event-handlers \
Expand All @@ -166,6 +167,8 @@ RUN --mount=type=bind,from=autoware-source,source=${AUTOWARE_SOURCE_DIR},target=
-DCMAKE_BUILD_TYPE=Release \
" -Wno-dev" \
" --no-warn-unused-cli" \
&& rm -rf /tmp/build \
&& rm -rf ${AUTOWARE_SOURCE_DIR} \
&& rm -rf ${AUTOWARE_BUILD_DIR} \
&& rm -rf ${AUTOWARE_ROOT} \
&& rm -rf /tmp/install \
&& du -h --max-depth=0 ${CCACHE_DIR}

0 comments on commit 3fead00

Please sign in to comment.