Skip to content

KT: Add Centos7 and fixups - #81

Open
PlaidCat wants to merge 5 commits into
mainlinefrom
{jmaple}_kt_setup_v2
Open

KT: Add Centos7 and fixups#81
PlaidCat wants to merge 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 55 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 2312 1924 600 4 15%

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.
@PlaidCat PlaidCat self-assigned this Aug 3, 2026
Copilot AI 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
Comment on lines +7 to +11
In this repo there is a directory called `KT` which contains a "kernel tools"
python package that should be installed into your python environment. Its purpose
is to consolidate all of the one off or single purpose scripts to share more
common code and functionality. Please see the KT directions in KT/kt.md for
setup directions.
Comment thread kt/KT.md
Comment on lines +26 to +28
There is a default one in kt/data/config.json but you can create your own by
defining the KTOOLS_CONFIG_FILE enviroment varriable to point to your own config
file.
Comment thread kt/KT.md
Comment on lines +43 to +44
user defaults to $USER, set this if you wish for your user on the vms to be
different then define.
Comment thread kt/KT.md
private_repos:
dist-git-tree-lts: <gitlab_private_repo_url>

kernel_override:
Comment thread kt/ktlib/kernels.py
Comment on lines 63 to +65
with open(private_repos_path) as f:
data = yaml.safe_load(f)
return data.get("private_repos", {})
return data.get("private_repos", {}), data.get("kernel_overrides", {})
Comment thread kt/ktlib/config.py
Comment on lines +51 to +57
missing = cls.REQUIRED_KEYS - data.keys()
if missing:
example = json.dumps(cls.DEFAULT, indent=2)
sys.exit(
f"Error: config is missing required keys:\n\t{', '.join(sorted(missing))}"
f"\n\nExample config (note user is optional):\n{example}"
)
Comment on lines +11 to +12
label = f"{k.name} (override)" if k.overridden else f"{k.name} (default)"
print(label)
Comment thread kt/ktlib/vm.py
Comment on lines +207 to +208
def _is_centos7(self):
return self.os_variant and self.os_variant.startswith("centos7")
Comment thread kt/ktlib/vm.py
Comment on lines +335 to +339
try:
VmCommand.start(vm_name=self.name)
attempted_start = True
except RuntimeError:
pass
- sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/CentOS-*.repo
- [sudo, yum, install, -y, mock, git, vim]
- [sudo, yum, install, -y, ncurses-devel, make, gcc, bc, bison, flex, elfutils-libelf-devel, openssl-devel]
- [sudo, yum, update, -y]
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.

2 participants