Skip to content

Commit a4ad95c

Browse files
authored
* Add ci/vmtest/configs/run-vmtest.env to control allow/deny lists * Use v3 of libbpf/ci actions in all workflows Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
1 parent 78dc9a4 commit a4ad95c

File tree

5 files changed

+63
-39
lines changed

5 files changed

+63
-39
lines changed

.github/workflows/kernel-build.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ jobs:
6262
name: Download bpf-next tree
6363
env:
6464
FETCH_DEPTH: ${{ env.BPF_NEXT_FETCH_DEPTH }}
65-
uses: libbpf/ci/get-linux-source@v2
65+
uses: libbpf/ci/get-linux-source@v3
6666
with:
6767
dest: '.kernel'
6868
rev: ${{ env.BPF_NEXT_BASE_BRANCH }}
69-
- uses: libbpf/ci/prepare-incremental-build@v2
69+
- uses: libbpf/ci/prepare-incremental-build@v3
7070
with:
7171
repo-root: ${{ inputs.download_sources && '.kernel' || env.REPO_ROOT }}
7272
base-branch: >-
@@ -86,34 +86,28 @@ jobs:
8686
mv -t .. $(ls -A)
8787
cd ..
8888
rmdir .kernel
89-
- uses: libbpf/ci/patch-kernel@v2
89+
- uses: libbpf/ci/patch-kernel@v3
9090
with:
9191
patches-root: '${{ github.workspace }}/ci/diffs'
9292
repo-root: ${{ env.REPO_ROOT }}
93+
9394
- name: Setup build environment
94-
uses: libbpf/ci/setup-build-env@v2
95+
uses: libbpf/ci/setup-build-env@v3
9596
with:
9697
arch: ${{ inputs.arch }}
9798
llvm-version: ${{ inputs.llvm-version }}
9899
pahole: master
99-
- name: Print toolchain version used
100-
shell: bash
101-
run: |
102-
TOOLCHAIN=${{ inputs.toolchain }}
103-
if [ $TOOLCHAIN = "llvm" ]; then
104-
TOOLCHAIN="clang-${{ inputs.llvm-version }}"
105-
fi
106-
${TOOLCHAIN} --version
100+
107101
- name: Build kernel image
108-
uses: libbpf/ci/build-linux@v2
102+
uses: libbpf/ci/build-linux@v3
109103
with:
110104
arch: ${{ inputs.arch }}
111105
toolchain: ${{ inputs.toolchain }}
112106
kbuild-output: ${{ env.KBUILD_OUTPUT }}
113107
max-make-jobs: 32
114108
llvm-version: ${{ inputs.llvm-version }}
115109
- name: Build selftests/bpf
116-
uses: libbpf/ci/build-selftests@v2
110+
uses: libbpf/ci/build-selftests@v3
117111
env:
118112
MAX_MAKE_JOBS: 32
119113
RELEASE: ${{ inputs.release && '1' || '' }}
@@ -125,17 +119,18 @@ jobs:
125119

126120
- if: ${{ env.BUILD_SCHED_EXT_SELFTESTS }}
127121
name: Build selftests/sched_ext
128-
uses: libbpf/ci/build-scx-selftests@v2
122+
uses: libbpf/ci/build-scx-selftests@v3
129123
with:
130124
kbuild-output: ${{ env.KBUILD_OUTPUT }}
131125
repo-root: ${{ env.REPO_ROOT }}
132126
arch: ${{ inputs.arch }}
133127
toolchain: ${{ inputs.toolchain }}
134128
llvm-version: ${{ inputs.llvm-version }}
135129
max-make-jobs: 32
130+
136131
- if: ${{ github.event_name != 'push' }}
137132
name: Build samples
138-
uses: libbpf/ci/build-samples@v2
133+
uses: libbpf/ci/build-samples@v3
139134
with:
140135
arch: ${{ inputs.arch }}
141136
toolchain: ${{ inputs.toolchain }}
@@ -144,7 +139,7 @@ jobs:
144139
llvm-version: ${{ inputs.llvm-version }}
145140
- name: Tar artifacts
146141
id: tar-artifacts
147-
uses: libbpf/ci/tar-artifacts@v2
142+
uses: libbpf/ci/tar-artifacts@v3
148143
env:
149144
ARCHIVE_BPF_SELFTESTS: 'true'
150145
ARCHIVE_MAKE_HELPERS: 'true'

.github/workflows/kernel-test.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -64,31 +64,18 @@ jobs:
6464
# zstd is installed by default in the runner images.
6565
run: zstd -d -T0 vmlinux-${{ inputs.arch }}-${{ inputs.toolchain_full }}.tar.zst --stdout | tar -xf -
6666

