How to monitor activity and retrieve results
Monitor job status and retrieve results from previously run calculations in Boulder Opal
You can use the activity monitor to view the progress of current calculations and a history of your previously run calculations.
Moreover, each time you perform a calculation using Boulder Opal (for example, with boulderopal.run_optimization
), it is assigned a unique action_id
, which you can use to retrieve the results later.
In this user guide we demonstrate how to access the activity monitor and how to retrieve the results of past calculations.
Monitoring activity
Web app
You can access the activity monitor in the Boulder Opal web app. There you can see the status of current and past calculations, and use the interactive interface to cancel running actions.
Client package
The activity monitor can also be accessed through the client package using the boulderopal.cloud.show_activity_monitor
function.
import boulderopal as bo
bo.cloud.show_activity_monitor()
Activity monitor
┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Action name ┃ Created UTC ┃ Updated UTC ┃ Run time ┃ Status ┃
┡━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━┩
│ run_optimization │ 2023-10-13 │ 2023-10-13 │ 00:01:21 │ Completed │
│ ID 1628439 │ 04:57:42 │ 04:59:03 │ │ │
├──────────────────┼─────────────┼─────────────┼──────────┼───────────┤
│ run_optimization │ 2023-10-13 │ 2023-10-13 │ 00:01:21 │ Completed │
│ ID 1628438 │ 04:57:41 │ 04:59:03 │ │ │
├──────────────────┼─────────────┼─────────────┼──────────┼───────────┤
│ execute_graph │ 2023-10-13 │ 2023-10-13 │ 00:00:50 │ Completed │
│ ID 1628437 │ 04:57:40 │ 04:58:30 │ │ │
├──────────────────┼─────────────┼─────────────┼──────────┼───────────┤
│ execute_graph │ 2023-10-13 │ 2023-10-13 │ 00:00:50 │ Completed │
│ ID 1628436 │ 04:57:39 │ 04:58:30 │ │ │
├──────────────────┼─────────────┼─────────────┼──────────┼───────────┤
│ run_optimization │ 2023-10-13 │ 2023-10-13 │ 00:00:33 │ Completed │
│ ID 1628435 │ 04:57:38 │ 04:58:11 │ │ │
└──────────────────┴─────────────┴─────────────┴──────────┴───────────┘
Note that the times are displayed in UTC.
By default, the function shows the most recent actions you have run (if no filtering options are provided), but it also supports pagination and filtering by status.
You can learn more in the boulderopal.cloud.show_activity_monitor
reference page.
Retrieving results
Each call to a Boulder Opal function that involves an call to the Boulder Opal API is assigned a unique action ID. These IDs are usually printed when you call the function, or you can find them in the activity monitor.
You can use boulderopal.cloud.get_result
with an action_id
to retrieve the result of that call.
You can use this in case your connection dropped during a calculation or to retrieve results you forgot to save.
bo.cloud.get_result(action_id=1628436)
{'output': {'signal': {'values': array([2., 3., 1., 4.]),
'durations': array([0.25, 0.25, 0.25, 0.25]),
'time_dimension': 0}},
'metadata': {'action_id': '1628436'}}