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(docker): support remote multi-platform compilation on ci #5204

Closed
wants to merge 12 commits 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
108 changes: 0 additions & 108 deletions .github/actions/combine-multi-arch-images/action.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ inputs:
name:
description: ""
required: true
platform:
description: ""
required: true
bake-target:
description: ""
required: true
Expand All @@ -20,6 +17,9 @@ inputs:
tag-suffix:
description: ""
required: false
common-runner-arm64-01-ip:
description: ""
required: true

runs:
using: composite
Expand All @@ -39,34 +39,45 @@ runs:

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64
driver: docker-container
append: |
- endpoint: ssh://ubuntu@${{ inputs.common-runner-arm64-01-ip }}
platforms: linux/arm64
driver: docker-container

- name: Restore ccache
uses: actions/cache/restore@v4
with:
path: |
root-ccache
key: ccache-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/*.cpp') }}
root-ccache-amd64
root-ccache-arm64
key: ccache-${{ inputs.name }}-${{ hashFiles('src/**/*.cpp') }}
restore-keys: |
ccache-${{ inputs.platform }}-${{ inputs.name }}-
ccache-${{ inputs.platform }}-
ccache-${{ inputs.name }}-
ccache-

- name: Restore apt-get
uses: actions/cache/restore@v4
with:
path: |
var-cache-apt
key: apt-get-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/package.xml') }}
var-cache-apt-amd64
var-cache-apt-arm64
key: apt-get-${{ inputs.name }}-${{ hashFiles('src/**/package.xml') }}
restore-keys: |
apt-get-${{ inputs.platform }}-${{ inputs.name }}-
apt-get-${{ inputs.platform }}-
apt-get-${{ inputs.name }}-
apt-get-

- name: Inject cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"root-ccache": "/root/.ccache",
"var-cache-apt": "/var/cache/apt"
"root-ccache-amd64": "/root/.ccache",
"root-ccache-arm64": "/root/.ccache",
"var-cache-apt-amd64": "/var/cache/apt",
"var-cache-apt-arm64": "/var/cache/apt"
}
skip-extraction: true

Expand Down
88 changes: 0 additions & 88 deletions .github/workflows/docker-build-and-push-arm64.yaml

This file was deleted.

26 changes: 14 additions & 12 deletions .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@ jobs:
- cuda
include:
- name: no-cuda
platform: amd64
base_image_env: base_image
lib_dir: x86_64
setup-args: --no-nvidia
additional-tag-suffix: ""
- name: cuda
platform: amd64
base_image_env: base_image
lib_dir: x86_64
additional-tag-suffix: -cuda
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up remote runner SSH
uses: MrSquaare/[email protected]
with:
host: ${{ secrets.COMMON_RUNNER_ARM64_01_IP }}
private-key: ${{ secrets.COMMON_RUNNER_ARM64_01_PRIVATE_KEY }}
private-key-name: common-runner-ssh-key

- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
Expand All @@ -61,21 +64,20 @@ jobs:
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.ref_type == 'tag') }}
uses: ./.github/actions/docker-build-and-push
uses: ./.github/actions/docker-build-multi-platform
with:
common-runner-arm64-01-ip: ${{ secrets.COMMON_RUNNER_ARM64_01_IP }}
name: ${{ matrix.name }}
platform: ${{ matrix.platform }}
bake-target: autoware
build-args: |
*.platform=linux/${{ matrix.platform }}
*.platform=linux/amd64,linux/arm64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }}
*.args.SETUP_ARGS=${{ matrix.setup-args }}
*.args.LIB_DIR=${{ matrix.lib_dir }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.ref_name }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.ref_name }},mode=max
tag-suffix: ${{ matrix.additional-tag-suffix }}-${{ matrix.platform }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ github.ref_name }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ github.ref_name }},mode=max
tag-suffix: ${{ matrix.additional-tag-suffix }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}

- name: Show disk space
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/update-docker-manifest.yaml

This file was deleted.

Loading
Loading