67-
- name: Prepare ALLOW/DENYLIST
68-
env:
69-
SELFTESTS_BPF: ${{ github.workspace }}/selftests/bpf
70-
VMTEST_CONFIGS: ${{ github.workspace }}/ci/vmtest/configs
71-
run: |
72-
cat "${SELFTESTS_BPF}/ALLOWLIST" \
73-
"${SELFTESTS_BPF}/ALLOWLIST.${ARCH}" \
74-
"${VMTEST_CONFIGS}/ALLOWLIST" \
75-
"${VMTEST_CONFIGS}/ALLOWLIST.${ARCH}" \
76-
2> /dev/null > "${ALLOWLIST_FILE}" || true
77-
78-
cat "${SELFTESTS_BPF}/DENYLIST" \
79-
"${SELFTESTS_BPF}/DENYLIST.${ARCH}" \
80-
"${VMTEST_CONFIGS}/DENYLIST" \
81-
"${VMTEST_CONFIGS}/DENYLIST.${ARCH}" \
82-
"${VMTEST_CONFIGS}/DENYLIST.${DEPLOYMENT}" \
83-
2> /dev/null > "${DENYLIST_FILE}" || true
84-
8567
- name: Run selftests
86-
uses: libbpf/ci/run-vmtest@v2
68+
uses: libbpf/ci/run-vmtest@v3
8769
# https://github.com/actions/runner/issues/1483#issuecomment-1031671517
8870
# booleans are weird in GH.
8971
continue-on-error: ${{ fromJSON(env.CONTINUE_ON_ERROR) }}
9072
timeout-minutes: ${{ inputs.timeout_minutes }}
9173
env:
74+
ARCH: ${{ inputs.arch }}
75+
DEPLOYMENT: ${{ env.DEPLOYMENT }}
76+
KERNEL_TEST: ${{ inputs.test }}
77+
SELFTESTS_BPF: ${{ github.workspace }}/selftests/bpf
78+
VMTEST_CONFIGS: ${{ github.workspace }}/ci/vmtest/configs
9279
TEST_PROGS_WATCHDOG_TIMEOUT: 300
9380
with:
9481
arch: ${{ inputs.arch }}

.github/workflows/veristat-kernel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
run: zstd -d -T0 vmlinux-${{ env.ARCH_AND_TOOL }}.tar.zst --stdout | tar -xf -
4949

5050
- name: Run veristat
51-
uses: libbpf/ci/run-vmtest@v2
51+
uses: libbpf/ci/run-vmtest@v3
5252
with:
5353
arch: x86_64
5454
vmlinuz: '${{ github.workspace }}/vmlinuz'

.github/workflows/veristat-meta.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
run: zstd -d -T0 vmlinux-${{ env.ARCH_AND_TOOL }}.tar.zst --stdout | tar -xf -
5757

5858
- name: Configure AWS Credentials
59-
uses: aws-actions/configure-aws-credentials@v2
59+
uses: aws-actions/configure-aws-credentials@v3
6060
with:
6161
aws-region: ${{ inputs.aws_region }}
6262
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
@@ -70,7 +70,7 @@ jobs:
7070
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
7171

7272
- name: Run veristat
73-
uses: libbpf/ci/run-vmtest@v2
73+
uses: libbpf/ci/run-vmtest@v3
7474
with:
7575
arch: x86_64
7676
vmlinuz: '${{ github.workspace }}/vmlinuz'

ci/vmtest/configs/run-vmtest.env

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
# This file is sourced by libbpf/ci/run-vmtest Github Action scripts.
4+
#
5+
# The primary reason it exists is that assembling ALLOWLIST and
6+
# DENYLIST for a particular test run is not a trivial operation.
7+
#
8+
# Users of libbpf/ci/run-vmtest action need to be able to specify a
9+
# list of allow/denylist **files**, that later has to be correctly
10+
# merged into a single allow/denylist passed to a test runner.
11+
#
12+
# Obviously it's perferrable for the scripts merging many lists into
13+
# one to be reusable, and not copy-pasted between repositories which
14+
# use libbpf/ci actions. And specifying the lists should be trivial.
15+
# This file is a solution to that.
16+
17+
# $SELFTESTS_BPF and $VMTEST_CONFIGS are set in the workflow, before
18+
# libbpf/ci/run-vmtest action is called
19+
# See .github/workflows/kernel-test.yml
20+
21+
ALLOWLIST_FILES=(
22+
"${SELFTESTS_BPF}/ALLOWLIST"
23+
"${SELFTESTS_BPF}/ALLOWLIST.${ARCH}"
24+
"${VMTEST_CONFIGS}/ALLOWLIST"
25+
"${VMTEST_CONFIGS}/ALLOWLIST.${ARCH}"
26+
"${VMTEST_CONFIGS}/ALLOWLIST.${DEPLOYMENT}"
27+
"${VMTEST_CONFIGS}/ALLOWLIST.${KERNEL_TEST}"
28+
)
29+
30+
DENYLIST_FILES=(
31+
"${SELFTESTS_BPF}/DENYLIST"
32+
"${SELFTESTS_BPF}/DENYLIST.${ARCH}"
33+
"${VMTEST_CONFIGS}/DENYLIST"
34+
"${VMTEST_CONFIGS}/DENYLIST.${ARCH}"
35+
"${VMTEST_CONFIGS}/DENYLIST.${DEPLOYMENT}"
36+
"${VMTEST_CONFIGS}/DENYLIST.${KERNEL_TEST}"
37+
)
38+
39+
# Export pipe-separated strings, because bash doesn't support array export
40+
export SELFTESTS_BPF_ALLOWLIST_FILES=$(IFS="|"; echo "${ALLOWLIST_FILES[*]}")
41+
export SELFTESTS_BPF_DENYLIST_FILES=$(IFS="|"; echo "${DENYLIST_FILES[*]}")
42+

0 commit comments

Comments
 (0)