Skip to content

Commit

Permalink
Downloader: request work path with space
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgov committed Jan 21, 2025
1 parent 729a424 commit 55dda99
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
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."
)

0 comments on commit 55dda99

Please sign in to comment.