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(.github): split docker-build-and-push job to no-cuda and cuda steps #125

Closed
wants to merge 1 commit 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
13 changes: 13 additions & 0 deletions .github/actions/docker-build-and-push-cuda/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ inputs:
runs:
using: composite
steps:
- name: Install jq and vcstool
run: |
sudo apt-get -y update
sudo apt-get -y install jq python3-pip
pip install --no-cache-dir vcstool
shell: bash

- name: Run vcs import
run: |
mkdir src
vcs import src < autoware.repos
shell: bash

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/docker-build-and-push-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

docker-build-and-push:
needs: load-env
runs-on: buildjet-16vcpu-ubuntu-2204-arm

Check warning on line 16 in .github/workflows/docker-build-and-push-arm64.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (buildjet)

Check warning on line 16 in .github/workflows/docker-build-and-push-arm64.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (vcpu)
steps:
- name: Check if PR author is the specific user
id: author-check
Expand Down Expand Up @@ -68,6 +68,49 @@
*.cache-to=type=registry,ref=${{ github.repository }}-buildcache:arm64-${{ github.head_ref }},mode=max
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Show disk space
if: always()
run: |
df -h

docker-build-and-push-cuda:
needs: [load-env, docker-build-and-push]
runs-on: buildjet-16vcpu-ubuntu-2204-arm

Check warning on line 78 in .github/workflows/docker-build-and-push-arm64.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (buildjet)

Check warning on line 78 in .github/workflows/docker-build-and-push-arm64.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (vcpu)
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: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
*.env
*.repos
.github/actions/docker-build-and-push/action.yaml
.github/workflows/docker-build-and-push*.yaml
ansible-galaxy-requirements.yaml
ansible/**
docker/**

- name: Build 'Autoware' with CUDA
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch' ||
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

docker-build-and-push:
needs: load-env
runs-on: buildjet-16vcpu-ubuntu-2204

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

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (buildjet)

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

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (vcpu)
steps:
- name: Check if PR author is the specific user
id: author-check
Expand Down Expand Up @@ -68,6 +68,36 @@
*.cache-to=type=registry,ref=${{ github.repository }}-buildcache:amd64-${{ github.head_ref }},mode=max
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Show disk space
if: always()
run: |
df -h

docker-build-and-push-cuda:
needs: [load-env, docker-build-and-push]
runs-on: buildjet-16vcpu-ubuntu-2204

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

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (buildjet)

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

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (vcpu)
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
*.env
*.repos
.github/actions/docker-build-and-push/action.yaml
.github/workflows/docker-build-and-push*.yaml
ansible-galaxy-requirements.yaml
ansible/**
docker/**

- name: Build 'Autoware' with CUDA
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch' ||
Expand Down
Loading