ci: remove dependency on run-on-arch-action

run-on-arch-action is simply a wrapper around docker. There is no
value in using it in libbpf, as it is not complicated to run
non-native arch docker images directly on github-hosted runners.

Docker relies on qemu-user-static installed on the system to emulate
different architectures.

Recently there were various reports about multi-arch docker builds
failing with seemingly random issues, and it appears to boil down to
qemu [1]. I stumbled on this problem while updating s390x runners [2]
for BPF CI, and setting up more recent version of qemu helped.

This change addresses recent build failures on s390x and ppc64le.

[1] https://github.com/docker/setup-qemu-action/issues/188
[2] https://github.com/kernel-patches/runner/pull/69
[3] https://docs.docker.com/build/buildkit/#getting-started

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
This commit is contained in:
Ihor Solodrai
2025-01-31 13:15:51 -08:00
committed by Andrii Nakryiko
parent 324f3c3846
commit d4a841a32b
2 changed files with 36 additions and 21 deletions

View File

@@ -61,31 +61,32 @@ jobs:
- arch: aarch64 - arch: aarch64
- arch: ppc64le - arch: ppc64le
- arch: s390x - arch: s390x
- arch: x86 - arch: amd64
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
name: Checkout name: Checkout
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:qemu-v8.1.5
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
name: Pre-Setup name: Pre-Setup
- run: source /tmp/ci_setup && sudo -E $CI_ROOT/managers/ubuntu.sh - run: source /tmp/ci_setup && sudo -E $CI_ROOT/managers/ubuntu.sh
if: matrix.arch == 'x86' if: matrix.arch == 'amd64'
name: Setup name: Setup
- uses: uraimo/run-on-arch-action@v2.8.1
name: Build in docker - name: Build in docker
if: matrix.arch != 'x86' if: matrix.arch != 'amd64'
with: run: |
distro: cp /tmp/ci_setup ${GITHUB_WORKSPACE}
ubuntu22.04 docker run --rm \
arch: --platform linux/${{ matrix.arch }} \
${{ matrix.arch }} -v ${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE} \
setup: -e GITHUB_WORKSPACE=${GITHUB_WORKSPACE} \
cp /tmp/ci_setup $GITHUB_WORKSPACE -w /ci/workspace \
dockerRunArgs: | ubuntu:noble \
--volume "${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}" ${GITHUB_WORKSPACE}/ci/build-in-docker.sh
shell: /bin/bash
install: |
export DEBIAN_FRONTEND=noninteractive
export TZ="America/Los_Angeles"
apt-get update -y
apt-get install -y tzdata build-essential sudo
run: source ${GITHUB_WORKSPACE}/ci_setup && $CI_ROOT/managers/ubuntu.sh

14
ci/build-in-docker.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
export TZ="America/Los_Angeles"
apt-get update -y
apt-get install -y tzdata build-essential sudo
source ${GITHUB_WORKSPACE}/ci_setup
$CI_ROOT/managers/ubuntu.sh
exit 0