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(ci): use BuildJet as self-hosted runner #3

Merged
merged 7 commits into from
May 16, 2024
Merged
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
7 changes: 0 additions & 7 deletions .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ runs:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Install jq
run: |
sudo apt-get -y update
sudo apt-get -y install jq
shell: bash

- name: Set Docker tags
id: set-docker-tags
run: |
Expand Down Expand Up @@ -123,7 +117,6 @@ runs:
${{ inputs.build-args }}

- name: Build and Save Artifacts
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
uses: docker/bake-action@v3
with:
push: false
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/docker-build-and-push-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@
name: docker-build-and-push-main

on:
push:
tags:
- adkit-v*.*.*
branches:
- main
schedule:
- cron: 0 0 1,15 * *
pull_request:
workflow_dispatch:
inputs:
artifacts-destination:
Expand All @@ -26,7 +20,7 @@

jobs:
docker-build-and-push-main:
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204

Check warning on line 23 in .github/workflows/docker-build-and-push-main.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (buildjet)

Check warning on line 23 in .github/workflows/docker-build-and-push-main.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (vcpu)
strategy:
fail-fast: false
matrix:
Expand All @@ -44,12 +38,22 @@
lib_dir: x86_64
additional-tag-suffix: -cuda
steps:
- name: Check if PR author is the specific user
id: author-check
run: |
PR_AUTHOR=$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH")
if [[ "$PR_AUTHOR" == "youtalk" ]]; then
echo "$PR_AUTHOR is a target user"
echo "author-found=true" >> $GITHUB_OUTPUT
else
echo "$PR_AUTHOR is not a target user"
echo "author-found=false" >> $GITHUB_OUTPUT
fi
shell: bash

- name: Check out repository
uses: actions/checkout@v4

- name: Free disk space
uses: ./.github/actions/free-disk-space

- name: Load env
run: |
cat amd64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV
Expand All @@ -58,6 +62,7 @@
fi

- name: Build 'autoware-openadk'
if: steps.author-check.outputs.author-found == 'true'
uses: ./.github/actions/docker-build-and-push
with:
bake-target: autoware-openadk
Expand All @@ -70,7 +75,3 @@
tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64
tag-prefix: ${{ env.rosdistro }}
allow-push: true

- name: Show disk space
run: |
df -h
6 changes: 4 additions & 2 deletions docker/autoware-openadk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,17 @@ RUN --mount=type=ssh \
&& apt-get update \
&& rosdep update \
&& DEBIAN_FRONTEND=noninteractive rosdep install -y --ignore-src --from-paths src --rosdistro "$ROS_DISTRO" \
&& source /opt/ros/"$ROS_DISTRO"/setup.bash \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache

# Build Autoware
RUN source /opt/ros/"$ROS_DISTRO"/setup.bash \
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --cmake-args \
" -Wno-dev" \
" --no-warn-unused-cli" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
&& find /autoware/install -type d -exec chmod 777 {} \; \
&& chmod -R 777 /var/tmp/ccache \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \
&& rm -rf /autoware/build /autoware/src

CMD ["/bin/bash"]
Expand Down
Loading