|
1 | 1 | #!/usr/bin/env python |
2 | | -# Copyright (c) 2024 Oracle and/or its affiliates. |
| 2 | +# Copyright (c) 2024, 2025 Oracle and/or its affiliates. |
3 | 3 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ |
4 | 4 | import base64 |
5 | 5 | import json |
@@ -199,11 +199,11 @@ def create( |
199 | 199 | eval_inference_configuration = ( |
200 | 200 | container.spec.evaluation_configuration |
201 | 201 | ) |
202 | | - except Exception: |
| 202 | + except Exception as ex: |
203 | 203 | logger.debug( |
204 | 204 | f"Could not load inference config details for the evaluation source id: " |
205 | 205 | f"{create_aqua_evaluation_details.evaluation_source_id}. Please check if the container" |
206 | | - f" runtime has the correct SMC image information." |
| 206 | + f" runtime has the correct SMC image information.\nError: {str(ex)}" |
207 | 207 | ) |
208 | 208 | elif ( |
209 | 209 | DataScienceResource.MODEL |
@@ -289,7 +289,7 @@ def create( |
289 | 289 | f"Invalid experiment name. Please provide an experiment with `{Tags.AQUA_EVALUATION}` in tags." |
290 | 290 | ) |
291 | 291 | except Exception: |
292 | | - logger.debug( |
| 292 | + logger.info( |
293 | 293 | f"Model version set {experiment_model_version_set_name} doesn't exist. " |
294 | 294 | "Creating new model version set." |
295 | 295 | ) |
@@ -711,21 +711,27 @@ def get(self, eval_id) -> AquaEvaluationDetail: |
711 | 711 | try: |
712 | 712 | log = utils.query_resource(log_id, return_all=False) |
713 | 713 | log_name = log.display_name if log else "" |
714 | | - except Exception: |
| 714 | + except Exception as ex: |
| 715 | + logger.debug(f"Failed to get associated log name. Error: {ex}") |
715 | 716 | pass |
716 | 717 |
|
717 | 718 | if loggroup_id: |
718 | 719 | try: |
719 | 720 | loggroup = utils.query_resource(loggroup_id, return_all=False) |
720 | 721 | loggroup_name = loggroup.display_name if loggroup else "" |
721 | | - except Exception: |
| 722 | + except Exception as ex: |
| 723 | + logger.debug(f"Failed to get associated loggroup name. Error: {ex}") |
722 | 724 | pass |
723 | 725 |
|
724 | 726 | try: |
725 | 727 | introspection = json.loads( |
726 | 728 | self._get_attribute_from_model_metadata(resource, "ArtifactTestResults") |
727 | 729 | ) |
728 | | - except Exception: |
| 730 | + except Exception as ex: |
| 731 | + logger.debug( |
| 732 | + f"There was an issue loading the model attribute as json object for evaluation {eval_id}. " |
| 733 | + f"Setting introspection to empty.\n Error:{ex}" |
| 734 | + ) |
729 | 735 | introspection = {} |
730 | 736 |
|
731 | 737 | summary = AquaEvaluationDetail( |
@@ -878,13 +884,13 @@ def get_status(self, eval_id: str) -> dict: |
878 | 884 | try: |
879 | 885 | log_id = job_run_details.log_details.log_id |
880 | 886 | except Exception as e: |
881 | | - logger.debug(f"Failed to get associated log. {str(e)}") |
| 887 | + logger.debug(f"Failed to get associated log.\nError: {str(e)}") |
882 | 888 | log_id = "" |
883 | 889 |
|
884 | 890 | try: |
885 | 891 | loggroup_id = job_run_details.log_details.log_group_id |
886 | 892 | except Exception as e: |
887 | | - logger.debug(f"Failed to get associated log. {str(e)}") |
| 893 | + logger.debug(f"Failed to get associated log.\nError: {str(e)}") |
888 | 894 | loggroup_id = "" |
889 | 895 |
|
890 | 896 | loggroup_url = get_log_links(region=self.region, log_group_id=loggroup_id) |
@@ -958,7 +964,7 @@ def load_metrics(self, eval_id: str) -> AquaEvalMetrics: |
958 | 964 | ) |
959 | 965 | except Exception as e: |
960 | 966 | logger.debug( |
961 | | - "Failed to load `report.json` from evaluation artifact" f"{str(e)}" |
| 967 | + f"Failed to load `report.json` from evaluation artifact.\nError: {str(e)}" |
962 | 968 | ) |
963 | 969 | json_report = {} |
964 | 970 |
|
@@ -1047,6 +1053,7 @@ def download_report(self, eval_id) -> AquaEvalReport: |
1047 | 1053 | return report |
1048 | 1054 |
|
1049 | 1055 | with tempfile.TemporaryDirectory() as temp_dir: |
| 1056 | + logger.info(f"Downloading evaluation artifact for {eval_id}.") |
1050 | 1057 | DataScienceModel.from_id(eval_id).download_artifact( |
1051 | 1058 | temp_dir, |
1052 | 1059 | auth=self._auth, |
@@ -1200,6 +1207,7 @@ def _delete_job_and_model(job, model): |
1200 | 1207 | def load_evaluation_config(self, container: Optional[str] = None) -> Dict: |
1201 | 1208 | """Loads evaluation config.""" |
1202 | 1209 |
|
| 1210 | + logger.info("Loading evaluation container config.") |
1203 | 1211 | # retrieve the evaluation config by container family name |
1204 | 1212 | evaluation_config = get_evaluation_service_config(container) |
1205 | 1213 |
|
@@ -1279,9 +1287,9 @@ def _get_source( |
1279 | 1287 | raise AquaRuntimeError( |
1280 | 1288 | f"Not supported source type: {resource_type}" |
1281 | 1289 | ) |
1282 | | - except Exception: |
| 1290 | + except Exception as ex: |
1283 | 1291 | logger.debug( |
1284 | | - f"Failed to retrieve source information for evaluation {evaluation.identifier}." |
| 1292 | + f"Failed to retrieve source information for evaluation {evaluation.identifier}.\nError: {str(ex)}" |
1285 | 1293 | ) |
1286 | 1294 | source_name = "" |
1287 | 1295 |
|
|
0 commit comments