Skip to content

Commit

Permalink
Propogate the system error to RH (#2296)
Browse files Browse the repository at this point in the history
* fail the run for error propogation

* adding missing pkgs
  • Loading branch information
jpmann authored Feb 12, 2024
1 parent 2a81608 commit 6fe814b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
from azureml._common._error_definition.azureml_error import AzureMLError # type: ignore
from azureml._common._error_definition.system_error import ClientError # type: ignore

from azureml.core.run import Run # type: ignore
from azureml.automl.core._run import run_lifecycle_utilities


class ModelImportErrorStrings:
"""Error strings."""
Expand Down Expand Up @@ -207,6 +210,11 @@ def wrapper(*args, **kwargs):
logger.error("Exception {} when calling {}".format(azureml_exception, func.__name__))
for handler in logger.handlers:
handler.flush()

# fail the run
run = Run.get_context()
run_lifecycle_utilities.fail_run(run, azureml_exception, is_aml_compute=True)

raise azureml_exception
finally:
time.sleep(60) # Let telemetry logger flush its logs before terminating.
Expand Down
1 change: 1 addition & 0 deletions assets/training/model_management/tests/dev_conda_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
- azureml-mlflow~=1.51.0
- azure-ai-ml~=1.8.0
- azureml-core~=1.52.0
- azureml-automl-core~=1.52.0
- azureml-telemetry~=1.52.0
- azureml-evaluate-mlflow~=0.0.19
- langcodes
Expand Down

0 comments on commit 6fe814b

Please sign in to comment.