diff --git a/ml_service/util/attach_compute.py b/ml_service/util/attach_compute.py index ad9668db..cf8c07a6 100644 --- a/ml_service/util/attach_compute.py +++ b/ml_service/util/attach_compute.py @@ -1,4 +1,5 @@ +import traceback from azureml.core import Workspace from azureml.core.compute import AmlCompute from azureml.core.compute import ComputeTarget @@ -32,7 +33,7 @@ def get_compute(workspace: Workspace, compute_name: str, vm_size: str, for_batch show_output=True, min_node_count=None, timeout_in_minutes=10 ) return compute_target - except ComputeTargetException as ex: - print(ex) + except ComputeTargetException: + traceback.print_exc() print("An error occurred trying to provision compute.") exit(1) diff --git a/ml_service/util/manage_environment.py b/ml_service/util/manage_environment.py index 54c5a72f..b61c97fe 100644 --- a/ml_service/util/manage_environment.py +++ b/ml_service/util/manage_environment.py @@ -1,5 +1,6 @@ import os +import traceback from azureml.core import Workspace, Environment from ml_service.util.env_variables import Env from azureml.core.runconfig import DEFAULT_CPU_IMAGE, DEFAULT_GPU_IMAGE @@ -35,6 +36,6 @@ def get_environment( if restored_environment is not None: print(restored_environment) return restored_environment - except Exception as e: - print(e) + except Exception: + traceback.print_exc() exit(1)