From 9800d7b7d022d82073d2eb985aa80ce04ca239e3 Mon Sep 17 00:00:00 2001 From: Roxana Nicolescu Date: Thu, 5 Mar 2026 10:59:34 +0100 Subject: [PATCH 1/5] kt/data/kernels.yaml: Remove fips-9.2 This has been consolidated into lts9.2. Signed-off-by: Roxana Nicolescu --- kt/data/kernels.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/kt/data/kernels.yaml b/kt/data/kernels.yaml index ca17eb5..1bde825 100644 --- a/kt/data/kernels.yaml +++ b/kt/data/kernels.yaml @@ -44,10 +44,3 @@ kernels: dist_git_root: dist-git-tree-fips dist_git_branch: fips-compliant8 mock_config: rocky-lts86-fips - - fips-9.2: - src_tree_root: kernel-src-tree - src_tree_branch: fips-9-compliant/5.14.0-284.30.1 - dist_git_root: dist-git-tree-fips - dist_git_branch: el92-fips-compliant-9 - mock_config: rocky-fips92 From ce155df1771d142c1c6e898218472658f5a99a7c Mon Sep 17 00:00:00 2001 From: Roxana Nicolescu Date: Thu, 5 Mar 2026 10:58:10 +0100 Subject: [PATCH 2/5] kt/data/kernels.yaml: Add automated field Useful for kernels that have kernelCI supported. They are still "alive" but with limited support, that is why they are not deleted from this list. Signed-off-by: Roxana Nicolescu --- kt/data/kernels.yaml | 6 ++++++ kt/ktlib/kernels.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/kt/data/kernels.yaml b/kt/data/kernels.yaml index 1bde825..3e98593 100644 --- a/kt/data/kernels.yaml +++ b/kt/data/kernels.yaml @@ -9,6 +9,7 @@ kernels: dist_git_root: dist-git-tree-cbr dist_git_branch: cbr79-7 mock_config: centos-cbr79 + automated: false lts-8.6: src_tree_root: kernel-src-tree @@ -16,6 +17,7 @@ kernels: dist_git_root: dist-git-tree-lts dist_git_branch: lts86-8 mock_config: rocky-lts86 + automated: true lts-9.2: src_tree_root: kernel-src-tree @@ -23,6 +25,7 @@ kernels: dist_git_root: dist-git-tree-lts dist_git_branch: lts92-9 mock_config: rocky-lts92 + automated: true lts-9.4: src_tree_root: kernel-src-tree @@ -30,6 +33,7 @@ kernels: dist_git_root: dist-git-tree-lts dist_git_branch: lts94-9 mock_config: rocky-lts94 + automated: true lts-9.6: src_tree_root: kernel-src-tree @@ -37,6 +41,7 @@ kernels: dist_git_root: dist-git-tree-lts dist_git_branch: lts96-9 mock_config: rocky-lts96 + automated: true fipslegacy-8.6: src_tree_root: kernel-src-tree @@ -44,3 +49,4 @@ kernels: dist_git_root: dist-git-tree-fips dist_git_branch: fips-compliant8 mock_config: rocky-lts86-fips + automated: false diff --git a/kt/ktlib/kernels.py b/kt/ktlib/kernels.py index b29f077..08dab17 100644 --- a/kt/ktlib/kernels.py +++ b/kt/ktlib/kernels.py @@ -37,6 +37,8 @@ class KernelInfo: mock_config: str + automated: bool + @dataclass class KernelsInfo: From 1f11c845d97f5b511c62adb3c2c8ea360471c0a4 Mon Sep 17 00:00:00 2001 From: Roxana Nicolescu Date: Thu, 5 Mar 2026 11:28:20 +0100 Subject: [PATCH 3/5] kt/list-kernels: Add --automated option It will show only the kernels that are automated in kernelCI. Signed-off-by: Roxana Nicolescu --- kt/commands/list_kernels/command.py | 20 ++++++++++++++++++-- kt/commands/list_kernels/impl.py | 8 +++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/kt/commands/list_kernels/command.py b/kt/commands/list_kernels/command.py index 6802462..ca24ac6 100644 --- a/kt/commands/list_kernels/command.py +++ b/kt/commands/list_kernels/command.py @@ -4,15 +4,31 @@ epilog = """ It list all the kernels we currently maintain. +If --automated or -a is used, it will list all the kernels we maintain +but are also part of KernelCI. Example: \b $ kt list-kernels +cbr-7.9 +fipslegacy-8.6 +lts-8.6 +lts-9.2 +lts-9.4 +lts-9.6 + +\b +$ kt list-kernels --automated +lts-8.6 +lts-9.2 +lts-9.4 +lts-9.6 """ @click.command(epilog=epilog) -def list_kernels(): - main() +@click.option("-a", "--automated", is_flag=True, help="It selects only automated kernels") +def list_kernels(automated): + main(automated) diff --git a/kt/commands/list_kernels/impl.py b/kt/commands/list_kernels/impl.py index b6803c7..5df5af4 100644 --- a/kt/commands/list_kernels/impl.py +++ b/kt/commands/list_kernels/impl.py @@ -2,8 +2,10 @@ from kt.ktlib.kernels import KernelsInfo -def main(): +def main(automated: bool = False): config = Config.load() kernels = KernelsInfo.from_yaml(config=config).kernels - for k in sorted(kernels): - print(k) + + for k in sorted(kernels.values(), key=lambda k: k.name): + if not automated or k.automated: + print(k.name) From e441573796834017498e79dcd6c6b43b54626654 Mon Sep 17 00:00:00 2001 From: Roxana Nicolescu Date: Thu, 5 Mar 2026 14:01:00 +0100 Subject: [PATCH 4/5] kt: Add user as configurable By default it will be the env var $USER if no config is included. Signed-off-by: Roxana Nicolescu --- kt/ktlib/config.py | 10 ++++++---- kt/ktlib/kernel_workspace.py | 3 +-- kt/ktlib/vm.py | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/kt/ktlib/config.py b/kt/ktlib/config.py index 6ff5963..be3672e 100644 --- a/kt/ktlib/config.py +++ b/kt/ktlib/config.py @@ -32,6 +32,7 @@ class Config: images_dir: Path ssh_key: Path + user: str DEFAULT: ClassVar = { "base_path": "~/ciq", @@ -39,14 +40,15 @@ class Config: "images_source_dir": "~/ciq/default_test_images", "images_dir": "~/ciq/tmp/virt-images", "ssh_key": "~/.ssh/id_ed25519_generic.pub", + "user": os.environ["USER"], } @classmethod def from_str_dict(cls, data: dict[str, str]): - # Transform the str values to Path - new_data = {k: Path(v).expanduser() for k, v in data.items()} - - if not all(v.is_absolute() for v in new_data.values()): + # Transform the str values to Path except for user + non_path_keys = {"user"} + new_data = {k: (Path(v).expanduser() if k not in non_path_keys else v) for k, v in data.items()} + if not all(v.is_absolute() for k, v in new_data.items() if k not in non_path_keys): raise ValueError("all paths should be absolute; check your config") return cls(**new_data) diff --git a/kt/ktlib/kernel_workspace.py b/kt/ktlib/kernel_workspace.py index 9ea720e..54418cc 100644 --- a/kt/ktlib/kernel_workspace.py +++ b/kt/ktlib/kernel_workspace.py @@ -1,5 +1,4 @@ import logging -import os from dataclasses import dataclass from git import GitCommandError, Repo @@ -171,7 +170,7 @@ def load(cls, name: str, config: Config, kernel_info: KernelInfo, extra: str): name = name + "_" + extra folder = config.kernels_dir / Path(name) - user = os.environ["USER"] + user = config.user default_remote = "origin" dist_folder = folder / Path(Constants.DIST_TREE) diff --git a/kt/ktlib/vm.py b/kt/ktlib/vm.py index 2b0e99d..9984fe4 100644 --- a/kt/ktlib/vm.py +++ b/kt/ktlib/vm.py @@ -138,10 +138,10 @@ def _setup_cloud_init(self, config: Config): data = yaml.safe_load(f) # replace placeholders with user data - data["users"][0]["name"] = os.environ["USER"] + data["users"][0]["name"] = config.user # password remains the default for now - data["chpasswd"]["list"][0] = f"{os.environ['USER']}:test" + data["chpasswd"]["list"][0] = f"{config.user}:test" # ssh key with open(config.ssh_key) as f: @@ -157,8 +157,8 @@ def _setup_cloud_init(self, config: Config): # Because $HOME is the same as the host, during boot, cloud-init # sees the home dir already exists and root remains the owner - # change it to $USER - data["runcmd"][0][1] = f"{os.environ['USER']}:{os.environ['USER']}" + # change it to {config.user} + data["runcmd"][0][1] = f"{config.user}:{config.user}" data["runcmd"][0][2] = os.environ["HOME"] # Install packages needed later From 5a32116eec4d79bf02edd168ddcc05ffe138321e Mon Sep 17 00:00:00 2001 From: Roxana Nicolescu Date: Thu, 5 Mar 2026 14:10:42 +0100 Subject: [PATCH 5/5] pyproject.toml: Include the data files when installing the kt package Signed-off-by: Roxana Nicolescu --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 25e03f6..adb7a24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,3 +35,6 @@ py-modules = [] [tool.setuptools.packages.find] where = ["."] include = ["kt*"] + +[tool.setuptools.package-data] +"kt" = ["data/*.yaml"]