Skip to content

Processing Workflow

jj0hns0n edited this page Nov 4, 2011 · 1 revision

Processing Workflow

User Interface is used to Create a Project/Scenario.

The Client API is used by the UI Application to allow the user to create a Project and one or more Scenarios for that project (Note: While the database is setup to handle 'one project, many scenarios', the application currently forces this into a 1:1 relationship). The data is stored in the Application Database specifically in the following tables:

  • tsudat_project
  • tsudat_scenario
  • tsudat_gauge_point
  • tsudat_internal_polygon
  • tsudat_project_data_set

User Queue's the Scenario to be Run.

When the user has completed defining their scenario, the run_scenario view/endpoint is invoked with the scenario_id https://github.com/AIFDR/tsudat2/blob/master/tsudat/views.py#L835. The run_scenario endpoint calls the run_tsudat_simulation function in tsudat/tasks.py https://github.com/AIFDR/tsudat2/blob/master/tsudat/tasks.py#L62 asyncrhonously and control returns to the run_scenario view which notifies the user that their scenario has been queued.

Scenario Definition is used to Create an ANUGA Job Work Package for processing and the Job is Run

The code in run_tsudat_simulation does the following things to prepare a directory for ANUGA to process.

When these steps are complete, run_tsudat is called to run the Job. https://github.com/AIFDR/tsudat2/blob/master/tsudat/tasks.py#L322

MORE DETAIL ABOUT ANUGA PROCESSING WORKFLOW HERE

Processing Messages from ANUGA

A periodic task is configured to process ANUGA status messages. https://github.com/AIFDR/tsudat2/blob/master/tsudat/tasks.py#L322 These Status Messages are Retrieved from the Message Queue and Processed. START, ABORT, LOG and IDLE messages are used to update the Scenario record in the database with the status, the timestamp and any information passed from ANUGA in a message.

STOP messages indicate that the job has completed processing and is ready for loading back into the GeoNode for presentatio back to the User. When a STOP message is retrieved, the Scenario record in the Database is updated with the timestamp and the received payload (Link to sample payload here) and process_finished_simulation is invoked https://github.com/AIFDR/tsudat2/blob/master/tsudat/utils.py#L24

Process Completed Scenarios

The finished Scenario is processed to be included in the GeoNode site by doing the following:

When this sequence of events is complete, and the user receives the email indicating their job is complete, they can click on the link in the email to view their project map and download the result layers. The user can also load the scenario back into the UI for tweaking and re-running.