Skip to content

KT: Add Centos7 and fixups - #81

Merged
PlaidCat merged 5 commits into
mainlinefrom
{jmaple}_kt_setup_v2
Aug 4, 2026
Merged

KT: Add Centos7 and fixups#81
PlaidCat merged 5 commits into
mainlinefrom
{jmaple}_kt_setup_v2

Conversation

@PlaidCat

@PlaidCat PlaidCat commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Bunch of changes to enable CentOS7.9

FLAG DAY NOTICE

Depot Channels are now a part of the .private_repo.yaml overrides as described in the KT readme.
This will require moving content that was once in the kt/data/kernels.yaml otherwise you'll only ever get the VAULT Pinned repos.

Testing

# With Private Repos
## CBR-7.9
$ virsh console cbr-7.9
$ virsh start cbr-7.9 && virsh console cbr-7.9
CentOS Linux 7 with Bridge by CIQ (Core)
Kernel 3.10.0-1160.119.1.el7_9.ciqcbr.18.1.x86_64 on an x86_64

## LTS-8.6
$ kt vm lts-8.6 -c
$ virsh start lts-8.6 && virsh console lts-8.6
Rocky Linux 8.6 (Green Obsidian)
Kernel 4.18.0-372.32.1+33.1.el8_6_ciq.x86_64 on an x86_64

## LTS-9.2
$ kt vm lts-9.2
$ virsh start lts-9.2 && virsh console lts-9.2
Rocky Linux 9.2 (Blue Onyx)
Kernel 5.14.0-284.30.1+37.1.el9_2_ciq.x86_64 on an x86_64

## LTS-9.6
$ kt vm lts-9.6 -c
Rocky Linux from CIQ - LTS 9.6 (Blue Onyx)
Kernel 5.14.0-570.60.1+19.1.el9_6_ciq.x86_64 on x86_64

# WithOUT Private Repos
## CBR-7.9
$ kt vm cbr-7.9 -c
$ virsh start cbr-7.9 && virsh console cbr-7.9
CentOS Linux 7 (Core)
Kernel 3.10.0-1160.119.1.el7.x86_64 on an x86_64

## LTS-8.6
$ kt vm lts-8.6 -c
$ virsh start lts-8.6 && virsh console lts-8.6
Rocky Linux 8.6 (Green Obsidian)
Kernel 4.18.0-372.32.1.el8_6.x86_64 on an x86_64

## LTS-9.2
$ kt vm lts-9.2 -c
$ virsh start lts-9.2 && virsh console lts-9.2
Rocky Linux 9.2 (Blue Onyx)
Kernel 5.14.0-284.30.1.el9_2.x86_64 on an x86_64

## LTS-9.6
$ kt vm lts-9.6 -c
$ virsh start lts-9.6 && virsh console lts-9.6
Rocky Linux 9.6 (Blue Onyx)
Kernel 5.14.0-570.58.1.el9_6.x86_64 on x86_64

Coverage Report

Name Stmts Miss Branch BrPart Cover Missing
check_fips_changes.py 42 42 12 0 0% 8-67
check_kernel_commits.py 179 179 76 0 0% 3-371
ciq-cherry-pick.py 190 190 50 0 0% 1-426
ciq-tag.py 146 146 16 0 0% 3-378
ciq_tag.py 232 232 54 0 0% 1-464
jira_pr_check.py 180 180 80 0 0% 3-381
kt/ktlib/command_runner.py 33 20 6 0 33% 16, 20-33, 37-61, 65-66
kt/ktlib/config.py 54 0 12 0 100%
kt/ktlib/kernel_workspace.py 111 77 18 0 26% 22-35, 49-66, 73-76, 80-91, 94-100, 113-124, 135-145, 162-165, 169-202, 210-213, 216-220
kt/ktlib/kernels.py 85 13 14 1 84% 57-65, 119, 135-142
kt/ktlib/local.py 5 1 0 0 80% 12
kt/ktlib/repo.py 29 15 2 0 45% 30-31, 34-35, 43-55
kt/ktlib/ssh.py 10 2 0 0 80% 10, 14
kt/ktlib/util.py 17 0 0 0 100%
kt/ktlib/virt.py 67 32 4 0 49% 23, 31-34, 48-75, 79-85, 89-90, 94, 98, 102, 106, 112-114, 118-123, 127-132
kt/ktlib/vm.py 281 145 48 3 46% 127-144, 177-186, 194-205, 234-237, 252->263, 280->286, 291-301, 304-305, 318-322, 325, 328-344, 349-366, 369-376, 385-389, 392-403, 406-407, 410, 414-419, 431-442, 455-462, 471, 480-492, 495-502, 505-514, 517
release_config.py 2 2 0 0 0% 7-27
rolling-release-update.py 264 264 106 0 0% 1-412
run_interdiff.py 165 165 56 0 0% 3-244
update_lt_spec.py 219 219 46 0 0% 9-411
TOTAL 2311 1924 600 4 15%

@PlaidCat PlaidCat self-assigned this Aug 3, 2026
Copilot AI lite review requested due to automatic review settings August 3, 2026 22:35
@PlaidCat
PlaidCat marked this pull request as ready for review August 3, 2026 22:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the KT (Kernel Tools) workflow to support CentOS 7.9 VM provisioning and introduces “private config” support for per-kernel overrides (e.g., dist-git root/branch and related VM knobs), with accompanying test and documentation updates.

