kdevops: add support for A/B testing
Subsystems (3)
v2 cover kdevops: add support for A/B testing
This v2 is rebased on top of the latest changes, and extends support to be more careful. It also now adds a check to ensure we don't regress this.
A train of sytling fixes goes with this patchset as we adopt more AI code, as its the only way to keep them on check on styling. Turns out its an art on it own.
Luis Chamberlain (9):
roles/guestfs: add missing bootlinux_9p: False
Makefile: suppress Ansible warnings during configuration generation
playbooks: few space cleanups
style: add extensive code formatting checks to make style
Makefile: move styling to scripts/style.Makefile CLAUDE.md: add instrucitons to verify commit
all: run black
devconfig: add automatic APT mirror fallback for Debian testing
bootlinux: add support for A/B kernel testing
.github/workflows/linux-ab-testing.yml | 217 +++++++++ .github/workflows/linux-ab.yml | 47 ++ CLAUDE.md | 10 + Makefile | 18 +- PROMPTS.md | 52 +++ defconfigs/linux-ab-testing | 14 + defconfigs/linux-ab-testing-9p | 15 + defconfigs/linux-ab-testing-builder | 15 + defconfigs/linux-ab-testing-target | 15 + docs/kdevops-make-linux.md | 158 +++++++ playbooks/mmtests.yml | 2 +- .../blktests/augment_expunge_list.py | 95 ++-- .../workflows/blktests/gen-expunge-args.py | 46 +- .../workflows/blktests/gen-results-dir.py | 39 +- .../blktests/get_new_expunge_files.py | 16 +- .../dynamic-kconfig/gen-dynamic-pci.py | 89 ++-- .../workflows/fstests/augment_expunge_list.py | 163 +++++-- .../workflows/fstests/bad_files_summary.py | 46 +- .../fstests/fstests-checktime-distribution.py | 46 +- .../workflows/fstests/gen_results_summary.py | 132 +++--- .../fstests/get_new_expunge_files.py | 24 +- playbooks/python/workflows/fstests/lib/git.py | 21 +- .../workflows/fstests/xunit_merge_all.py | 33 +- .../sysbench/sysbench-tps-compare.py | 84 +++- .../workflows/sysbench/sysbench-tps-plot.py | 36 +- .../sysbench/sysbench-tps-variance.py | 435 +++++++++++++----- playbooks/roles/bootlinux/defaults/main.yml | 14 + playbooks/roles/bootlinux/tasks/build/9p.yml | 20 +- .../install-minimal-deps/debian/main.yml | 2 +- .../tasks/install-minimal-deps/main.yml | 2 +- .../install-minimal-deps/redhat/main.yml | 2 +- .../tasks/install-minimal-deps/suse/main.yml | 2 +- playbooks/roles/bootlinux/tasks/main.yml | 112 +++++ .../devconfig/tasks/check-apt-mirrors.yml | 63 +++ playbooks/roles/devconfig/tasks/main.yml | 8 + .../debian-testing-fallback-sources.list | 10 + .../gen_pcie_passthrough_guestfs_xml.py | 49 +- playbooks/roles/guestfs/defaults/main.yml | 1 + .../linux-mirror/python/gen-mirror-files.py | 131 +++--- .../linux-mirror/python/start-mirroring.py | 116 +++-- .../roles/mmtests/tasks/install-deps/main.yml | 2 +- scripts/check_commit_format.py | 28 +- .../generation/check_for_atomic_calls.py | 71 +-- .../generation/check_for_sleepy_calls.py | 202 +++++--- scripts/detect_indentation_issues.py | 163 +++++++ scripts/detect_whitespace_issues.py | 38 +- scripts/ensure_newlines.py | 75 +++ scripts/fix_indentation_issues.py | 152 ++++++ scripts/fix_whitespace_issues.py | 44 +- scripts/generate_refs.py | 6 +- scripts/honey-badger.py | 103 +++-- scripts/infer_last_stable_kernel.sh | 35 ++ scripts/linux-ab-testing.Makefile | 51 ++ scripts/spdxcheck.py | 201 ++++---- scripts/style.Makefile | 12 + scripts/test-linux-ab-config.py | 182 ++++++++ scripts/test-linux-ab.sh | 213 +++++++++ scripts/update_ssh_config_guestfs.py | 49 +- .../workflows/blktests/blktests_watchdog.py | 75 ++- scripts/workflows/cxl/gen_qemu_cxl.py | 235 +++++++--- scripts/workflows/fstests/fstests_watchdog.py | 99 ++-- scripts/workflows/generic/crash_report.py | 4 +- scripts/workflows/generic/crash_watchdog.py | 78 +++- scripts/workflows/lib/blktests.py | 47 +- scripts/workflows/lib/crash.py | 12 +- scripts/workflows/lib/fstests.py | 155 ++++--- scripts/workflows/lib/kssh.py | 178 ++++--- scripts/workflows/lib/systemd_remote.py | 101 ++-- .../workflows/pynfs/check_pynfs_results.py | 17 +- workflows/linux/Kconfig | 102 +++- workflows/linux/Makefile | 39 ++ 71 files changed, 4049 insertions(+), 1120 deletions(-) create mode 100644 .github/workflows/linux-ab-testing.yml create mode 100644 .github/workflows/linux-ab.yml create mode 100644 defconfigs/linux-ab-testing create mode 100644 defconfigs/linux-ab-testing-9p create mode 100644 defconfigs/linux-ab-testing-builder create mode 100644 defconfigs/linux-ab-testing-target create mode 100644 playbooks/roles/devconfig/tasks/check-apt-mirrors.yml create mode 100644 playbooks/roles/devconfig/templates/debian-testing-fallback-sources.list create mode 100755 scripts/detect_indentation_issues.py create mode 100755 scripts/ensure_newlines.py create mode 100755 scripts/fix_indentation_issues.py create mode 100755 scripts/infer_last_stable_kernel.sh create mode 100644 scripts/linux-ab-testing.Makefile create mode 100644 scripts/style.Makefile create mode 100755 scripts/test-linux-ab-config.py create mode 100755 scripts/test-linux-ab.sh
Signature · 1 line
2.47.2
PATCH v2 1/9 roles/guestfs: add missing bootlinux_9p: False
Commit 722d83a4871c41 ("bootlinux: Move 9p build tasks to a subrole") added a proactive directory creation as we no longer git clone right away, but forgot to ensure the variable is defined by default. When we don't enable building linux this variable is not defined. Fix this.
--- playbooks/roles/guestfs/defaults/main.yml | 1 + 1 file changed, 1 insertion(+)
playbooks/roles/guestfs/defaults/main.yml +1 -0
@@ -3,3 +3,4 @@ distro_debian_based: false libvirt_uri_system: false libvirt_enable_largeio: false +bootlinux_9p: False
Signature · 1 line
2.47.2
Re: [PATCH v2 1/9] roles/guestfs: add missing bootlinux_9p: False
Quoted 16 lines · Luis Chamberlain
Commit
722d83a4871c41("bootlinux: Move 9p build tasks to a subrole") added a proactive directory creation as we no longer git clone right away, but forgot to ensure the variable is defined by default. When we don't enable building linux this variable is not defined. Fix this.Fixes 722d83a4871c41 ("bootlinux: Move 9p build tasks to a subrole")Signed-off-by Luis Chamberlain <[email protected]>--- playbooks/roles/guestfs/defaults/main.yml | 1 + 1 file changed, 1 insertion(+)playbooks/roles/guestfs/defaults/main.yml +0
-0
playbooks/roles/guestfs/defaults/main.yml distro_debian_based: false · line 6
Quoted 4 lines
playbooks/roles/guestfs/defaults/main.yml +1
-0@@ -3,3 +3,4 @@ distro_debian_based: false libvirt_uri_system: false libvirt_enable_largeio: false +bootlinux_9p: False
For "Move 9p build tasks to a subrole" IIRC all Kconfig configurations allowed "output yaml" to set bootlinux_9p, so a default was unnecessary.
Some later patch made it possible for "make menuconfig" to complete without encountering that "output yaml" so that must be what leaves the variable unset.
Signature · 1 line
Chuck Lever
PATCH v2 2/9 Makefile: suppress Ansible warnings during configuration generation
In reply to Luis ChamberlainThe initial configuration generation playbooks (ansible_cfg.yml, gen_hosts.yml, and gen_nodes.yml) run without a proper inventory file by design, as they are responsible for creating the configuration files that will be used by subsequent playbooks.
This causes Ansible to emit warnings about:
- "No inventory was parsed, only implicit localhost is available"
- "provided hosts list is empty, only localhost is available"
These warnings are harmless but create noise in the build output, potentially confusing users who might think something is wrong.
Add ANSIBLE_LOCALHOST_WARNING=False and ANSIBLE_INVENTORY_UNPARSED_WARNING=False environment variables to these three ansible-playbook invocations to suppress these specific warnings. This makes the build output cleaner while maintaining the same functionality.
The warnings were appearing because:
1. ansible_cfg.yml creates the ansible.cfg file
2. gen_hosts.yml creates the hosts inventory file
3. gen_nodes.yml creates the kdevops_nodes.yaml file
All three intentionally run with "--connection=local" and minimal inventory since they're bootstrapping the configuration that other playbooks will use.
--- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Makefile +6 -3
@@ -195,7 +195,8 @@ include scripts/gen-nodes.Makefile false) $(ANSIBLE_CFG_FILE): .config - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ + $(Q)ANSIBLE_LOCALHOST_WARNING=False ANSIBLE_INVENTORY_UNPARSED_WARNING=False \ + ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ --inventory localhost, \ $(KDEVOPS_PLAYBOOKS_DIR)/ansible_cfg.yml \ --extra-vars=@./.extra_vars_auto.yaml
@@ -226,13 +227,15 @@ endif DEFAULT_DEPS += $(ANSIBLE_INVENTORY_FILE) $(ANSIBLE_INVENTORY_FILE): .config $(ANSIBLE_CFG_FILE) $(KDEVOPS_HOSTS_TEMPLATE) - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \ + $(Q)ANSIBLE_LOCALHOST_WARNING=False ANSIBLE_INVENTORY_UNPARSED_WARNING=False \ + ansible-playbook $(ANSIBLE_VERBOSE) \ $(KDEVOPS_PLAYBOOKS_DIR)/gen_hosts.yml \ --extra-vars=@./extra_vars.yaml DEFAULT_DEPS += $(KDEVOPS_NODES) $(KDEVOPS_NODES): .config $(ANSIBLE_CFG_FILE) $(KDEVOPS_NODES_TEMPLATE) - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ + $(Q)ANSIBLE_LOCALHOST_WARNING=False ANSIBLE_INVENTORY_UNPARSED_WARNING=False \ + ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ --inventory localhost, \ $(KDEVOPS_PLAYBOOKS_DIR)/gen_nodes.yml \ --extra-vars=@./extra_vars.yaml
Signature · 1 line
2.47.2
Re: [PATCH v2 2/9] Makefile: suppress Ansible warnings during configuration generation
Quoted 11 lines · Luis Chamberlain
The initial configuration generation playbooks (ansible_cfg.yml, gen_hosts.yml, and gen_nodes.yml) run without a proper inventory file by design, as they are responsible for creating the configuration files that will be used by subsequent playbooks.
This causes Ansible to emit warnings about:
- "No inventory was parsed, only implicit localhost is available"
- "provided hosts list is empty, only localhost is available"These warnings are harmless but create noise in the build output, potentially confusing users who might think something is wrong.
Agree.
Quoted 39 lines
Add ANSIBLE_LOCALHOST_WARNING=False and ANSIBLE_INVENTORY_UNPARSED_WARNING=False environment variables to these three ansible-playbook invocations to suppress these specific warnings. This makes the build output cleaner while maintaining the same functionality.
The warnings were appearing because:
1. ansible_cfg.yml creates the ansible.cfg file
2. gen_hosts.yml creates the hosts inventory file
3. gen_nodes.yml creates thekdevops_nodes.yamlfileAll three intentionally run with "--connection=local" and minimal inventory since they're bootstrapping the configuration that other playbooks will use.
Generated-by Claude AISigned-off-by Luis Chamberlain <[email protected]>--- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)Makefile +2
-1@@ -195,7 +195,8 @@ include scripts/gen-nodes.Makefile false) $(ANSIBLE_CFG_FILE): .config - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ + $(Q)ANSIBLE_LOCALHOST_WARNING=False ANSIBLE_INVENTORY_UNPARSED_WARNING=False \ + ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ --inventory localhost, \ $(KDEVOPS_PLAYBOOKS_DIR)/ansible_cfg.yml \ --extra-vars=@./.extra_vars_auto.yaml@@ -226,13 +227,15 @@ endif DEFAULT_DEPS += $(ANSIBLE_INVENTORY_FILE) $(ANSIBLE_INVENTORY_FILE): .config $(ANSIBLE_CFG_FILE) $(KDEVOPS_HOSTS_TEMPLATE)
Makefile endif · line 237
Quoted 10 lines
Makefile +3
-2- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \ + $(Q)ANSIBLE_LOCALHOST_WARNING=False ANSIBLE_INVENTORY_UNPARSED_WARNING=False \ + ansible-playbook $(ANSIBLE_VERBOSE) \ $(KDEVOPS_PLAYBOOKS_DIR)/gen_hosts.yml \ --extra-vars=@./extra_vars.yaml DEFAULT_DEPS += $(KDEVOPS_NODES) $(KDEVOPS_NODES): .config $(ANSIBLE_CFG_FILE) $(KDEVOPS_NODES_TEMPLATE) - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ + $(Q)ANSIBLE_LOCALHOST_WARNING=False ANSIBLE_INVENTORY_UNPARSED_WARNING=False \
I think at this point we have the inventory file with all guests/hosts and the ansible.cfg. If that is correct I think we may not need to disable ANSIBLE_INVENTORY_UNPARSED_WARNING and ANSIBLE_LOCALHOST_WARNING here. And we can probably remove --connection=local and --inventory localhost, arguments.
Makefile endif · line 241
Quoted 4 lines
Makefile +1
-0+ ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ --inventory localhost, \ $(KDEVOPS_PLAYBOOKS_DIR)/gen_nodes.yml \ --extra-vars=@./extra_vars.yaml
But in general it makes sense to enable these variables only for these specific ansible-playbook invocations. I initially thought we could inject them into the ansible.cfg and wrap ansible-playbook with the new environment, allowing subsequent invocations to leverage that. But we don't want the rest of the ansible-playbook runs to suppress these warnings, in case they do exist, as that would hide errors.
Thanks!
PATCH v2 3/9 playbooks: few space cleanups
In reply to Luis ChamberlainSince we're going to be using bots we sometimes forget to clean up after them. Fix a few minor spacing issues left behind from prior commits.
--- Makefile | 2 +- playbooks/mmtests.yml | 2 +- .../roles/bootlinux/tasks/install-minimal-deps/debian/main.yml | 2 +- playbooks/roles/bootlinux/tasks/install-minimal-deps/main.yml | 2 +- .../roles/bootlinux/tasks/install-minimal-deps/redhat/main.yml | 2 +- .../roles/bootlinux/tasks/install-minimal-deps/suse/main.yml | 2 +- playbooks/roles/mmtests/tasks/install-deps/main.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-)
Makefile +1 -1
@@ -122,7 +122,7 @@ include scripts/krb5.Makefile include scripts/devconfig.Makefile include scripts/ssh.Makefile -ANSIBLE_CMD_KOTD_ENABLE := echo KOTD disabled so not running: +ANSIBLE_CMD_KOTD_ENABLE := echo KOTD disabled so not running: ifeq (y,$(CONFIG_WORKFLOW_KOTD_ENABLE)) include scripts/kotd.Makefile endif # WORKFLOW_KOTD_ENABLE
playbooks/mmtests.yml +1 -1
@@ -1,4 +1,4 @@ --- - hosts: all roles: - - role: mmtests + - role: mmtests
playbooks/roles/bootlinux/tasks/install-minimal-deps/debian/main.yml +1 -1
@@ -16,4 +16,4 @@ - make - gcc - kmod - state: present + state: present
playbooks/roles/bootlinux/tasks/install-minimal-deps/main.yml +1 -1
@@ -12,4 +12,4 @@ - name: Red Hat-specific minimal setup ansible.builtin.import_tasks: redhat/main.yml when: - - ansible_os_family == "RedHat" + - ansible_os_family == "RedHat"
playbooks/roles/bootlinux/tasks/install-minimal-deps/redhat/main.yml +1 -1
@@ -24,4 +24,4 @@ - kmod state: present when: - - ansible_facts['distribution_major_version']|int >= 8 + - ansible_facts['distribution_major_version']|int >= 8
playbooks/roles/bootlinux/tasks/install-minimal-deps/suse/main.yml +1 -1
@@ -10,4 +10,4 @@ - make - gcc - kmod-compat - state: present + state: present
playbooks/roles/mmtests/tasks/install-deps/main.yml +1 -1
@@ -13,4 +13,4 @@ - name: RedHat distribution specific setup import_tasks: tasks/install-deps/redhat/main.yml - when: ansible_facts['os_family']|lower == 'redhat' + when: ansible_facts['os_family']|lower == 'redhat'
Signature · 1 line
2.47.2
PATCH v2 4/9 style: add extensive code formatting checks to make style
In reply to Luis ChamberlainExtend the 'make style' target with comprehensive code formatting and style checks:
1. Add black formatter for Python files - runs 'black .' to check and format all Python files in the repository
2. Add indentation detection for mixed tabs/spaces:
- detect_indentation_issues.py: Detects incorrect indentation based on file type (YAML requires spaces, Makefiles need tabs for recipes, Python prefers spaces)
- fix_indentation_issues.py: Automatically fixes indentation issues
3. Keep existing checks:
- Whitespace issue detection (trailing spaces, missing newlines)
- Commit message format validation
- Ensure all text files end with newlines
The style checks are ordered to run black first as it provides the most comprehensive Python formatting validation. Indentation and whitespace checks default to checking only modified files to avoid being overwhelmed by pre-existing issues.
--- Makefile | 11 +- scripts/detect_indentation_issues.py | 163 +++++++++++++++++++++++++++ scripts/ensure_newlines.py | 75 ++++++++++++ scripts/fix_indentation_issues.py | 152 +++++++++++++++++++++++++ 4 files changed, 399 insertions(+), 2 deletions(-) create mode 100755 scripts/detect_indentation_issues.py create mode 100755 scripts/ensure_newlines.py create mode 100755 scripts/fix_indentation_issues.py
Makefile +9 -2
@@ -247,10 +247,17 @@ include scripts/ci.Makefile include scripts/archive.Makefile include scripts/defconfig.Makefile +PHONY += fix-whitespace-last-commit +fix-whitespace-last-commit: + $(Q)git diff --name-only --diff-filter=M HEAD~1..HEAD | xargs -r python3 scripts/fix_whitespace_issues.py + PHONY += style style: - $(Q)python3 scripts/detect_whitespace_issues.py - $(Q)python3 scripts/check_commit_format.py + $(Q)if which black > /dev/null ; then black . || true; fi + $(Q)python3 scripts/detect_whitespace_issues.py || true + $(Q)python3 scripts/detect_indentation_issues.py || true + $(Q)python3 scripts/check_commit_format.py || true + $(Q)python3 scripts/ensure_newlines.py || true PHONY += clean clean:
scripts/detect_indentation_issues.py new file +163 -0
163 lines not on this page · raw message
scripts/ensure_newlines.py new file +75 -0
75 lines not on this page · raw message
scripts/fix_indentation_issues.py new file +152 -0
152 lines not on this page · raw message
Signature · 1 line
2.47.2
PATCH v2 5/9 Makefile: move styling to scripts/style.Makefile
In reply to Luis ChamberlainMonitoring styling enhancements turn out to be its own thing, move this effort to its own file to keep the top level Makefile tidy.
--- Makefile | 13 +------------ scripts/style.Makefile | 12 ++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 scripts/style.Makefile
Makefile +1 -12
@@ -246,18 +246,7 @@ include scripts/tests.Makefile include scripts/ci.Makefile include scripts/archive.Makefile include scripts/defconfig.Makefile - -PHONY += fix-whitespace-last-commit -fix-whitespace-last-commit: - $(Q)git diff --name-only --diff-filter=M HEAD~1..HEAD | xargs -r python3 scripts/fix_whitespace_issues.py - -PHONY += style -style: - $(Q)if which black > /dev/null ; then black . || true; fi - $(Q)python3 scripts/detect_whitespace_issues.py || true - $(Q)python3 scripts/detect_indentation_issues.py || true - $(Q)python3 scripts/check_commit_format.py || true - $(Q)python3 scripts/ensure_newlines.py || true +include scripts/style.Makefile PHONY += clean clean:
scripts/style.Makefile new file +12 -0
@@ -0,0 +1,12 @@ +PHONY += fix-whitespace-last-commit +fix-whitespace-last-commit: + $(Q)git diff --name-only --diff-filter=M HEAD~1..HEAD | xargs -r python3 scripts/fix_whitespace_issues.py + +PHONY += style +style: + $(Q)if which black > /dev/null ; then black . || true; fi + $(Q)python3 scripts/detect_whitespace_issues.py || true + $(Q)python3 scripts/detect_indentation_issues.py || true + $(Q)python3 scripts/check_commit_format.py || true + $(Q)python3 scripts/ensure_newlines.py || true +
Signature · 1 line
2.47.2
PATCH v2 6/9 CLAUDE.md: add instrucitons to verify commit
In reply to Luis ChamberlainWhite space damange is just a pain with bots, so we need to also give it a separate instruction to verify the commit is not adding new file with space damage.
--- CLAUDE.md | 10 ++++++++++ 1 file changed, 10 insertions(+)
CLAUDE.md +10 -0
@@ -121,6 +121,7 @@ make V=1 [target] # Verbose build output make AV=1-6 [target] # Ansible verbose output (levels 0-6) make dynconfig # Generate dynamic configuration make style # Check for whitespace issues - ALWAYS run before completing work +make fix-whitespace-last-commit # Fixes commit white space damage make mrproper # Clean everything and restart from scratch ```
@@ -428,6 +429,15 @@ The fixer script will: Always run `make style` after using the fixer to verify all issues are resolved. +### Verifying commit has no white space damage + +Run the following after you commit something: +```bash +make fix-whitespace-last-commit +``` + +This will fix all white space only for new files you add. + ## Complex System Interactions kdevops integrates multiple subsystems (Ansible, Kconfig, Git, Make) that often
Signature · 1 line
2.47.2
PATCH v2 7/9 all: run black
In reply to Luis ChamberlainRun black to fix tons of styling issues with tons of Python scripts. In order to help bots ensure they don't add odd styling we need a convention.
--- .../blktests/augment_expunge_list.py | 95 ++-- .../workflows/blktests/gen-expunge-args.py | 46 +- .../workflows/blktests/gen-results-dir.py | 39 +- .../blktests/get_new_expunge_files.py | 16 +- .../dynamic-kconfig/gen-dynamic-pci.py | 89 ++-- .../workflows/fstests/augment_expunge_list.py | 163 +++++-- .../workflows/fstests/bad_files_summary.py | 46 +- .../fstests/fstests-checktime-distribution.py | 46 +- .../workflows/fstests/gen_results_summary.py | 132 +++--- .../fstests/get_new_expunge_files.py | 24 +- playbooks/python/workflows/fstests/lib/git.py | 21 +- .../workflows/fstests/xunit_merge_all.py | 33 +- .../sysbench/sysbench-tps-compare.py | 84 +++- .../workflows/sysbench/sysbench-tps-plot.py | 36 +- .../sysbench/sysbench-tps-variance.py | 435 +++++++++++++----- .../gen_pcie_passthrough_guestfs_xml.py | 49 +- .../linux-mirror/python/gen-mirror-files.py | 131 +++--- .../linux-mirror/python/start-mirroring.py | 116 +++-- scripts/check_commit_format.py | 28 +- .../generation/check_for_atomic_calls.py | 71 +-- .../generation/check_for_sleepy_calls.py | 202 +++++--- scripts/detect_whitespace_issues.py | 38 +- scripts/fix_whitespace_issues.py | 44 +- scripts/generate_refs.py | 6 +- scripts/honey-badger.py | 103 +++-- scripts/spdxcheck.py | 201 ++++---- scripts/update_ssh_config_guestfs.py | 49 +- .../workflows/blktests/blktests_watchdog.py | 75 ++- scripts/workflows/cxl/gen_qemu_cxl.py | 235 +++++++--- scripts/workflows/fstests/fstests_watchdog.py | 99 ++-- scripts/workflows/generic/crash_report.py | 4 +- scripts/workflows/generic/crash_watchdog.py | 78 +++- scripts/workflows/lib/blktests.py | 47 +- scripts/workflows/lib/crash.py | 12 +- scripts/workflows/lib/fstests.py | 155 ++++--- scripts/workflows/lib/kssh.py | 178 ++++--- scripts/workflows/lib/systemd_remote.py | 101 ++-- .../workflows/pynfs/check_pynfs_results.py | 17 +- 38 files changed, 2250 insertions(+), 1094 deletions(-)
playbooks/python/workflows/blktests/augment_expunge_list.py +65 -30
@@ -15,58 +15,81 @@ import configparser from itertools import chain oscheck_ansible_python_dir = os.path.dirname(os.path.abspath(__file__)) -oscheck_sort_expunge = oscheck_ansible_python_dir + "/../../../scripts/workflows/fstests/sort-expunges.sh" +oscheck_sort_expunge = ( + oscheck_ansible_python_dir + "/../../../scripts/workflows/fstests/sort-expunges.sh" +) top_dir = oscheck_ansible_python_dir + "/../../../../" -blktests_last_kernel = top_dir + 'workflows/blktests/results/last-kernel.txt' +blktests_last_kernel = top_dir + "workflows/blktests/results/last-kernel.txt" expunge_name = "failures.txt" + def append_line(output_file, test_failure_line): # We want to now add entries like block/xxx where xxx are digits output = open(output_file, "a+") output.write("%s\n" % test_failure_line) output.close() + def is_config_bool_true(config, name): - if name in config and config[name].strip('\"') == "y": + if name in config and config[name].strip('"') == "y": return True return False + def config_string(config, name): if name in config: - return config[name].strip('\"') + return config[name].strip('"') return None + def get_config(dotconfig): - config = configparser.ConfigParser(allow_no_value=True, strict=False, interpolation=None) + config = configparser.ConfigParser( + allow_no_value=True, strict=False, interpolation=None + ) with open(dotconfig) as lines: lines = chain(("[top]",), lines) config.read_file(lines) return config["top"] return None + def read_blktest_last_kernel(): if not os.path.isfile(blktests_last_kernel): return None - kfile = open(blktests_last_kernel, 'r') + kfile = open(blktests_last_kernel, "r") all_lines = kfile.readlines() kfile.close() for line in all_lines: return line.strip() return None + def main(): - parser = argparse.ArgumentParser(description='Augments expunge list for blktest') - parser.add_argument('results', metavar='<directory with results>', type=str, - help='directory with results file') - parser.add_argument('outputdir', metavar='<output directory>', type=str, - help='The directory where to generate the expunge failure.txt ') - parser.add_argument('--verbose', const=True, default=False, action="store_const", - help='Print more verbose information') + parser = argparse.ArgumentParser(description="Augments expunge list for blktest") + parser.add_argument( + "results", + metavar="<directory with results>", + type=str, + help="directory with results file", + ) + parser.add_argument( + "outputdir", + metavar="<output directory>", + type=str, + help="The directory where to generate the expunge failure.txt ", + ) + parser.add_argument( + "--verbose", + const=True, + default=False, + action="store_const", + help="Print more verbose information", + ) args = parser.parse_args() expunge_kernel_dir = "" - dotconfig = top_dir + '/.config' + dotconfig = top_dir + "/.config" config = get_config(dotconfig) if not config: sys.stdout.write("%s does not exist\n" % (dotconfig))
@@ -85,7 +108,7 @@ def main(): continue if not os.path.isfile(f): continue - if not f.endswith('.bad') and not f.endswith('.dmesg'): + if not f.endswith(".bad") and not f.endswith(".dmesg"): continue bad_files.append(f)
@@ -97,13 +120,13 @@ def main(): # f may be results/last-run/nodev/meta/009.dmesg bad_file_list = f.split("/") bad_file_list_len = len(bad_file_list) - 1 - bad_file = bad_file_list[bad_file_list_len] - test_group = bad_file_list[bad_file_list_len-1] - bdev = bad_file_list[bad_file_list_len-2] + bad_file = bad_file_list[bad_file_list_len] + test_group = bad_file_list[bad_file_list_len - 1] + bdev = bad_file_list[bad_file_list_len - 2] if args.verbose: sys.stdout.write("%s\n" % bad_file_list) - sys.stdout.write("\tbad_file: %s\n" %bad_file) + sys.stdout.write("\tbad_file: %s\n" % bad_file) sys.stdout.write("\ttest_group: %s\n" % test_group) sys.stdout.write("\tkernel: %s\n" % kernel)
@@ -126,11 +149,11 @@ def main(): sys.exit(1) # This is like for example block/xxx where xxx are digits - test_failure_line = test_group + '/' + bad_file_test_number + test_failure_line = test_group + "/" + bad_file_test_number # now to stuff this into expunge files such as: # expunges/sles/15.3/failures.txt - expunge_kernel_dir = args.outputdir + '/' + kernel + '/' + expunge_kernel_dir = args.outputdir + "/" + kernel + "/" output_dir = expunge_kernel_dir output_file = output_dir + expunge_name shortcut_kernel_dir = None
@@ -145,19 +168,23 @@ def main(): sles_release_name = config_string(config, "CONFIG_KDEVOPS_HOSTS_PREFIX") sles_release_parts = sles_release_name.split("sp") if len(sles_release_parts) <= 1: - sys.stderr.write("Unexpected sles_release_name: %s\n" % sles_release_name) + sys.stderr.write( + "Unexpected sles_release_name: %s\n" % sles_release_name + ) sys.exit(1) - sles_point_release = sles_release_parts[0].split("sles")[1] + "." + sles_release_parts[1] + sles_point_release = ( + sles_release_parts[0].split("sles")[1] + "." + sles_release_parts[1] + ) # This becomes generic release directory, not specific to any # kernel. - shortcut_dir = args.outputdir + '/' + "sles/" + sles_point_release + '/' + shortcut_dir = args.outputdir + "/" + "sles/" + sles_point_release + "/" shortcut_kernel_dir = shortcut_dir shortcut_file = shortcut_dir + expunge_name else: ksplit = kernel.split(".") shortcut_kernel = ksplit[0] + "." + ksplit[1] + "." + ksplit[2] - shortcut_kernel_dir = args.outputdir + '/' + shortcut_kernel + '/' + shortcut_kernel_dir = args.outputdir + "/" + shortcut_kernel + "/" shortcut_dir = shortcut_kernel_dir shortcut_file = shortcut_dir + expunge_name
@@ -170,10 +197,13 @@ def main(): os.makedirs(output_dir) if not os.path.isfile(output_file): - sys.stdout.write("====%s/%s new failure found file was empty\n" % (test_group, test_failure_line)) + sys.stdout.write( + "====%s/%s new failure found file was empty\n" + % (test_group, test_failure_line) + ) append_line(output_file, test_failure_line) else: - existing_file = open(output_file, 'r') + existing_file = open(output_file, "r") all_lines = existing_file.readlines() existing_file.close() found = False
@@ -182,13 +212,18 @@ def main(): found = True break if not found: - sys.stdout.write("%s %s new failure found\n" % (test_group, test_failure_line)) + sys.stdout.write( + "%s %s new failure found\n" % (test_group, test_failure_line) + ) append_line(output_file, test_failure_line) if expunge_kernel_dir != "": sys.stdout.write("Sorting %s ...\n" % (expunge_kernel_dir)) - sys.stdout.write("Running %s %s...\n" % (oscheck_sort_expunge, expunge_kernel_dir)) + sys.stdout.write( + "Running %s %s...\n" % (oscheck_sort_expunge, expunge_kernel_dir) + ) subprocess.call([oscheck_sort_expunge, expunge_kernel_dir]) -if __name__ == '__main__': + +if __name__ == "__main__": main()
playbooks/python/workflows/blktests/gen-expunge-args.py +34 -12
69 lines not on this page · raw message
playbooks/python/workflows/blktests/gen-results-dir.py +27 -12
@@ -18,7 +18,8 @@ oscheck_ansible_python_dir = os.path.dirname(os.path.abspath(__file__)) top_dir = oscheck_ansible_python_dir + "/../../../../" results_dir = top_dir + "workflows/blktests/results/" last_run_dir = results_dir + "last-run/" -blktests_last_kernel = top_dir + 'workflows/blktests/results/last-kernel.txt' +blktests_last_kernel = top_dir + "workflows/blktests/results/last-kernel.txt" + def clean_empty_dir(target_results): for i in range(1, 3):
@@ -31,12 +32,23 @@ def clean_empty_dir(target_results): else: clean_empty_dir(f) + def main(): - parser = argparse.ArgumentParser(description='Get list of expunge files not yet committed in git') - parser.add_argument('--clean-dir-only', metavar='<clean_dir_only>', type=str, default='none', - help='Do not perform an evaluation, just clean empty directories on the specified directory') - parser.add_argument('--copy-all', action='store_true', - help='Copy all test results without filtering') + parser = argparse.ArgumentParser( + description="Get list of expunge files not yet committed in git" + ) + parser.add_argument( + "--clean-dir-only", + metavar="<clean_dir_only>", + type=str, + default="none", + help="Do not perform an evaluation, just clean empty directories on the specified directory", + ) + parser.add_argument( + "--copy-all", + action="store_true", + help="Copy all test results without filtering", + ) args = parser.parse_args() if not os.path.isfile(blktests_last_kernel):
@@ -44,7 +56,7 @@ def main(): sys.exit(1) kernel = None - f = open(blktests_last_kernel, 'r') + f = open(blktests_last_kernel, "r") for line in f: kernel = line.strip() if not line:
@@ -56,9 +68,11 @@ def main(): clean_empty_dir(args.clean_dir_only) sys.exit(0) - target_results = results_dir + kernel + '/' + target_results = results_dir + kernel + "/" if not os.path.isdir(last_run_dir): - sys.stdout.write("Ignoring last-run directory %s as it is empty ...\n" % (last_run_dir)) + sys.stdout.write( + "Ignoring last-run directory %s as it is empty ...\n" % (last_run_dir) + ) sys.exit(0) sys.stdout.write("Copying %s to %s ...\n" % (last_run_dir, target_results)) copytree(last_run_dir, target_results, dirs_exist_ok=True)
@@ -89,8 +103,8 @@ def main(): test_name = test_name_file_list[0] test_dir = os.path.dirname(f) - name_lookup_base = test_dir + '/' + test_name + '*' - name_lookup = test_dir + '/' + test_name + '.*' + name_lookup_base = test_dir + "/" + test_name + "*" + name_lookup = test_dir + "/" + test_name + ".*" listing = glob.glob(name_lookup) bad_ext_found = False if len(listing) > 0:
@@ -102,5 +116,6 @@ def main(): os.unlink(r) clean_empty_dir(target_results) -if __name__ == '__main__': + +if __name__ == "__main__": main()
playbooks/python/workflows/blktests/get_new_expunge_files.py +12 -4
@@ -14,10 +14,17 @@ import sys import subprocess from lib import git + def main(): - parser = argparse.ArgumentParser(description='Get list of expunge files not yet committed in git') - parser.add_argument('expunge_dir', metavar='<directory with expunge files>', type=str, - help='directory with expunge files') + parser = argparse.ArgumentParser( + description="Get list of expunge files not yet committed in git" + ) + parser.add_argument( + "expunge_dir", + metavar="<directory with expunge files>", + type=str, + help="directory with expunge files", + ) args = parser.parse_args() block_expunge_dir = args.expunge_dir
@@ -36,5 +43,6 @@ def main(): short_file = f.split("../")[1] sys.stdout.write("%s\n" % (short_file)) -if __name__ == '__main__': + +if __name__ == "__main__": main()
playbooks/python/workflows/dynamic-kconfig/gen-dynamic-pci.py +60 -29
201 lines not on this page · raw message
playbooks/python/workflows/fstests/augment_expunge_list.py +114 -49
276 lines not on this page · raw message
playbooks/python/workflows/fstests/bad_files_summary.py +31 -15
90 lines not on this page · raw message
playbooks/python/workflows/fstests/fstests-checktime-distribution.py +29 -17
88 lines not on this page · raw message
playbooks/python/workflows/fstests/gen_results_summary.py +77 -55
271 lines not on this page · raw message
playbooks/python/workflows/fstests/get_new_expunge_files.py +18 -6
@@ -14,12 +14,23 @@ import sys import subprocess from lib import git + def main(): - parser = argparse.ArgumentParser(description='Get list of expunge files not yet committed in git') - parser.add_argument('filesystem', metavar='<filesystem name>', type=str, - help='filesystem which was tested') - parser.add_argument('expunge_dir', metavar='<directory with expunge files>', type=str, - help='directory with expunge files') + parser = argparse.ArgumentParser( + description="Get list of expunge files not yet committed in git" + ) + parser.add_argument( + "filesystem", + metavar="<filesystem name>", + type=str, + help="filesystem which was tested", + ) + parser.add_argument( + "expunge_dir", + metavar="<directory with expunge files>", + type=str, + help="directory with expunge files", + ) args = parser.parse_args() fs_expunge_dir = args.expunge_dir
@@ -41,5 +52,6 @@ def main(): short_file = f.split("../")[1] sys.stdout.write("%s\n" % (short_file)) -if __name__ == '__main__': + +if __name__ == "__main__": main()
playbooks/python/workflows/fstests/lib/git.py +16 -5
@@ -2,25 +2,36 @@ import subprocess, os + class GitError(Exception): pass + + class ExecutionError(GitError): def __init__(self, errcode): self.error_code = errcode + + class TimeoutExpired(GitError): def __init__(self, errcode): self.error_code = errcode return "timeout" + def _check(process): if process.returncode != 0: raise ExecutionError(process.returncode) + def is_new_file(file): - cmd = ['git', 'status', '-s', file ] - process = subprocess.Popen(cmd, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT, - close_fds=True, universal_newlines=True) + cmd = ["git", "status", "-s", file] + process = subprocess.Popen( + cmd, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + close_fds=True, + universal_newlines=True, + ) data = None try: data = process.communicate(timeout=1)
@@ -31,6 +42,6 @@ def is_new_file(file): process.wait() if process.returncode != 0: return False - if stdout.startswith('??'): + if stdout.startswith("??"): return True return False
playbooks/python/workflows/fstests/xunit_merge_all.py +24 -9
@@ -11,6 +11,7 @@ import os import sys from junitparser import JUnitXml, TestSuite + def get_test_suite(filename): try: ts = JUnitXml.fromfile(filename)
@@ -18,21 +19,31 @@ def get_test_suite(filename): sys.exit("Couldn't open %s: %s" % (filename, e[1])) if type(ts) != TestSuite: - sys.exit('%s is not a xUnit report file' % filename) + sys.exit("%s is not a xUnit report file" % filename) return ts + def merge_ts(old_ts, new_ts): for tc in new_ts: old_ts.add_testcase(tc) old_ts.update_statistics() return old_ts + def main(): - parser = argparse.ArgumentParser(description='Merge all xunit files into one') - parser.add_argument('results', metavar='<directory with results>', type=str, - help='directory with results file') - parser.add_argument('outputfile', metavar='<output file>', type=str, - help='The file to generate output to') + parser = argparse.ArgumentParser(description="Merge all xunit files into one") + parser.add_argument( + "results", + metavar="<directory with results>", + type=str, + help="directory with results file", + ) + parser.add_argument( + "outputfile", + metavar="<output file>", + type=str, + help="The file to generate output to", + ) args = parser.parse_args() all_xunit_ts = None
@@ -46,7 +57,7 @@ def main(): continue if not os.path.isfile(f): continue - if not f.endswith('.xml'): + if not f.endswith(".xml"): continue sys.stdout.write("Processing %s ...\n" % f)
@@ -60,7 +71,11 @@ def main(): if all_xunit_ts: all_xunit_ts.write(args.outputfile) - sys.stdout.write("%s generated by merging all the above %d xunit files successfully\n" % (args.outputfile, num)) + sys.stdout.write( + "%s generated by merging all the above %d xunit files successfully\n" + % (args.outputfile, num) + ) + -if __name__ == '__main__': +if __name__ == "__main__": main()
playbooks/python/workflows/sysbench/sysbench-tps-compare.py +62 -22
140 lines not on this page · raw message
playbooks/python/workflows/sysbench/sysbench-tps-plot.py +24 -12
@@ -9,27 +9,38 @@ import re import argparse from concurrent.futures import ThreadPoolExecutor + # Function to parse a line and extract time and TPS from text def parse_line(line): - match = re.search(r'\[\s*(\d+)s\s*\].*?tps:\s*([\d.]+)', line) + match = re.search(r"\[\s*(\d+)s\s*\].*?tps:\s*([\d.]+)", line) if match: time_in_seconds = int(match.group(1)) tps = float(match.group(2)) return time_in_seconds, tps return None + def main(): # Setup argument parser - parser = argparse.ArgumentParser(description="Generate TPS plot from sysbench output") - parser.add_argument('input_file', type=str, help="Path to the input file (text or JSON)") - parser.add_argument('--output', type=str, default='tps_over_time.png', help="Output image file (default: tps_over_time.png)") + parser = argparse.ArgumentParser( + description="Generate TPS plot from sysbench output" + ) + parser.add_argument( + "input_file", type=str, help="Path to the input file (text or JSON)" + ) + parser.add_argument( + "--output", + type=str, + default="tps_over_time.png", + help="Output image file (default: tps_over_time.png)", + ) # Parse arguments args = parser.parse_args() # Read the input file try: - with open(args.input_file, 'r') as file: + with open(args.input_file, "r") as file: # Read text lines and parse them concurrently lines = file.readlines() with ThreadPoolExecutor() as executor:
@@ -51,19 +62,19 @@ def main(): # Convert times if necessary if use_hours: tps_data = [(time / 3600, tps) for time, tps in tps_data] - time_label = 'Time (hours)' + time_label = "Time (hours)" else: - time_label = 'Time (seconds)' + time_label = "Time (seconds)" # Create a pandas DataFrame - df = pd.DataFrame(tps_data, columns=[time_label, 'TPS']) + df = pd.DataFrame(tps_data, columns=[time_label, "TPS"]) # Plot the TPS values plt.figure(figsize=(30, 12)) - plt.plot(df[time_label], df['TPS'], 'o', markersize=2) - plt.title('Transactions Per Second (TPS) Over Time') + plt.plot(df[time_label], df["TPS"], "o", markersize=2) + plt.title("Transactions Per Second (TPS) Over Time") plt.xlabel(time_label) - plt.ylabel('TPS') + plt.ylabel("TPS") plt.grid(True) plt.ylim(0) plt.tight_layout()
@@ -72,5 +83,6 @@ def main(): plt.savefig(args.output) print(f"TPS plot saved to {args.output}") -if __name__ == '__main__': + +if __name__ == "__main__": main()
playbooks/python/workflows/sysbench/sysbench-tps-variance.py +318 -117
560 lines not on this page · raw message
playbooks/roles/gen_nodes/python/gen_pcie_passthrough_guestfs_xml.py +31 -18
78 lines not on this page · raw message
playbooks/roles/linux-mirror/python/gen-mirror-files.py +79 -52
193 lines not on this page · raw message
playbooks/roles/linux-mirror/python/start-mirroring.py +69 -47
172 lines not on this page · raw message
scripts/check_commit_format.py +20 -8
@@ -11,11 +11,16 @@ import subprocess import sys import re + def get_latest_commit_message(): """Get the latest commit message""" try: - result = subprocess.run(['git', 'log', '-1', '--pretty=format:%B'], - capture_output=True, text=True, check=True) + result = subprocess.run( + ["git", "log", "-1", "--pretty=format:%B"], + capture_output=True, + text=True, + check=True, + ) return result.stdout except subprocess.CalledProcessError: print("Error: Failed to get commit message")
@@ -24,30 +29,35 @@ def get_latest_commit_message(): print("Error: git command not found") return None + def check_commit_format(commit_msg): """Check commit message formatting""" issues = [] if not commit_msg: return ["No commit message found"] - lines = commit_msg.strip().split('\n') + lines = commit_msg.strip().split("\n") # Find Generated-by line generated_by_idx = None signed_off_by_idx = None for i, line in enumerate(lines): - if line.startswith('Generated-by: Claude AI'): + if line.startswith("Generated-by: Claude AI"): generated_by_idx = i - elif line.startswith('Signed-off-by:'): + elif line.startswith("Signed-off-by:"): signed_off_by_idx = i # If Generated-by is present, check formatting if generated_by_idx is not None: if signed_off_by_idx is None: - issues.append("Generated-by: Claude AI found but no Signed-off-by tag present") + issues.append( + "Generated-by: Claude AI found but no Signed-off-by tag present" + ) else: # Check if Generated-by is immediately followed by Signed-off-by (no lines in between) if signed_off_by_idx != generated_by_idx + 1: lines_between = signed_off_by_idx - generated_by_idx - 1 if lines_between > 0: - issues.append(f"Generated-by: Claude AI must be immediately followed by Signed-off-by (found {lines_between} lines between them)") + issues.append( + f"Generated-by: Claude AI must be immediately followed by Signed-off-by (found {lines_between} lines between them)" + ) for i in range(generated_by_idx + 1, signed_off_by_idx): if lines[i].strip(): issues.append(f" - Non-empty line at {i+1}: '{lines[i]}'")
@@ -55,6 +65,7 @@ def check_commit_format(commit_msg): issues.append(f" - Empty line at {i+1}") return issues + def main(): """Main function to check commit message format""" commit_msg = get_latest_commit_message()
@@ -81,5 +92,6 @@ def main(): print("✅ Commit message formatting is correct!") return 0 -if __name__ == '__main__': + +if __name__ == "__main__": sys.exit(main())
scripts/coccinelle/generation/check_for_atomic_calls.py +45 -26
168 lines not on this page · raw message
scripts/coccinelle/generation/check_for_sleepy_calls.py +140 -62
102 lines not on this page · raw message
scripts/fix_whitespace_issues.py +26 -18
44 lines not on this page · raw message
scripts/honey-badger.py +75 -28
103 lines not on this page · raw message
scripts/spdxcheck.py +119 -82
201 lines not on this page · raw message
scripts/update_ssh_config_guestfs.py +32 -17
49 lines not on this page · raw message
scripts/workflows/blktests/blktests_watchdog.py +59 -16
75 lines not on this page · raw message
scripts/workflows/cxl/gen_qemu_cxl.py +167 -68
235 lines not on this page · raw message
scripts/workflows/fstests/fstests_watchdog.py +68 -31
99 lines not on this page · raw message
scripts/workflows/generic/crash_report.py +3 -1
Lines of this file are not shown. View the raw message.
scripts/workflows/generic/crash_watchdog.py +58 -20
78 lines not on this page · raw message
scripts/workflows/lib/blktests.py +34 -13
47 lines not on this page · raw message
scripts/workflows/lib/fstests.py +93 -62
155 lines not on this page · raw message
scripts/workflows/lib/kssh.py +123 -55
178 lines not on this page · raw message
scripts/workflows/lib/systemd_remote.py +54 -47
101 lines not on this page · raw message
scripts/workflows/pynfs/check_pynfs_results.py +9 -8
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.47.2
Part of the diff is not shown here. View the raw message.
Re: [PATCH v2 7/9] all: run black
Quoted 5 lines · Luis Chamberlain
Run black to fix tons of styling issues with tons of Python scripts. In order to help bots ensure they don't add odd styling we need a convention.
Signed-off-by Luis Chamberlain <[email protected]>
FYI, I'm working on b4 check stuff mentioned in the other thread. I think this is really nice but it would be awesome to also extend it to Ansible files using the Ansible linter:
ansible-lint --help
{...}
--fix [WRITE_LIST] Allow ansible-lint to perform auto-fixes, including YAML
reformatting
So, these changes with black/ansible-lint, etc make sense if:
1. Add b4 integration
2. Make CI run the scripts as well (make style, make check, etc)
But I suspect a minimal testing may be needed.
Thoughts?
Re: [PATCH v2 7/9] all: run black
Quoted 18 lines · Daniel Gomez
Quoted 5 lines · Luis Chamberlain
Run black to fix tons of styling issues with tons of Python scripts. In order to help bots ensure they don't add odd styling we need a convention.
Signed-off-by Luis Chamberlain <[email protected]>Acked-by Daniel Gomez <[email protected]>FYI, I'm working on b4 check stuff mentioned in the other thread. I think this is really nice but it would be awesome to also extend it to Ansible files using the Ansible linter:
ansible-lint --help
{...}
--fix [WRITE_LIST] Allow ansible-lint to perform auto-fixes, including YAML
reformatting
Quoted 7 lines
So, these changes with black/ansible-lint, etc make sense if:
1. Add b4 integration
2. Make CI run the scripts as well (make style, make check, etc)But I suspect a minimal testing may be needed.
Thoughts?
I'll send an RFC with more details.
Re: [PATCH v2 7/9] all: run black
Quoted 12 lines · Daniel Gomez
Quoted 9 lines · Daniel Gomez
Quoted 5 lines · Luis Chamberlain
Run black to fix tons of styling issues with tons of Python scripts. In order to help bots ensure they don't add odd styling we need a convention.
Signed-off-by Luis Chamberlain <[email protected]>Acked-by Daniel Gomez <[email protected]>
Quoted 8 lines
Quoted 8 lines
FYI, I'm working on b4 check stuff mentioned in the other thread. I think this is really nice but it would be awesome to also extend it to Ansible files using the Ansible linter:
ansible-lint --help
{...}
--fix [WRITE_LIST] Allow ansible-lint to perform auto-fixes, including YAML
reformatting
I use ansible-lint extensively before commit. Linting existing kdevops files is still a bit of jungle, so ansible-lint would have to be directed only at new files.
Quoted 9 lines
Quoted 7 lines
So, these changes with black/ansible-lint, etc make sense if:
1. Add b4 integration
2. Make CI run the scripts as well (make style, make check, etc)But I suspect a minimal testing may be needed.
Thoughts?
I'll send an RFC with more details.
Signature · 1 line
Chuck Lever
Re: [PATCH v2 7/9] all: run black
Quoted 17 lines · Chuck Lever
Quoted 16 lines · Daniel Gomez
Quoted 13 lines · Daniel Gomez
Quoted 5 lines · Luis Chamberlain
Run black to fix tons of styling issues with tons of Python scripts. In order to help bots ensure they don't add odd styling we need a convention.
Signed-off-by Luis Chamberlain <[email protected]>Acked-by Daniel Gomez <[email protected]>FYI, I'm working on b4 check stuff mentioned in the other thread. I think this is really nice but it would be awesome to also extend it to Ansible files using the Ansible linter:
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
ansible-lint --help
{...}
--fix [WRITE_LIST] Allow ansible-lint to perform auto-fixes, including YAML
reformattingI use ansible-lint extensively before commit. Linting existing kdevops files is still a bit of jungle, so ansible-lint would have to be directed only at new files.
It's wild. I've sent an RFC with this:
git show --shortstat HEAD
234 files changed, 5308 insertions(+), 5098 deletions(-)
git show HEAD | grep -c '^@@'
735
Hopefully this will raise a bit the bar with the format. Next challenge is to try to keep it.
Quoted 12 lines
Quoted 11 lines
Quoted 9 lines
So, these changes with black/ansible-lint, etc make sense if:
1. Add b4 integration
2. Make CI run the scripts as well (make style, make check, etc)But I suspect a minimal testing may be needed.
Thoughts?
I'll send an RFC with more details.
Re: [PATCH v2 7/9] all: run black
Quoted 31 lines · Daniel Gomez
Quoted 17 lines · Chuck Lever
Quoted 16 lines · Daniel Gomez
Quoted 13 lines · Daniel Gomez
Quoted 5 lines · Luis Chamberlain
Run black to fix tons of styling issues with tons of Python scripts. In order to help bots ensure they don't add odd styling we need a convention.
Signed-off-by Luis Chamberlain <[email protected]>Acked-by Daniel Gomez <[email protected]>FYI, I'm working on b4 check stuff mentioned in the other thread. I think this is really nice but it would be awesome to also extend it to Ansible files using the Ansible linter:
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
ansible-lint --help
{...}
--fix [WRITE_LIST] Allow ansible-lint to perform auto-fixes, including YAML
reformattingI use ansible-lint extensively before commit. Linting existing kdevops files is still a bit of jungle, so ansible-lint would have to be directed only at new files.
It's wild. I've sent an RFC with this:
Quoted 7 lines
git show --shortstat HEAD
234 files changed, 5308 insertions(+), 5098 deletions(-)git show HEAD | grep -c '^@@'
735Hopefully this will raise a bit the bar with the format. Next challenge is to try to keep it.
I generally try to fix things up as I encounter lint complaints, as I am a fan of static analysis. Even though the "actual positive" rate can be low, some discovered issues have been significant, IME.
However, there is risk in making changes when static checkers throw warnings. Not infrequently, an otherwise innocent clean-up can result in unintended behavior changes. So I try to keep the churn to a minimum and test thoroughly.
There have been several enormous patch series that have come through in the past week; difficult to review all of that. Even though tools like Claude and black can generate a very high quantity of patches, there's nothing that guarantees these are quality changes. I would like to see things slow down a little so us humans can have a chance to paw through them.
So +1 on the use of lint tools! But also let's tread carefully.
Quoted 11 lines
Quoted 10 lines
Quoted 9 lines
Quoted 7 lines
So, these changes with black/ansible-lint, etc make sense if:
1. Add b4 integration
2. Make CI run the scripts as well (make style, make check, etc)But I suspect a minimal testing may be needed.
Thoughts?
I'll send an RFC with more details.
Signature · 1 line
Chuck Lever
PATCH v2 8/9 devconfig: add automatic APT mirror fallback for Debian testing
In reply to Luis ChamberlainDebian testing (trixie) VMs can fail to provision when configured APT mirrors become unavailable or unresponsive. This is particularly common with local or regional mirrors that may have intermittent connectivity issues.
This fix adds automatic mirror health checking specifically for Debian testing systems. The implementation:
1. Extracts the currently configured APT mirror hostname
2. Tests connectivity to the mirror on port 80 with a 10 second timeout
3. Falls back to official Debian mirrors if the test fails
4. Backs up the original sources.list before making changes
5. Updates the APT cache after switching mirrors
6. Provides clear user notification about the fallback
The check only runs on Debian testing systems where devconfig_debian_testing is set to true, avoiding any impact on stable Debian or other distributions.
This ensures that Debian testing VMs can successfully provision even when the initially configured mirror is unavailable, improving reliability for development and testing workflows.
--- .../devconfig/tasks/check-apt-mirrors.yml | 63 +++++++++++++++++++ playbooks/roles/devconfig/tasks/main.yml | 8 +++ .../debian-testing-fallback-sources.list | 10 +++ 3 files changed, 81 insertions(+) create mode 100644 playbooks/roles/devconfig/tasks/check-apt-mirrors.yml create mode 100644 playbooks/roles/devconfig/templates/debian-testing-fallback-sources.list
playbooks/roles/devconfig/tasks/check-apt-mirrors.yml new file +63 -0
@@ -0,0 +1,63 @@ +--- +# Only run mirror checks for Debian testing (trixie) where mirror issues are common +- name: Extract current APT mirror hostname + shell: | + grep -E "^deb\s+http" /etc/apt/sources.list | head -1 | awk '{print $2}' | sed 's|http://||' | cut -d'/' -f1 + register: apt_mirror_host + changed_when: false + ignore_errors: yes + +- name: Check connectivity to current APT mirror + wait_for: + host: "{{ apt_mirror_host.stdout }}" + port: 80 + timeout: 10 + register: mirror_connectivity + ignore_errors: yes + when: apt_mirror_host.stdout != "" + +- name: Display mirror check results + debug: + msg: | + Current APT mirror: {{ apt_mirror_host.stdout | default('Not found') }} + Mirror connectivity: {{ 'OK' if mirror_connectivity is not failed else 'FAILED' }} + when: apt_mirror_host.stdout != "" + +- name: Fall back to official Debian mirrors if current mirror fails + block: + - name: Backup current sources.list + copy: + src: /etc/apt/sources.list + dest: /etc/apt/sources.list.backup + remote_src: yes + become: yes + + - name: Apply Debian testing fallback sources + template: + src: debian-testing-fallback-sources.list + dest: /etc/apt/sources.list + owner: root + group: root + mode: '0644' + become: yes + + - name: Update APT cache after mirror change + apt: + update_cache: yes + cache_valid_time: 0 + become: yes + + - name: Inform user about mirror fallback + debug: + msg: | + WARNING: The configured APT mirror '{{ apt_mirror_host.stdout }}' is not accessible. + Falling back to official Debian testing mirrors: + - deb.debian.org for main packages + - security.debian.org for security updates + + This may result in slower package downloads depending on your location. + Consider configuring a local mirror for better performance. + + when: + - apt_mirror_host.stdout != "" + - mirror_connectivity is failed
playbooks/roles/devconfig/tasks/main.yml +8 -0
@@ -30,6 +30,14 @@ tags: hostname # Distro specific + +# Check and fix APT mirrors for Debian testing before installing dependencies +- name: Check and fix APT mirrors for Debian testing + include_tasks: check-apt-mirrors.yml + when: + - devconfig_debian_testing is defined + - devconfig_debian_testing | bool + - name: Install dependencies ansible.builtin.include_tasks: install-deps/main.yml tags: ['vars', 'vars_simple']
playbooks/roles/devconfig/templates/debian-testing-fallback-sources.list new file +10 -0
@@ -0,0 +1,10 @@ +deb http://deb.debian.org/debian testing main contrib non-free non-free-firmware +deb-src http://deb.debian.org/debian testing main contrib non-free non-free-firmware + +# Security updates +deb http://security.debian.org/debian-security testing-security main contrib non-free non-free-firmware +deb-src http://security.debian.org/debian-security testing-security main contrib non-free non-free-firmware + +# Updates (if available for testing) +deb http://deb.debian.org/debian testing-updates main contrib non-free non-free-firmware +deb-src http://deb.debian.org/debian testing-updates main contrib non-free non-free-firmware
Signature · 1 line
2.47.2
Re: [PATCH v2 8/9] devconfig: add automatic APT mirror fallback for Debian testing
Quoted 127 lines · Luis Chamberlain
Debian testing (trixie) VMs can fail to provision when configured APT mirrors become unavailable or unresponsive. This is particularly common with local or regional mirrors that may have intermittent connectivity issues.
This fix adds automatic mirror health checking specifically for Debian testing systems. The implementation:
1. Extracts the currently configured APT mirror hostname
2. Tests connectivity to the mirror on port 80 with a 10 second timeout
3. Falls back to official Debian mirrors if the test fails
4. Backs up the original sources.list before making changes
5. Updates the APT cache after switching mirrors
6. Provides clear user notification about the fallbackThe check only runs on Debian testing systems where
devconfig_debian_testingis set to true, avoiding any impact on stable Debian or other distributions.This ensures that Debian testing VMs can successfully provision even when the initially configured mirror is unavailable, improving reliability for development and testing workflows.
Generated-by Claude AISigned-off-by Luis Chamberlain <[email protected]>--- .../devconfig/tasks/check-apt-mirrors.yml | 63 +++++++++++++++++++ playbooks/roles/devconfig/tasks/main.yml | 8 +++ .../debian-testing-fallback-sources.list | 10 +++ 3 files changed, 81 insertions(+) create mode 100644 playbooks/roles/devconfig/tasks/check-apt-mirrors.yml create mode 100644 playbooks/roles/devconfig/templates/debian-testing-fallback-sources.listplaybooks/roles/devconfig/tasks/check-apt-mirrors.yml new file +63
-0@@ -0,0 +1,63 @@ +--- +# Only run mirror checks for Debian testing (trixie) where mirror issues are common +- name: Extract current APT mirror hostname + shell: | + grep -E "^deb\s+http" /etc/apt/sources.list | head -1 | awk '{print $2}' | sed 's|http://||' | cut -d'/' -f1 + register: apt_mirror_host + changed_when: false + ignore_errors: yes + +- name: Check connectivity to current APT mirror + wait_for: + host: "{{ apt_mirror_host.stdout }}" + port: 80 + timeout: 10 + register: mirror_connectivity + ignore_errors: yes + when: apt_mirror_host.stdout != "" + +- name: Display mirror check results + debug: + msg: | + Current APT mirror: {{ apt_mirror_host.stdout | default('Not found') }} + Mirror connectivity: {{ 'OK' if mirror_connectivity is not failed else 'FAILED' }} + when: apt_mirror_host.stdout != "" + +- name: Fall back to official Debian mirrors if current mirror fails + block: + - name: Backup current sources.list + copy: + src: /etc/apt/sources.list + dest: /etc/apt/sources.list.backup + remote_src: yes + become: yes + + - name: Apply Debian testing fallback sources + template: + src: debian-testing-fallback-sources.list + dest: /etc/apt/sources.list + owner: root + group: root + mode: '0644' + become: yes + + - name: Update APT cache after mirror change + apt: + update_cache: yes + cache_valid_time: 0 + become: yes + + - name: Inform user about mirror fallback + debug: + msg: | + WARNING: The configured APT mirror '{{ apt_mirror_host.stdout }}' is not accessible. + Falling back to official Debian testing mirrors: + - deb.debian.org for main packages + - security.debian.org for security updates + + This may result in slower package downloads depending on your location. + Consider configuring a local mirror for better performance. + + when: + - apt_mirror_host.stdout != "" + - mirror_connectivity is failedplaybooks/roles/devconfig/tasks/main.yml +8
-0@@ -30,6 +30,14 @@ tags: hostname # Distro specific + +# Check and fix APT mirrors for Debian testing before installing dependencies +- name: Check and fix APT mirrors for Debian testing + include_tasks: check-apt-mirrors.yml + when: + - devconfig_debian_testing is defined + - devconfig_debian_testing | bool + - name: Install dependencies ansible.builtin.include_tasks: install-deps/main.yml tags: ['vars', 'vars_simple']playbooks/roles/devconfig/templates/debian-testing-fallback-sources.list new file +1
-0@@ -0,0 +1,10 @@ +deb http://deb.debian.org/debian testing main contrib non-free non-free-firmware
playbooks/roles/devconfig/templates/debian-testing-fallback-sources.list line 10
Quoted 10 lines
playbooks/roles/devconfig/templates/debian-testing-fallback-sources.list new file +9
-0+deb-src http://deb.debian.org/debian testing main contrib non-free non-free-firmware + +# Security updates +deb http://security.debian.org/debian-security testing-security main contrib non-free non-free-firmware +deb-src http://security.debian.org/debian-security testing-security main contrib non-free non-free-firmware + +# Updates (if available for testing) +deb http://deb.debian.org/debian testing-updates main contrib non-free non-free-firmware +deb-src http://deb.debian.org/debian testing-updates main contrib non-free non-free-firmware
Debian has switched to a new sources format [1]. They have also provided a manual conversion for users with "apt modernize-sources". So it makes sense to start using the new format directly here.
Re: [PATCH v2 8/9] devconfig: add automatic APT mirror fallback for Debian testing
Quoted 143 lines · Daniel Gomez
Quoted 127 lines · Luis Chamberlain
Debian testing (trixie) VMs can fail to provision when configured APT mirrors become unavailable or unresponsive. This is particularly common with local or regional mirrors that may have intermittent connectivity issues.
This fix adds automatic mirror health checking specifically for Debian testing systems. The implementation:
1. Extracts the currently configured APT mirror hostname
2. Tests connectivity to the mirror on port 80 with a 10 second timeout
3. Falls back to official Debian mirrors if the test fails
4. Backs up the original sources.list before making changes
5. Updates the APT cache after switching mirrors
6. Provides clear user notification about the fallbackThe check only runs on Debian testing systems where
devconfig_debian_testingis set to true, avoiding any impact on stable Debian or other distributions.This ensures that Debian testing VMs can successfully provision even when the initially configured mirror is unavailable, improving reliability for development and testing workflows.
Generated-by Claude AISigned-off-by Luis Chamberlain <[email protected]>--- .../devconfig/tasks/check-apt-mirrors.yml | 63 +++++++++++++++++++ playbooks/roles/devconfig/tasks/main.yml | 8 +++ .../debian-testing-fallback-sources.list | 10 +++ 3 files changed, 81 insertions(+) create mode 100644 playbooks/roles/devconfig/tasks/check-apt-mirrors.yml create mode 100644 playbooks/roles/devconfig/templates/debian-testing-fallback-sources.listplaybooks/roles/devconfig/tasks/check-apt-mirrors.yml new file +63
-0@@ -0,0 +1,63 @@ +--- +# Only run mirror checks for Debian testing (trixie) where mirror issues are common +- name: Extract current APT mirror hostname + shell: | + grep -E "^deb\s+http" /etc/apt/sources.list | head -1 | awk '{print $2}' | sed 's|http://||' | cut -d'/' -f1 + register: apt_mirror_host + changed_when: false + ignore_errors: yes + +- name: Check connectivity to current APT mirror + wait_for: + host: "{{ apt_mirror_host.stdout }}" + port: 80 + timeout: 10 + register: mirror_connectivity + ignore_errors: yes + when: apt_mirror_host.stdout != "" + +- name: Display mirror check results + debug: + msg: | + Current APT mirror: {{ apt_mirror_host.stdout | default('Not found') }} + Mirror connectivity: {{ 'OK' if mirror_connectivity is not failed else 'FAILED' }} + when: apt_mirror_host.stdout != "" + +- name: Fall back to official Debian mirrors if current mirror fails + block: + - name: Backup current sources.list + copy: + src: /etc/apt/sources.list + dest: /etc/apt/sources.list.backup + remote_src: yes + become: yes + + - name: Apply Debian testing fallback sources + template: + src: debian-testing-fallback-sources.list + dest: /etc/apt/sources.list + owner: root + group: root + mode: '0644' + become: yes + + - name: Update APT cache after mirror change + apt: + update_cache: yes + cache_valid_time: 0 + become: yes + + - name: Inform user about mirror fallback + debug: + msg: | + WARNING: The configured APT mirror '{{ apt_mirror_host.stdout }}' is not accessible. + Falling back to official Debian testing mirrors: + - deb.debian.org for main packages + - security.debian.org for security updates + + This may result in slower package downloads depending on your location. + Consider configuring a local mirror for better performance. + + when: + - apt_mirror_host.stdout != "" + - mirror_connectivity is failedplaybooks/roles/devconfig/tasks/main.yml +8
-0@@ -30,6 +30,14 @@ tags: hostname # Distro specific + +# Check and fix APT mirrors for Debian testing before installing dependencies +- name: Check and fix APT mirrors for Debian testing + include_tasks: check-apt-mirrors.yml + when: + - devconfig_debian_testing is defined + - devconfig_debian_testing | bool + - name: Install dependencies ansible.builtin.include_tasks: install-deps/main.yml tags: ['vars', 'vars_simple']playbooks/roles/devconfig/templates/debian-testing-fallback-sources.list new file +1
-0@@ -0,0 +1,10 @@ +deb http://deb.debian.org/debian testing main contrib non-free non-free-firmwareplaybooks/roles/devconfig/templates/debian-testing-fallback-sources.list line 10
Quoted 10 lines
playbooks/roles/devconfig/templates/debian-testing-fallback-sources.list new file +9
-0+deb-src http://deb.debian.org/debian testing main contrib non-free non-free-firmware + +# Security updates +deb http://security.debian.org/debian-security testing-security main contrib non-free non-free-firmware +deb-src http://security.debian.org/debian-security testing-security main contrib non-free non-free-firmware + +# Updates (if available for testing) +deb http://deb.debian.org/debian testing-updates main contrib non-free non-free-firmware +deb-src http://deb.debian.org/debian testing-updates main contrib non-free non-free-firmwareDebian has switched to a new sources format [1]. They have also provided a manual conversion for users with "apt modernize-sources". So it makes sense to start using the new format directly here.
Quoted 1 line
I'll post a v3 with also enhancements to the hop1 inference.
Luis
PATCH v2 9/9 bootlinux: add support for A/B kernel testing
In reply to Luis ChamberlainRight now we use the same kernel for all target nodes. We want to compare and contrast different kenrels for different features. We add support for A/B testing by leveraging the baseline and dev groups provided to us by KDEVOPS_BASELINE_AND_DEV.
This extends the bootlinux playbook by enabling us to allow a different kernel tree / ref to be used for the dev group. This just becomes a configuration thing. The targets are intuitive:
make linux # Handles A/B compilation transparently make linux-baseline # Build and install baseline kernel only make linux-dev # Build and install development kernel only
We also add a simple check to verify all different build types end up respecting different kernels if we so choose:
make check-linux-ab
This does not launch targets it just verifies we don't regress in the future with the different ref tags.
--- .github/workflows/linux-ab-testing.yml | 217 +++++++++++++++++++ .github/workflows/linux-ab.yml | 47 ++++ Makefile | 1 + PROMPTS.md | 52 +++++ defconfigs/linux-ab-testing | 14 ++ defconfigs/linux-ab-testing-9p | 15 ++ defconfigs/linux-ab-testing-builder | 15 ++ defconfigs/linux-ab-testing-target | 15 ++ docs/kdevops-make-linux.md | 158 ++++++++++++++ playbooks/roles/bootlinux/defaults/main.yml | 14 ++ playbooks/roles/bootlinux/tasks/build/9p.yml | 20 +- playbooks/roles/bootlinux/tasks/main.yml | 112 ++++++++++ scripts/infer_last_stable_kernel.sh | 35 +++ scripts/linux-ab-testing.Makefile | 51 +++++ scripts/test-linux-ab-config.py | 182 ++++++++++++++++ scripts/test-linux-ab.sh | 213 ++++++++++++++++++ workflows/linux/Kconfig | 102 ++++++++- workflows/linux/Makefile | 39 ++++ 18 files changed, 1291 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/linux-ab-testing.yml create mode 100644 .github/workflows/linux-ab.yml create mode 100644 defconfigs/linux-ab-testing create mode 100644 defconfigs/linux-ab-testing-9p create mode 100644 defconfigs/linux-ab-testing-builder create mode 100644 defconfigs/linux-ab-testing-target create mode 100755 scripts/infer_last_stable_kernel.sh create mode 100644 scripts/linux-ab-testing.Makefile create mode 100755 scripts/test-linux-ab-config.py create mode 100755 scripts/test-linux-ab.sh
.github/workflows/linux-ab-testing.yml new file +217 -0
@@ -0,0 +1,217 @@ +name: Linux A/B Testing Verification + +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + workflow_dispatch: # Allow manual triggering + +jobs: + linux-ab-testing-verification: + name: Verify Linux A/B Testing Variables + runs-on: ubuntu-latest + strategy: + matrix: + distro_container: + - debian:testing + - fedora:latest + build_method: + - target + - 9p + - builder + + container: ${{ matrix.distro_container }} + steps: + - name: Document test environment + run: | + echo "Running Linux A/B testing verification on ${{ matrix.distro_container }}" + echo "Build method: ${{ matrix.build_method }}" + uname -a + + - name: Install dependencies + run: | + if [ "${{ matrix.distro_container }}" = "debian:testing" ]; then + echo "Installing packages for Debian" + apt-get update + apt-get install -y ansible-core make gcc ncurses-dev bison flex git python3 + elif [ "${{ matrix.distro_container }}" = "fedora:latest" ]; then + echo "Installing packages for Fedora" + dnf install -y ansible make gcc ncurses-devel bison flex git python3 + else + echo "Unknown distribution: ${{ matrix.distro_container }}" + exit 1 + fi + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Configure git for kdevops + run: | + git config --global --add safe.directory '*' + git config --global user.name "kdevops-ci" + git config --global user.email "[email protected]" + + - name: Apply A/B testing defconfig + run: | + echo "Applying linux-ab-testing-${{ matrix.build_method }} defconfig" + make defconfig-linux-ab-testing-${{ matrix.build_method }} + + # Verify configuration was applied correctly + echo "=== Verifying A/B testing configuration ===" + grep -E "CONFIG_KDEVOPS_BASELINE_AND_DEV=y" .config || exit 1 + grep -E "CONFIG_BOOTLINUX_AB_DIFFERENT_REF=y" .config || exit 1 + + # Check build method specific configs + case "${{ matrix.build_method }}" in + target) + grep -E "CONFIG_BOOTLINUX_TARGET=y" .config || exit 1 + ;; + 9p) + grep -E "CONFIG_BOOTLINUX_9P=y" .config || exit 1 + ;; + builder) + grep -E "CONFIG_BOOTLINUX_BUILDER=y" .config || exit 1 + ;; + esac + + - name: Run make to generate extra_vars.yaml + run: | + make + + - name: Extract and verify kernel references + run: | + echo "=== Extracting kernel references from configuration ===" + + # Get the baseline ref (should be master or main) + BASELINE_REF=$(grep "^bootlinux_tree_ref:" extra_vars.yaml | awk '{print $2}') + echo "Baseline ref: $BASELINE_REF" + + # Get the dev ref using the inference script + DEV_REF=$(grep "^bootlinux_dev_tree_ref:" extra_vars.yaml | awk '{print $2}') + echo "Dev ref from config: $DEV_REF" + + # Since we're in a container without /mirror/linux.git, the script will fallback + # For CI, we'll simulate getting the latest stable tag + if [ -f scripts/infer_last_stable_kernel.sh ]; then + INFERRED_STABLE=$(./scripts/infer_last_stable_kernel.sh 2>/dev/null || echo "v6.12") + echo "Inferred stable version: $INFERRED_STABLE" + fi + + # Verify refs are different + if [ "$BASELINE_REF" = "$DEV_REF" ]; then + echo "ERROR: Baseline and dev refs should be different for A/B testing" + exit 1 + fi + + # Store refs for later verification + echo "BASELINE_REF=$BASELINE_REF" >> $GITHUB_ENV + echo "DEV_REF=$DEV_REF" >> $GITHUB_ENV + + - name: Test debug functionality with Ansible + run: | + echo "=== Testing debug output with DEBUG_REF=1 ===" + + # Create a minimal hosts file for container testing + cat > hosts << EOF + [all] + localhost ansible_connection=local + + [baseline] + localhost ansible_connection=local + + [dev] + EOF + + # Run the bootlinux playbook with debug enabled and capture output + export DEBUG_REF=1 + ansible-playbook -i hosts playbooks/bootlinux.yml --tags vars,debug -v > debug_output.txt 2>&1 || true + + # Verify debug output based on build method + case "${{ matrix.build_method }}" in + 9p) + echo "=== Verifying 9P debug output (localhost context) ===" + if grep -q "active_linux_ref" debug_output.txt; then + echo "✓ Found active_linux_ref in 9P debug output" + else + echo "✗ Missing active_linux_ref in 9P debug output" + cat debug_output.txt + exit 1 + fi + ;; + target|builder) + echo "=== Verifying non-9P debug output (per-node context) ===" + if grep -q "target_linux_ref" debug_output.txt; then + echo "✓ Found target_linux_ref in non-9P debug output" + else + echo "✗ Missing target_linux_ref in non-9P debug output" + cat debug_output.txt + exit 1 + fi + ;; + esac + + - name: Verify A/B testing Makefile rules + run: | + echo "=== Verifying A/B testing Makefile structure ===" + + # Check that linux target depends on linux-baseline and linux-dev + if grep -A5 "^linux:" workflows/linux/Makefile | grep -q "linux-baseline linux-dev"; then + echo "✓ Makefile has correct A/B testing dependencies" + else + echo "✗ Makefile missing A/B testing dependencies" + exit 1 + fi + + # Verify linux-baseline and linux-dev targets exist + if grep -q "^linux-baseline:" workflows/linux/Makefile && \ + grep -q "^linux-dev:" workflows/linux/Makefile; then + echo "✓ Both linux-baseline and linux-dev targets exist" + else + echo "✗ Missing linux-baseline or linux-dev targets" + exit 1 + fi + + - name: Test variable resolution patterns + run: | + echo "=== Testing variable resolution patterns ===" + + # Create test playbook to verify variable resolution + cat > test_vars.yml << 'EOF' + --- + - hosts: localhost + connection: local + tasks: + - name: Load extra vars + include_vars: extra_vars.yaml + + - name: Display loaded variables + debug: + msg: | + bootlinux_tree_ref: {{ bootlinux_tree_ref | default('undefined') }} + bootlinux_dev_tree_ref: {{ bootlinux_dev_tree_ref | default('undefined') }} + kdevops_baseline_and_dev: {{ kdevops_baseline_and_dev | default(false) }} + bootlinux_ab_different_ref: {{ bootlinux_ab_different_ref | default(false) }} + EOF + + ansible-playbook test_vars.yml -v + + - name: Summary report + if: always() + run: | + echo "=== A/B Testing Verification Summary ===" + echo "Distribution: ${{ matrix.distro_container }}" + echo "Build Method: ${{ matrix.build_method }}" + echo "Baseline Ref: ${BASELINE_REF:-not set}" + echo "Dev Ref: ${DEV_REF:-not set}" + echo "" + + if [ -f .config ]; then + echo "Key configurations:" + grep -E "(BASELINE_AND_DEV|AB_DIFFERENT_REF|BOOTLINUX_TARGET|BOOTLINUX_9P|BOOTLINUX_BUILDER)" .config | head -10 + fi + + echo "" + echo "Test completed successfully ✓"
.github/workflows/linux-ab.yml new file +47 -0
47 lines not on this page · raw message
Makefile +1 -0
@@ -243,6 +243,7 @@ $(KDEVOPS_NODES): .config $(ANSIBLE_CFG_FILE) $(KDEVOPS_NODES_TEMPLATE) DEFAULT_DEPS += $(LOCALHOST_SETUP_WORK) include scripts/tests.Makefile +include scripts/linux-ab-testing.Makefile include scripts/ci.Makefile include scripts/archive.Makefile include scripts/defconfig.Makefile
PROMPTS.md +52 -0
55 lines not on this page · raw message
defconfigs/linux-ab-testing new file +14 -0
@@ -0,0 +1,14 @@ +CONFIG_GUESTFS=y +CONFIG_LIBVIRT=y + +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOW_LINUX_CUSTOM=y + +CONFIG_BOOTLINUX=y +CONFIG_BOOTLINUX_9P=y + +# Enable baseline and dev testing +CONFIG_KDEVOPS_BASELINE_AND_DEV=y + +# Enable A/B testing with different kernel references +CONFIG_BOOTLINUX_AB_DIFFERENT_REF=y
defconfigs/linux-ab-testing-9p new file +15 -0
@@ -0,0 +1,15 @@ +CONFIG_GUESTFS=y +CONFIG_LIBVIRT=y + +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOW_LINUX_CUSTOM=y + +CONFIG_BOOTLINUX=y +CONFIG_BOOTLINUX_9P=y +# CONFIG_BOOTLINUX_BUILDER is not set + +# Enable baseline and dev testing +CONFIG_KDEVOPS_BASELINE_AND_DEV=y + +# Enable A/B testing with different kernel references +CONFIG_BOOTLINUX_AB_DIFFERENT_REF=y
defconfigs/linux-ab-testing-builder new file +15 -0
@@ -0,0 +1,15 @@ +CONFIG_GUESTFS=y +CONFIG_LIBVIRT=y + +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOW_LINUX_CUSTOM=y + +CONFIG_BOOTLINUX=y +# CONFIG_BOOTLINUX_9P is not set +CONFIG_BOOTLINUX_BUILDER=y + +# Enable baseline and dev testing +CONFIG_KDEVOPS_BASELINE_AND_DEV=y + +# Enable A/B testing with different kernel references +CONFIG_BOOTLINUX_AB_DIFFERENT_REF=y
defconfigs/linux-ab-testing-target new file +15 -0
@@ -0,0 +1,15 @@ +CONFIG_GUESTFS=y +CONFIG_LIBVIRT=y + +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOW_LINUX_CUSTOM=y + +CONFIG_BOOTLINUX=y +# CONFIG_BOOTLINUX_9P is not set +# CONFIG_BOOTLINUX_BUILDER is not set + +# Enable baseline and dev testing +CONFIG_KDEVOPS_BASELINE_AND_DEV=y + +# Enable A/B testing with different kernel references +CONFIG_BOOTLINUX_AB_DIFFERENT_REF=y
docs/kdevops-make-linux.md +158 -0
161 lines not on this page · raw message
playbooks/roles/bootlinux/defaults/main.yml +14 -0
@@ -52,3 +52,17 @@ bootlinux_tree_set_by_cli: False bootlinux_artifacts_dir: "{{ topdir_path }}/workflows/linux/artifacts" kernel_packages: [] workflow_linux_packaged: false + +# A/B testing defaults +bootlinux_ab_same_ref: True +bootlinux_ab_different_ref: False + +# Development kernel settings (used when bootlinux_ab_different_ref is True) +bootlinux_dev_tree: "" +target_linux_dev_ref: "master" +target_linux_dev_kernelrelease: "" +target_linux_dev_localversion: "" +bootlinux_tree_custom_kernelrelease: False +bootlinux_tree_custom_localversion: false +bootlinux_is_dev_node: False +bootlinux_debug_ref: "{{ lookup('env', 'DEBUG_REF') | default(false, true) | bool }}"
playbooks/roles/bootlinux/tasks/build/9p.yml +10 -10
@@ -50,7 +50,7 @@ dest: "{{ bootlinux_9p_host_path }}" update: yes depth: "{{ target_linux_shallow_depth }}" - version: "{{ target_linux_ref }}" + version: "{{ active_linux_ref | default(target_linux_ref) }}" retries: 3 delay: 5 register: result
@@ -106,9 +106,9 @@ delegate_to: localhost - name: Set kernel localversion if requested on the control node - shell: "echo {{ target_linux_localversion }} > {{ bootlinux_9p_host_path }}/localversion" + shell: "echo {{ active_linux_localversion | default(target_linux_localversion) }} > {{ bootlinux_9p_host_path }}/localversion" when: - - target_linux_localversion is defined and target_linux_localversion != "" + - (active_linux_localversion is defined and active_linux_localversion != "") or (target_linux_localversion is defined and target_linux_localversion != "") run_once: true delegate_to: localhost
@@ -139,16 +139,16 @@ register: target_linux_kernelversion tags: [ 'build-linux' ] when: - - target_linux_kernelrelease | length > 0 + - (active_linux_kernelrelease | default(target_linux_kernelrelease)) | length > 0 run_once: true delegate_to: localhost -- name: Generate user kernelrelease {{ target_linux_kernelversion.stdout }}-{{ target_linux_kernelrelease }} +- name: Generate user kernelrelease {{ target_linux_kernelversion.stdout }}-{{ active_linux_kernelrelease | default(target_linux_kernelrelease) }} set_fact: - target_user_kernelrelease: "{{ target_linux_kernelversion.stdout }}-{{ target_linux_kernelrelease }}" + target_user_kernelrelease: "{{ target_linux_kernelversion.stdout }}-{{ active_linux_kernelrelease | default(target_linux_kernelrelease) }}" tags: [ 'build-linux' ] when: - - target_linux_kernelrelease | length > 0 + - (active_linux_kernelrelease | default(target_linux_kernelrelease)) | length > 0 run_once: true delegate_to: localhost
@@ -160,17 +160,17 @@ KERNELRELEASE={{ target_user_kernelrelease }} tags: [ 'build-linux' ] when: - - target_linux_kernelrelease | length > 0 + - (active_linux_kernelrelease | default(target_linux_kernelrelease)) | length > 0 run_once: true delegate_to: localhost -- name: Build {{ target_linux_tree }} {{ target_user_kernelrelease }} on the control node using {{ nproc_9p.stdout }} threads +- name: Build {{ target_linux_tree }} on the control node using {{ nproc_9p.stdout }} threads make: jobs: "{{ nproc_9p.stdout }}" chdir: "{{ bootlinux_9p_host_path }}" tags: [ 'build-linux' ] when: - - target_linux_kernelrelease | length == 0 + - (active_linux_kernelrelease | default(target_linux_kernelrelease)) | length == 0 run_once: true delegate_to: localhost
playbooks/roles/bootlinux/tasks/main.yml +112 -0
118 lines not on this page · raw message
scripts/infer_last_stable_kernel.sh new file +35 -0
@@ -0,0 +1,35 @@ +#!/bin/bash +# SPDX-License-Identifier: copyleft-next-0.3.1 + +# This script infers the last stable kernel version from the git repository. +# It looks for the most recent non-rc tag (e.g., v6.14, v6.13) that would +# be a good default for A/B testing with different kernel references. + +GIT_TREE="${1:-/mirror/linux.git}" + +if [ ! -d "$GIT_TREE" ]; then + echo "v6.12" # fallback if no git tree available + exit 0 +fi + +# Get all v6.x tags, excluding release candidates +# Sort them by version and get the last stable release +LAST_STABLE=$(git --git-dir="$GIT_TREE" tag --list 'v6.*' | \ + grep -v -- '-rc' | \ + sort -V | \ + tail -2 | head -1) + +if [ -z "$LAST_STABLE" ]; then + # If no stable v6.x found, try v5.x as fallback + LAST_STABLE=$(git --git-dir="$GIT_TREE" tag --list 'v5.*' | \ + grep -v -- '-rc' | \ + sort -V | \ + tail -2 | head -1) +fi + +# Final fallback if nothing found +if [ -z "$LAST_STABLE" ]; then + echo "v6.12" +else + echo "$LAST_STABLE" +fi
scripts/linux-ab-testing.Makefile new file +51 -0
51 lines not on this page · raw message
scripts/test-linux-ab-config.py new file +182 -0
182 lines not on this page · raw message
scripts/test-linux-ab.sh new file +213 -0
213 lines not on this page · raw message
workflows/linux/Kconfig +101 -1
134 lines not on this page · raw message
workflows/linux/Makefile +39 -0
@@ -74,6 +74,10 @@ PHONY += linux-help-menu linux-help-menu: @echo "Linux git kernel development options" @echo "linux - Git clones a linux git tree, build Linux, installs and reboots into it" + @if [[ "$(CONFIG_KDEVOPS_BASELINE_AND_DEV)" == "y" ]]; then \ + echo "linux-baseline - Build and install kernel for baseline nodes only" ;\ + echo "linux-dev - Build and install kernel for dev nodes only" ;\ + fi @if [[ "$(CONFIG_BOOTLINUX_9P)" == "y" ]]; then \ echo "linux-mount - Mounts 9p path on targets" ;\ fi
@@ -93,11 +97,46 @@ linux-help-end: LINUX_HELP_EXTRA := PHONY += linux +ifeq (y,$(CONFIG_KDEVOPS_BASELINE_AND_DEV)) +ifeq (y,$(CONFIG_BOOTLINUX_AB_DIFFERENT_REF)) +linux: linux-baseline linux-dev +else +linux: $(KDEVOPS_NODES) + $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \ + hosts $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \ + --extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS) +endif +else linux: $(KDEVOPS_NODES) $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \ --limit 'baseline:dev' \ $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \ --extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS) +endif + +PHONY += linux-baseline +ifeq (y,$(CONFIG_KDEVOPS_BASELINE_AND_DEV)) +linux-baseline: $(KDEVOPS_NODES) + $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \ + hosts $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \ + --extra-vars="$(BOOTLINUX_ARGS)" --limit baseline +else +linux-baseline: + @echo "linux-baseline requires KDEVOPS_BASELINE_AND_DEV=y" + @exit 1 +endif + +PHONY += linux-dev +ifeq (y,$(CONFIG_KDEVOPS_BASELINE_AND_DEV)) +linux-dev: $(KDEVOPS_NODES) + $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \ + hosts $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \ + --extra-vars="$(BOOTLINUX_ARGS)" --limit dev +else +linux-dev: + @echo "linux-dev requires KDEVOPS_BASELINE_AND_DEV=y" + @exit 1 +endif PHONY += linux-mount linux-mount:
Signature · 1 line
2.47.2