Skip to content

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
nweires committed Jan 26, 2024
1 parent 80a9adb commit b8a170c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions buildstockbatch/gcp/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,12 @@ def start_batch_job(self, batch_info):
║ post-processing will not be triggered. ║
╚══════════════════════════════════════════════════════════════════════════════╝
Job name: {job_name}
Job UID: {created_job.uid}
🔗 See status at: {job_url}.
Job name:
{job_name}
Job UID:
{created_job.uid}
🔗 See status at:
{job_url}.
Results output browser (Cloud Console):
https://console.cloud.google.com/storage/browser/{self.gcs_bucket}/{self.gcs_prefix}/results/simulation_output
"""
Expand Down Expand Up @@ -717,7 +720,10 @@ def start_batch_job(self, batch_info):
logger.info(f"Batch job status: {job_status}")
logger.info(f"Batch job tasks: {dict(task_counts)}")
if job_status != "SUCCEEDED":
raise RuntimeError(f"Batch job failed. See GCP logs at {job_url}")
raise RuntimeError(
f"Batch job failed. See GCP logs at {job_url}. "
"Re-run this script with --missingonly to retry failed tasks."
)
else:
task_group = job_info.task_groups[0]
task_spec = task_group.task_spec
Expand Down Expand Up @@ -925,7 +931,8 @@ def start_combine_results_job_on_cloud(self, results_dir, do_timeseries=True):
║ You may interrupt the script and the job will continue to run. ║
╚══════════════════════════════════════════════════════════════════════════════╝
🔗 See status at: {self.postprocessing_job_console_url}.
🔗 See status at:
{self.postprocessing_job_console_url}.
Results output browser (Cloud Console):
https://console.cloud.google.com/storage/browser/{self.gcs_bucket}/{self.gcs_prefix}/results/
Expand Down

0 comments on commit b8a170c

Please sign in to comment.