Skip to content

kernel_source_installer: add local_path support for PatchModifier#4413

Merged
LiliDeng merged 1 commit intomicrosoft:mainfrom
anirudhrb:kernel_installer_local_patches
Apr 13, 2026
Merged

kernel_source_installer: add local_path support for PatchModifier#4413
LiliDeng merged 1 commit intomicrosoft:mainfrom
anirudhrb:kernel_installer_local_patches

Conversation

@anirudhrb
Copy link
Copy Markdown
Collaborator

@anirudhrb anirudhrb commented Apr 9, 2026

Description

Add support for specifying local patch files in PatchModifier via a new 'local_path' field. This allows users to provide a glob pattern pointing to patch files on the LISA controller machine, which are then copied to the remote node and applied to the kernel source.

Previously, patches could only be sourced from a git repository using the 'repo' field. With this change, 'repo' becomes optional and users must specify exactly one of 'repo' or 'local_path'.

The 'local_path' field accepts glob patterns (e.g., '/path/to/*.patch'). Matching files are expanded on the controller, copied to the node, and applied in sorted order for deterministic behavior.

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested (if not, add required peer reviewers after raising PR)
  • Tests executed and results posted below

Test Validation

Key Test Cases:
Tested verify_cloud_hypervisor_integration tests with internal ADO pipeline.

Impacted LISA Features:
Kernel source installer tansformer

Tested Azure Marketplace Images:
None

Test Results

Image VM Size Result
PASSED / FAILED / SKIPPED

Copilot AI review requested due to automatic review settings April 9, 2026 05:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 extends kernel_source_installer’s PatchModifier to support applying patches from controller-local files via a new local_path glob pattern, in addition to the existing repo-based patch sourcing. It also introduces schema validation requiring exactly one of repo or local_path and applies local patches in sorted order for determinism.

Changes:

  • Add local_path to PatchModifierSchema and validate mutual exclusivity with repo (and with file_pattern).
  • In PatchModifier.modify(), expand a controller-side glob, upload matching patch files to the node, and apply them sequentially.
  • Keep existing repo-based patch flow (clone + file_pattern) for backward compatibility when repo is used.

@anirudhrb anirudhrb force-pushed the kernel_installer_local_patches branch from a7539ea to 8a175e0 Compare April 9, 2026 08:19
@anirudhrb anirudhrb force-pushed the kernel_installer_local_patches branch from 8a175e0 to 6c66f72 Compare April 10, 2026 12:57
Add support for specifying local patch files in PatchModifier via a new
'local_patches' field. This allows users to provide a glob pattern
pointing to patch files on the LISA controller machine, which are then
copied to the remote node and applied to the kernel source.

Previously, patches could only be sourced from a git repository using
the 'repo' field. With this change, 'repo' becomes optional and users
must specify exactly one of 'repo' or 'local_patches'.

The 'local_patches' field accepts glob patterns (e.g., '/path/to/*.patch').
Matching files are expanded on the controller, copied to the node, and
applied in sorted order for deterministic behavior.

Validation ensures:
  - 'repo' and 'local_patches' are mutually exclusive
  - exactly one of the two must be provided
  - 'local_patches' and 'file_pattern' are mutually exclusive

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
@anirudhrb anirudhrb force-pushed the kernel_installer_local_patches branch from 6c66f72 to 4ce21c6 Compare April 10, 2026 13:01
Copilot AI review requested due to automatic review settings April 10, 2026 13:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 1 out of 1 changed files in this pull request and generated 2 comments.

@LiliDeng LiliDeng merged commit 4589ed1 into microsoft:main Apr 13, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants