Fix stress-ng source clone timeout - #4683
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in “shallow clone” mode to LISA’s shared Git.clone() helper and uses it for the pinned stress-ng source-install fallback to reduce clone time and avoid timeouts caused by downloading unnecessary history.
Changes:
- Extend
lisa.tools.git.Git.clone()with ashallow: bool = Falseparameter that adds--depth 1(and--branchwhenrefis provided). - Use
shallow=Truewhen cloning the pinnedstress-ngrelease during_install_from_src().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lisa/tools/stress_ng.py | Uses shallow cloning for the pinned stress-ng source install path. |
| lisa/tools/git.py | Adds an opt-in shallow clone option to reduce clone time/history download. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
lisa/tools/git.py:72
- When
shallow=True, the code unconditionally maps any non-emptyreftogit clone --branch <ref>.--branchonly works for branch/tag names; it fails for commit SHAs and refspecs likerefs/pull/.../merge(whichcheckout()explicitly supports viafetch origin <ref>). Consider only adding--branchfor simple branch/tag refs, and lettingcheckout()handle other ref types.
cmd = f"clone {auth_flag} {url} {dir_name} --recurse-submodules"
if shallow:
cmd += " --depth 1"
if ref:
cmd += f" --branch {ref}"
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (2)
lisa/tools/git.py:71
- Minor/performance:
shallow=Trueadds--depth 1, but with--recurse-submodulesGit will still fetch full submodule history unless--shallow-submodulesis also set. Adding it makes the shallow option actually reduce clone time for repos with submodules.
cmd += " --depth 1"
lisa/tools/stress_ng.py:45
- Minor:
_check_exists()runs a constant command vianode.execute(..., shell=True). UsingTool.run()(withshell=False) avoids unnecessary shell parsing and keeps execution consistent with other Tool invocations.
result = self.node.execute(
f"{self.command} --version",
shell=True,
sudo=self._use_sudo,
no_error_log=True,
AI Test Case SelectionSelected 2 test case(s): verify_dpdk_ring_ping,verify_dynamic_memory_hot_add Marketplace image: Result: Canceled |
717d7f7 to
8676fa0
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
lisa/tools/stress_ng.py:60
- This debug message says the installed version is older than
self.branch(a tag likeV0.22.00), but the actual comparison is against_minimum_safe_version(e.g.0.22.0). This can be confusing when troubleshooting version-related rebuilds.
if installed_version < self._minimum_safe_version:
self._log.debug(
f"installed {self.command} version is older than "
f"{self.branch}; installing a fixed build from source"
)
lisa/tools/git.py:72
- When
shallow=True, this adds--branch {ref}. That works for branch/tag names, but it breaks callers that pass a commit SHA or a non-branch ref likerefs/pull/..., which the existingclone(..., ref=...)contract supports via the latercheckout(ref)fetch fallback. Guard--branchso shallow clones still work with commit/PR refs.
if shallow:
cmd += " --depth 1"
if ref:
cmd += f" --branch {ref}"
AI Test Case SelectionSelected 2 test case(s): verify_dpdk_ring_ping,verify_dynamic_memory_hot_add Marketplace image: Result: Succeeded |
| if shallow: | ||
| cmd += " --depth 1" | ||
| if ref: | ||
| cmd += f" --branch {ref}" |
There was a problem hiding this comment.
The later checkout(ref) handles post-clone setup, but --branch ensures the requested tag is included in the depth-1 clone. Without it, resolving V0.22.00 through the fallback fetch downloads full history and recreates the timeout. I added a comment clarifying the distinction.
Use a shallow clone of the pinned V0.22.00 release so source fallback completes within the tool timeout. Reject installed stress-ng versions older than 0.22.0 and rebuild them from source. This release validates exposed AVX-512 features before selecting target-cloned code, preventing SIGILL on virtualized guests.
8676fa0 to
4d64a42
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
lisa/tools/stress_ng.py:48
- Major:
str.removeprefix()requires Python 3.9+, but the project supports Python >=3.8 (per pyproject.toml). This will raiseAttributeErroron Python 3.8 when checking the installed stress-ng version.
installed_version = parse_version(
result.stdout.strip().removeprefix("stress-ng, version ")
)
AI Test Case SelectionSelected 2 test case(s): verify_dpdk_ring_ping,verify_dynamic_memory_hot_add Marketplace image: Result: Succeeded |
Add an opt-in shallow mode to the shared Git clone helper and use it for the pinned stress-ng release. This avoids downloading unnecessary repository history during the source-install fallback while preserving existing clone behavior for other callers.
Description
Related Issue
Type of Change
Checklist
Test Validation
Key Test Cases:
Impacted LISA Features:
Tested Azure Marketplace Images:
Test Results