-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DPDK: install path fixes for meson and Ubuntu 24.04 #3598
Draft
mcgov
wants to merge
8
commits into
main
Choose a base branch
from
mcgov/pyelf
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+89
−12
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
75180f2
Meson: try both 'meson' and 'python3-meson'
mcgov 08df703
DPDK: Add needs_reboot option to installer
mcgov edba78f
Suse: implement _uninstall_packages
mcgov d5eca26
Suse: i guess just 0
mcgov a4fd67c
Meson: restructure and comment installation options
mcgov 06a685d
package_exists: add minimum_version
mcgov 6520c65
rdma-core: check for existence before removal
mcgov 9a02ce2
Dpdk: move pyelftools to single installation point
mcgov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -404,13 +404,24 @@ def uninstall_packages( | |
package_names = self._get_package_list(packages) | ||
self._uninstall_packages(package_names, signed, timeout, extra_args) | ||
|
||
def package_exists(self, package: Union[str, Tool, Type[Tool]]) -> bool: | ||
def package_exists( | ||
self, | ||
package: Union[str, Tool, Type[Tool]], | ||
minimum_version: Optional[VersionInfo] = None, | ||
) -> bool: | ||
""" | ||
Query if a package/tool is installed on the node. | ||
Return Value - bool | ||
""" | ||
package_name = self.__resolve_package_name(package) | ||
return self._package_exists(package_name) | ||
exists = self._package_exists(package_name) | ||
if exists and minimum_version: | ||
return ( | ||
self.get_package_information(package_name=package_name) | ||
>= minimum_version | ||
) | ||
else: | ||
return exists | ||
|
||
def is_package_in_repo(self, package: Union[str, Tool, Type[Tool]]) -> bool: | ||
""" | ||
|
@@ -2094,6 +2105,31 @@ def _initialize_package_installation(self) -> None: | |
"There are no enabled repositories defined in this image.", | ||
) | ||
|
||
def _uninstall_packages( | ||
self, | ||
packages: List[str], | ||
signed: bool = True, | ||
timeout: int = 600, | ||
extra_args: Optional[List[str]] = None, | ||
) -> None: | ||
add_args = self._process_extra_package_args(extra_args) | ||
command = f"zypper --non-interactive {add_args}" | ||
if not signed: | ||
command += " --no-gpg-checks " | ||
command += f" rm {' '.join(packages)}" | ||
self.wait_running_process("zypper") | ||
install_result = self._node.execute( | ||
command, shell=True, sudo=True, timeout=timeout | ||
) | ||
|
||
if install_result.exit_code == 0: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assert the result to get it simpler. |
||
self._log.debug(f"{packages} is/are removed successfully.") | ||
else: | ||
raise LisaException( | ||
f"Failed to remove {packages}. exit_code: {install_result.exit_code}, " | ||
f"stderr: {install_result.stderr}" | ||
) | ||
|
||
def _install_packages( | ||
self, | ||
packages: List[str], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to print debug message, if min version is not met. It saves time to troubleshooting the reason.