-
Notifications
You must be signed in to change notification settings - Fork 25
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
run-vmtest@v2 and build-selftests@v2 #150
Conversation
4db1d56
to
ff45d47
Compare
5db3a07
to
766dd98
Compare
1c98688
to
73fe629
Compare
run-vmtest/run.sh
Outdated
@@ -5,6 +5,11 @@ trap 'exit 2' ERR | |||
|
|||
source "${GITHUB_ACTION_PATH}/../helpers.sh" | |||
|
|||
if [[ -z "${VMLINUZ}" || ! -f "${VMLINUZ}" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Given that we don't use mode set -x
, would it be useful to echo something along the line of vmlinuz not specified or not found, searching image
.
@@ -6,7 +6,7 @@ DIFF_DIR=$1 | |||
for ext in diff patch; do | |||
if ls ${DIFF_DIR}/*.${ext} 1>/dev/null 2>&1; then | |||
for file in ${DIFF_DIR}/*.${ext}; do | |||
if patch --dry-run -p1 -s < "${file}" 2>/dev/null; then | |||
if patch --dry-run -N --silent -p1 -s < "${file}" 2>/dev/null; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason for the -N here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From man:
-N or --forward
When a patch does not apply, patch usually checks if the patch
looks like it has been applied already by trying to reverse-
apply the first hunk. The --forward option prevents that.
See also -R.
This is to avoid prints like this in the job logs:
1 out of 1 hunk ignored
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
IIRC --silent
does not prevent this prompt.
run-vmtest/run-bpf-selftests.sh
Outdated
# There are 2 ways to pass test names. | ||
# 1) command-line arguments to this script | ||
# 2) a comma-separated list of test names passed as `run_tests` boot parameters. | ||
# test names passed as any of those methods will be ran. | ||
# 2) a comma-separated list of test names passed as `run_tests` boot | ||
# parameters. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably more for historical reasons these days. Maybe we should support only one way. I believe the boot parameters approach is not used anymore since the move to vmtest. It was needed with the old image approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It looks like boot parameter way isn't used anymore. I'll clean this up.
env: | ||
MAX_MAKE_JOBS: ${{ inputs.max-make-jobs }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this used to be used to control how many cpus were used when compiling. On bare metal, with 96 CPUs, if all containers are building at the same time, they will all use that many CPUs, bringing the machine to a crawl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still used, it's just not an action input anymore. A caller can set it like here.
The default is 4*nproc, controlled here.
73fe629
to
d957e16
Compare
Previously the first run-vmtest action step would always search for vmlinux image in KERNEL_ROOT, and then copy it to path specified by inputs.vmlinuz However, the caller may want to pass vmlinux image directly. Change this behavior: search only inputs.vmlinuz was not passed. Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
Various changes in the scripts aimed to make run-vmtest action usable by libbpf/libbpf workflows: * Change how ALLOWLIST and DENYLIST are set up. A script executing in qemu (vmtest) is now expecting a single $ALLOWLIST_FILE and $DENYLIST_FILE which are parsed by read_lists as usual. This change makes it easier for an action caller to modify the lists, as they are often composed from a number of files. * Update vmtest init command (executed in qemu before the tests), to create a link from /boot to vmlinux being tested. This is necessary when older kernels are tested. * Allow some env variables to be defined outside of the scripts to give the caller more control over the action. That is, before setting a default value, check if the variable is set. * Remove env vars like $THISDIR, $PROJECT_NAME etc. in favor of $GITHUB_ACTION_PATH, $GITHUB_WORKSPACE and $KERNEL_ROOT * Move selftests running scripts from ci/vmtest to run-vmtest, so that they are local to the action Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
Adjust run-vmtest scripts so that the action is callable from libbpf/libbpf, particularly with pre-built kernels. More environment variables can now be set by a caller to direct the scripts behavior: SELFTESTS_BPF, VERISTAT_CONFIGS, VMLINUX, VMLINUZ A symlink to standard vmlinux location is created before vmtest is executed to accomodate older kernels. The command passed tp vmtest is refactored, separating generic vmtet init and VMTEST_SCRIPT execution. Search and processing of json test summaries is now noop in case when no summaries are found. Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
FETCH_DEPTH now controls how to get linux source. If it's 0, the snapshot is searched for and downloaded if found. Otherwise git clone --depth $FETCH_DEPTH is executed, and .git is preserved. Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
Changes in action inputs: * kernel-root is now a required input * kernel, kbuild-output and max-make-jobs are removed kernel-root input is required, because to build selftests one must to clone a kernel source tree first. The build script behavior can be directed more granularly with env variables: * KBUILD_OUTPUT now defaults to the kernel-root * VMLINUX_BTF now can be set externally * MAX_MAKE_JOBS can be set as env variable if desired Preparation script logic is removed: the rationale is that the caller is responsible for setting up required environment before building. Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
Introduce CACHED_KERNEL_BUILD variable and change download/build steps to make use of the cached incremental build on libbpf/ci workflows. Change parameters passed to build-selftests. Add a step preparing allow/denylist before running vmtest. Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
d957e16
to
dad756f
Compare
Also set pahole to master instead of a hardcoded commit. Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
* remove boot parameter processing in run-bpf-selftests.sh * add logging to run.sh re VMLINUX and VMLINUZ variables Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
dad756f
to
5502345
Compare
Properly handle FETCH_DEPTH=0 (default) case. If snapshot download has failed, clone with --depth=1 Refactor checkout_latest_kernel.sh and make the conditions more clear. Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
Also set pahole to master instead of a hardcoded commit. Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
Also set pahole to master instead of a hardcoded commit. Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
Updates to various actions and scripts with breaking API changes. The goal of the changes is to make the actions usable by libbpf/libbpf#862.
See commits for details.