Skip to content
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 Build: Fix builds running out of space because of partition selection #3606

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions microsoft/testsuites/dpdk/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ def download(self) -> PurePath:
# NOTE: fail on exists is set to True.
# The expectation is that the parent Installer class should
# remove any lingering installations
work_path = self._node.get_working_path_with_required_space(5)
self.asset_path = self._node.tools[Git].clone(
self._git_repo,
cwd=self._node.get_working_path(),
cwd=self._node.get_pure_path(work_path),
ref=self._git_ref,
fail_on_exists=False,
)
Expand All @@ -123,7 +124,9 @@ def __init__(
# then extract it
def download(self) -> PurePath:
node = self._node
work_path = self._node.get_working_path()
work_path = self._node.get_pure_path(
self._node.get_working_path_with_required_space(5)
)
is_tarball = False
for suffix in [".tar.gz", ".tar.bz2", ".tar"]:
if self._tar_url.endswith(suffix):
Expand All @@ -137,7 +140,9 @@ def download(self) -> PurePath:
).is_true()
if self._is_remote_tarball:
tarfile = node.tools[Wget].get(
self._tar_url, overwrite=False, file_path=str(node.get_working_path())
self._tar_url,
overwrite=False,
file_path=str(work_path),
)
remote_path = node.get_pure_path(tarfile)
self.tar_filename = remote_path.name
Expand Down
36 changes: 29 additions & 7 deletions microsoft/testsuites/dpdk/dpdktestpmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,17 +267,17 @@ def _install(self) -> None:
self.dpdk_build_path = node.tools[Meson].setup(
args=sample_apps, build_dir="build", cwd=self.asset_path
)
node.tools[Ninja].run(
install_result = node.tools[Ninja].run(
cwd=self.dpdk_build_path,
shell=True,
timeout=1800,
expected_exit_code=0,
expected_exit_code_failure_message=(
"ninja build for dpdk failed. check build spew for missing headers "
"or dependencies. Also check that this ninja version requirement "
"has not changed for dpdk."
),
)
# there are enough known installation failures to make
# raising each as a seperate useful message annoying.
# Also enough to make raising a single generic message useless.
# Use this function to parse and raise them.
_check_for_dpdk_build_errors(result=install_result)

# using sudo and pip modules can get weird on some distros,
# whether you install with pip3 --user or not.
# to work around, add the user python path to sudo one
Expand Down Expand Up @@ -1007,3 +1007,25 @@ def _discard_first_and_last_sample(data: List[int]) -> List[int]:

def _mean(data: List[int]) -> int:
return sum(data) // len(data)


def _check_for_dpdk_build_errors(result: ExecutableResult) -> None:
# check for common build errors and raise specific error messages for them
errors = [
# build unexpectedly ran out of space
"final link failed: No space left on device",
# elftools module not found (new OS version or package name change)
"Exception: elftools module not found",
]
if result.exit_code == 0:
return
# check for known common issues
for error in errors:
if error in result.stdout:
fail(f"DPDK source build issue: {error}")
# otherwise, raise a generic error asking for triage
fail(
"ninja build for dpdk failed. check build spew for missing headers "
"or dependencies. Also check that this ninja version requirement "
"has not changed for dpdk."
)
Loading