-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Use case: UDP's with complex parameter construction logic
Users that want to expose their complex EO services via openEO UDP are increasingly asking to include complex decision logic. I provide these concrete examples:
- The correct date range for a load_collection call depends on seasons, which are different depending on AOI. So given an input year, the UDP wants to query a seasonality database.
- Depending on a selected set of desired outputs, the UDP wants to make significant changes to the actual process graph being used.
- load_collection property filters need dynamic adjustment based on availability of data in the catalog. For instance, if sufficient sentinel-1 data is available for a single orbit direction, it is possible to filter on that, otherwise we require both ascending and descending directions.
This complex logic is often encoded in client side logic. This however presents a problem when trying to expose the service to generic web UI's that are not aware of this complex logic. The openEO web editor wizard is one example.
Solution 1: UDF to generate complex parameters
A call to run_udf can determine complex parameters.
The advantage of this solution is that custom code usage can be limited, and the majority of the process graph remains fully transparant.
Limitation
- Top level run_udf is a problem for 'validation' call.
- Backend needs to support run_udf
- May not satisfy the most complex use cases
Solution 2: UDF to generate full process graph
A call to run_udf can generate the full process graph.
The 'array_apply' process is capable of invoking arbitrary process graphs.
The advantage of this solution is that it allows quite complex process graph construction.
Limitation
- Top level run_udf is a problem for 'validation' call.
- Backend needs to support run_udf
- The UDP will appear less transparent, because the majority of the actual process graph is only constructed at runtime.
- Job options will have to be defined for all UDP variants generated by the UDF
Related issue: Open-EO/openeo-geopyspark-driver#1064
Solution 3: External API or UDP to perform process graph construction
This is similar to solution 2, but the custom PG is constructed by a call to an external service or even an openEO UDP that consists of a UDF.
The advantage of this solution is that it allows quite complex process graph construction.
It can also allow to work with backends that do not support run_udf.
Limitation
- The service usage will be a 2-step process: generating the PG and then executing it. Generic UI's will also not 'know' how this works, unless if we manage to standardize it.
Solution 4: use application package
In this solution, the UDP author would encapsulate the complex client side logic in an application package. This AP could be deployed as an openEO process or using OGC API processes part 2.
Limitations
- The AP would be making openEO API calls, but how would it be able to authenticate?
- If the jobs are long running, the calling AP would also have to be a long-running process that actively monitors the batch jobs it depends on.