Changes:

  • Add CentOS 7.9 kernel entry and VM provisioning support (CentOS-specific cloud-init template + NFS/virt-install adjustments).
  • Load private repo config with kernel overrides and surface whether a kernel was overridden.
  • Strengthen config and kernels parsing tests; update docs to reflect the new override mechanism.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
tests/kt/ktlib/test_kernels.py Updates repo naming and adds tests for per-kernel override behavior.
tests/kt/ktlib/test_config.py Adds/updates tests for config loading, missing keys handling, and path validation.
README.md Adds KT overview section (currently has incorrect path casing/locations).
kt/ktlib/vm.py Adds CentOS7 handling (cloud-init selection, pkg manager selection), os_variant/use_nfs plumbing, and VM startup polling.
kt/ktlib/virt.py Switches virt-install to accept explicit os_variant and makes virtiofs optional for NFS workflows.
kt/ktlib/util.py Adds libvirt host IP and polling constants used by VM startup logic.
kt/ktlib/kernels.py Loads private config (repos + kernel overrides) and marks overridden kernels.
kt/ktlib/config.py Adds required-key validation and defaults user from environment (currently exits process on invalid config).
kt/KT.md Expands setup/private repo docs (currently mismatched override key name and has spelling/grammar issues).
kt/data/kernels.yaml Adds CentOS 7.9 kernel and updates dist-git roots/branches to the new layout.
kt/data/cloud_init_centos7.yaml Introduces CentOS 7 cloud-init template (currently duplicates yum update behavior with vm.py injection).
kt/commands/list_kernels/impl.py Changes list-kernels output to include (default) / (override) labeling.
kernel_install_dep.sh Makes optional package install failures non-fatal.
Suppressed comments (1)

kt/KT.md:64

  • Same as above: the example YAML key should match what the code loads (kernel_overrides).
kernel_override:

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread kt/KT.md
Comment thread kt/KT.md Outdated
Comment thread kt/KT.md Outdated
Comment thread kt/ktlib/kernels.py
Comment thread kt/ktlib/config.py
Comment thread kt/commands/list_kernels/impl.py Outdated
Comment thread kt/ktlib/vm.py Outdated
Comment thread kt/ktlib/vm.py Outdated
Comment thread kt/data/cloud_init_centos7.yaml Outdated
Validate required keys on config load and exit with an example
config when any are missing. Default the user field from $USER
when not explicitly set.
Replace dist-git-tree-cbr/dist-git-tree-lts references with a
single public dist-git-tree repo. Private repos and per-kernel
overrides (branches, repos, depot channels) are now loaded from
.private_repos.yaml kernel_overrides section. List-kernels shows
whether each kernel uses default or overridden config.
CentOS 7 does not support virtiofs, so VMs with os_variant=centos7
use NFS mounts instead. A dedicated cloud-init template handles
CentOS vault repo fixes, yum-based package installs, and yum for
depot. virt-install skips --filesystem and --memorybacking flags
when use_nfs is set. VM startup now polls for running state instead
of a fixed sleep, with automatic start attempt if the VM is shut
off after cloud-init reboot.
Depot channels are CIQ-internal and belong in .private_repos.yaml
kernel_overrides, not in the public kernels.yaml. Update KT.md
with setup steps for config file, private repos, and depot
channels. Add README pointer to KT.md for kt setup directions.
Copilot AI review requested due to automatic review settings August 4, 2026 20:35
@PlaidCat
PlaidCat force-pushed the {jmaple}_kt_setup_v2 branch from f136cf5 to f8d8bb8 Compare August 4, 2026 20:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

Suppressed comments (3)

kt/ktlib/kernels.py:61

  • The PR description references .private_repo.yaml, but the code reads .private_repos.yaml (plural). Users following the PR description will not get private repos/overrides applied. Consider supporting both filenames (legacy + documented) to reduce configuration footguns.
    def _load_private_config(cls, config: Config) -> tuple[dict[str, str], dict[str, dict]]:
        """Load private repository URLs and kernel overrides from local config"""
        private_repos_path = config.base_path / Constants.PRIVATE_REPOS_CONFIG_FILE

        if not private_repos_path.exists():
            logging.info(f"{private_repos_path} does not exist")
            return {}, {}

kt/ktlib/vm.py:219

  • _setup_cloud_init() selects the CentOS7 cloud-init template based on os_variant, but there’s no validation that use_nfs matches that choice. If a CentOS7 kernel is configured without use_nfs: true, virt-install will still use virtiofs while the CentOS7 template expects an NFS mount (and vice versa if use_nfs is enabled on non-CentOS7). This will lead to broken mounts and hard-to-debug VM boot behavior.
        template_path = CLOUD_INIT_CENTOS7_PATH if self._is_centos7() else CLOUD_INIT_BASE_PATH
        with open(template_path) as f:
            data = yaml.load(f)

kt/ktlib/vm.py:235

  • The NFS source is built using a hard-coded libvirt host IP (192.168.122.1). That’s the default for many setups, but it’s not universal; on hosts with a different libvirt network/bridge address, the CentOS7 NFS mount will fail. Making the host IP overridable (e.g., via an env var) avoids breaking on non-default libvirt configurations.
        if self._is_centos7():
            nfs_source = f"{Constants.LIBVIRT_HOST_IP}:{base_path_str}"
            data["mounts"][0][0] = nfs_source

@bmastbergen bmastbergen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌

@PlaidCat
PlaidCat merged commit e05d3f3 into mainline Aug 4, 2026
2 checks passed
@PlaidCat
PlaidCat deleted the {jmaple}_kt_setup_v2 branch August 4, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants