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

Check other folders for driver_log #164

Merged
merged 2 commits into from Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -16,6 +16,7 @@ the section headers (Added/Changed/...) and incrementing the package version.
- ([#159](https://github.com/microsoft/hi-ml/pull/159)) Add profiling for loading png image files as numpy arrays.

### Changed
- ([164](https://github.com/microsoft/hi-ml/pull/164)) Look in more locations for std out from AzureML run.

### Fixed

Expand Down
17 changes: 11 additions & 6 deletions hi-ml-azure/testazure/testazure/test_himl.py
Expand Up @@ -595,8 +595,7 @@ def render_and_run_test_script(path: Path,
extra_options: Dict[str, Any],
extra_args: List[str],
expected_pass: bool,
suppress_config_creation: bool = False,
hyperdrive: bool = False) -> str:
suppress_config_creation: bool = False) -> str:
"""
Prepare test scripts, submit them, and return response.

Expand All @@ -606,7 +605,6 @@ def render_and_run_test_script(path: Path,
:param extra_args: Extra command line arguments for calling script.
:param expected_pass: Whether this call to subprocess is expected to be successful.
:param suppress_config_creation: (Optional, defaults to False) do not create a config.json file if none exists
:param hyperdrive: Whether this is a HyperDrive run (in which case the logs will differ)
:return: Either response from spawn_and_monitor_subprocess or run output if in AzureML.
"""
# target hi-ml-azure package version, if specified in an environment variable.
Expand Down Expand Up @@ -683,7 +681,6 @@ def spawn() -> Tuple[int, List[str]]:
assert EXPECTED_QUEUED not in captured
return captured
else:
expected_log_file = "hyperdrive.txt" if hyperdrive else "70_driver_log.txt"
assert EXPECTED_QUEUED in captured
with check_config_json(path):
workspace = get_workspace(aml_workspace=None, workspace_config_path=path / WORKSPACE_CONFIG_JSON)
Expand All @@ -695,8 +692,16 @@ def spawn() -> Tuple[int, List[str]]:
assert run.status == "Completed"
log_root = path / "logs"
log_root.mkdir(exist_ok=False)
run.get_all_logs(destination=log_root)
driver_log = log_root / "azureml-logs" / expected_log_file
files = run.get_file_names()
# Account for old and new job runtime: log files live in different places
driver_log_files = ["azureml-logs/70_driver_log.txt", "user_logs/std_log.txt"]
driver_log = log_root / "driver_log.txt"
for f in driver_log_files:
if f in files:
run.download_file(f, output_file_path=str(driver_log))
break
else:
raise ValueError("The run does not contain any of the driver log files")
log_text = driver_log.read_text()
return log_text

Expand Down