mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-05 10:50:18 +00:00
Merge pull request #10831 from RuoqingHe/ci-riscv64
ci: Enable partial components build-check on riscv
This commit is contained in:
98
.github/workflows/build-checks-preview-riscv64.yaml
vendored
Normal file
98
.github/workflows/build-checks-preview-riscv64.yaml
vendored
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
# This yaml is designed to be used until all components listed in
|
||||||
|
# `build-checks.yaml` are supported
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
instance:
|
||||||
|
default: "riscv-builder"
|
||||||
|
description: "Default instance when manually triggering"
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
instance:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
name: Build checks preview riscv64
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ${{ inputs.instance }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
component:
|
||||||
|
- agent-ctl
|
||||||
|
- trace-forwarder
|
||||||
|
- genpolicy
|
||||||
|
command:
|
||||||
|
- "make vendor"
|
||||||
|
- "make check"
|
||||||
|
- "make test"
|
||||||
|
- "sudo -E PATH=\"$PATH\" make test"
|
||||||
|
include:
|
||||||
|
- component: agent-ctl
|
||||||
|
component-path: src/tools/agent-ctl
|
||||||
|
- component: trace-forwarder
|
||||||
|
component-path: src/tools/trace-forwarder
|
||||||
|
- install-libseccomp: no
|
||||||
|
- component: genpolicy
|
||||||
|
component-path: src/tools/genpolicy
|
||||||
|
steps:
|
||||||
|
- name: Adjust a permission for repo
|
||||||
|
run: |
|
||||||
|
sudo chown -R "$USER":"$USER" "$GITHUB_WORKSPACE" "$HOME"
|
||||||
|
sudo rm -rf "$GITHUB_WORKSPACE"/* || { sleep 10 && sudo rm -rf "$GITHUB_WORKSPACE"/*; }
|
||||||
|
sudo rm -f /tmp/kata_hybrid* # Sometime we got leftover from test_setup_hvsock_failed()
|
||||||
|
|
||||||
|
- name: Checkout the code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install yq
|
||||||
|
run: |
|
||||||
|
./ci/install_yq.sh
|
||||||
|
env:
|
||||||
|
INSTALL_IN_GOPATH: false
|
||||||
|
- name: Install golang
|
||||||
|
if: ${{ matrix.component == 'runtime' }}
|
||||||
|
run: |
|
||||||
|
./tests/install_go.sh -f -p
|
||||||
|
echo "/usr/local/go/bin" >> "$GITHUB_PATH"
|
||||||
|
- name: Install rust
|
||||||
|
if: ${{ matrix.component != 'runtime' }}
|
||||||
|
run: |
|
||||||
|
./tests/install_rust.sh
|
||||||
|
echo "${HOME}/.cargo/bin" >> "$GITHUB_PATH"
|
||||||
|
- name: Install musl-tools
|
||||||
|
if: ${{ matrix.component != 'runtime' }}
|
||||||
|
run: sudo apt-get -y install musl-tools
|
||||||
|
- name: Install devicemapper
|
||||||
|
if: ${{ matrix.command == 'make check' && matrix.component == 'agent' }}
|
||||||
|
run: sudo apt-get -y install libdevmapper-dev
|
||||||
|
- name: Install libseccomp
|
||||||
|
if: ${{ matrix.command != 'make vendor' && matrix.command != 'make check' && matrix.install-libseccomp == 'yes' }}
|
||||||
|
run: |
|
||||||
|
libseccomp_install_dir=$(mktemp -d -t libseccomp.XXXXXXXXXX)
|
||||||
|
gperf_install_dir=$(mktemp -d -t gperf.XXXXXXXXXX)
|
||||||
|
./ci/install_libseccomp.sh "${libseccomp_install_dir}" "${gperf_install_dir}"
|
||||||
|
echo "Set environment variables for the libseccomp crate to link the libseccomp library statically"
|
||||||
|
echo "LIBSECCOMP_LINK_TYPE=static" >> "$GITHUB_ENV"
|
||||||
|
echo "LIBSECCOMP_LIB_PATH=${libseccomp_install_dir}/lib" >> "$GITHUB_ENV"
|
||||||
|
- name: Install protobuf-compiler
|
||||||
|
if: ${{ matrix.command != 'make vendor' && (matrix.component == 'agent' || matrix.component == 'genpolicy' || matrix.component == 'agent-ctl') }}
|
||||||
|
run: sudo apt-get -y install protobuf-compiler
|
||||||
|
- name: Install clang
|
||||||
|
if: ${{ matrix.command == 'make check' && (matrix.component == 'agent' || matrix.component == 'agent-ctl') }}
|
||||||
|
run: sudo apt-get -y install clang
|
||||||
|
- name: Setup XDG_RUNTIME_DIR for the `runtime` tests
|
||||||
|
if: ${{ matrix.command != 'make vendor' && matrix.command != 'make check' && matrix.component == 'runtime' }}
|
||||||
|
run: |
|
||||||
|
XDG_RUNTIME_DIR=$(mktemp -d "/tmp/kata-tests-$USER.XXX" | tee >(xargs chmod 0700))
|
||||||
|
echo "XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR}" >> "$GITHUB_ENV"
|
||||||
|
- name: Running `${{ matrix.command }}` for ${{ matrix.component }}
|
||||||
|
run: |
|
||||||
|
cd ${{ matrix.component-path }}
|
||||||
|
${{ matrix.command }}
|
||||||
|
env:
|
||||||
|
RUST_BACKTRACE: "1"
|
||||||
|
SKIP_GO_VERSION_CHECK: "1"
|
12
.github/workflows/static-checks-self-hosted.yaml
vendored
12
.github/workflows/static-checks-self-hosted.yaml
vendored
@@ -32,3 +32,15 @@ jobs:
|
|||||||
uses: ./.github/workflows/build-checks.yaml
|
uses: ./.github/workflows/build-checks.yaml
|
||||||
with:
|
with:
|
||||||
instance: ${{ matrix.instance }}
|
instance: ${{ matrix.instance }}
|
||||||
|
|
||||||
|
build-checks-preview:
|
||||||
|
needs: skipper
|
||||||
|
if: ${{ needs.skipper.outputs.skip_static != 'yes' }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
instance:
|
||||||
|
- "riscv-builder"
|
||||||
|
uses: ./.github/workflows/build-checks-preview-riscv64.yaml
|
||||||
|
with:
|
||||||
|
instance: ${{ matrix.instance }}
|
||||||
|
@@ -836,6 +836,7 @@ function arch_to_golang() {
|
|||||||
case "${arch}" in
|
case "${arch}" in
|
||||||
aarch64) echo "arm64";;
|
aarch64) echo "arm64";;
|
||||||
ppc64le) echo "${arch}";;
|
ppc64le) echo "${arch}";;
|
||||||
|
riscv64) echo "${arch}";;
|
||||||
x86_64) echo "amd64";;
|
x86_64) echo "amd64";;
|
||||||
s390x) echo "s390x";;
|
s390x) echo "s390x";;
|
||||||
*) die "unsupported architecture: ${arch}";;
|
*) die "unsupported architecture: ${arch}";;
|
||||||
@@ -849,6 +850,7 @@ function arch_to_rust() {
|
|||||||
case "${arch}" in
|
case "${arch}" in
|
||||||
aarch64) echo "${arch}";;
|
aarch64) echo "${arch}";;
|
||||||
ppc64le) echo "powerpc64le";;
|
ppc64le) echo "powerpc64le";;
|
||||||
|
riscv64) echo "riscv64gc";;
|
||||||
x86_64) echo "${arch}";;
|
x86_64) echo "${arch}";;
|
||||||
s390x) echo "${arch}";;
|
s390x) echo "${arch}";;
|
||||||
*) die "unsupported architecture: ${arch}";;
|
*) die "unsupported architecture: ${arch}";;
|
||||||
|
@@ -35,11 +35,11 @@ export PATH="${PATH}:${HOME}/.cargo/bin"
|
|||||||
## this command will not take too long to run.
|
## this command will not take too long to run.
|
||||||
rustup toolchain install ${version}
|
rustup toolchain install ${version}
|
||||||
rustup default ${version}
|
rustup default ${version}
|
||||||
if [ "${rustarch}" == "powerpc64le" ] || [ "${rustarch}" == "s390x" ] ; then
|
if [ "${rustarch}" == "x86_64" ] || [ "${rustarch}" == "aarch64" ] ; then
|
||||||
rustup target add ${rustarch}-unknown-linux-gnu
|
|
||||||
else
|
|
||||||
rustup target add ${rustarch}-unknown-linux-musl
|
rustup target add ${rustarch}-unknown-linux-musl
|
||||||
$([ "$(whoami)" != "root" ] && echo sudo) ln -sf /usr/bin/g++ /bin/musl-g++
|
$([ "$(whoami)" != "root" ] && echo sudo) ln -sf /usr/bin/g++ /bin/musl-g++
|
||||||
|
else
|
||||||
|
rustup target add ${rustarch}-unknown-linux-gnu
|
||||||
fi
|
fi
|
||||||
rustup component add rustfmt
|
rustup component add rustfmt
|
||||||
rustup component add clippy
|
rustup component add clippy
|
||||||
|
6
utils.mk
6
utils.mk
@@ -151,6 +151,12 @@ ifeq ($(ARCH), ppc64le)
|
|||||||
$(warning "WARNING: powerpc64le-unknown-linux-musl target is unavailable")
|
$(warning "WARNING: powerpc64le-unknown-linux-musl target is unavailable")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(ARCH), riscv64)
|
||||||
|
override LIBC = gnu
|
||||||
|
override ARCH = riscv64gc
|
||||||
|
$(warning "WARNING: riscv64gc-unknown-linux-musl target is unavailable")
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH), s390x)
|
ifeq ($(ARCH), s390x)
|
||||||
override LIBC = gnu
|
override LIBC = gnu
|
||||||
$(warning "WARNING: s390x-unknown-linux-musl target is unavailable")
|
$(warning "WARNING: s390x-unknown-linux-musl target is unavailable")
|
||||||
|
Reference in New Issue
Block a user