pygeoapi icon indicating copy to clipboard operation
pygeoapi copied to clipboard

Added support for websocket processing microservices

Open herzogrh opened this issue 2 years ago • 0 comments

Overview

This PR adds functionality to connect the pygeoapi with processing microservices via Websockets connections. In that way, it is possible to execute processes in other environments than in Python, but still make them accessible through pygeoapi's OGC API processes and job management. As an example, one could connect a node.js processing microservice with pygeoapi and run Insight Maker simulations. Another benefit is that one can dynamically add and remove processing microservices without having to recompile pygeoapi. Once a microservice establishes a websocket connection, it registers a process that is then added to the list of processes in pygeoapi. Whenever an execution request is made by a client, the proposed feature will forward the inputs through the websocket connection and the microservice will start the calculation. Once the results are calculated, the microservice transmits the results back to be stored in the job management. Important: A database manager must be configured for the new feature to work.

Background

In the urban digital twin project Connected Urban Twins we identified the use case of multi-dimensional simulations running on various different modelling paradigms and software stacks. Therefore it is necessary to easily spin up and deploy various processing microservices via standardised APIs such as the OGC API Processes. As pygeoapi is a great implementation of OGC API processes and provides both an interface and an integrated job management, we added the feature to connect Websocket processing microservices.

Dependency policy (RFC2)

  • [x] I have ensured that this PR meets RFC2 requirements

Updates to public demo

  • [x] I have ensured that breaking changes to the pygeoapi master demo server have been addressed
    • [x] https://github.com/geopython/demo.pygeoapi.io/blob/master/services/pygeoapi_master/local.config.yml

Contributions and licensing

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • [x] I'd like to contribute a websocket endpoint for processing microservices to pygeoapi. I confirm that my contributions to pygeoapi will be compatible with the pygeoapi license guidelines at the time of contribution
  • [x] I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

herzogrh avatar Jan 09 '24 17:01 herzogrh