Closed m-mohr closed 7 months ago
I have some ideas:
That will be a major task to implement and nothing we can do anytime soon, I guess.
For now, I made aggregate_temporal_frequency work with simple reducers only, which should handle most use cases and is synchronous.
cc @bgoesswe @claxn
Have you tried using evaluate() instead of getInfo(), which is supposed to be async https://developers.google.com/earth-engine/apidocs/ee-list-evaluate?
Not yet, thank you for pointing me to it. I'll have a look.
Unfortunately, this is not an issue purely related to GEE processes. There's also some internal code that we have to run (e.g. get some values from a database). This is always asynchronous in our case and as such the only thing I can see here is that GEE would somehow allow async callbacks.
Solved for I guess 80% of the use cases by making the process graph execution synchronous. The remaining 20% we need to mitigate differently by optimizing e.g. the GEE client code, let's see how it works in the future. Closing for now.
We have a architectural issue in the GEE driver, which I don't have a solution for so far.
The GEE JS API mostly runs synchronous except for some network related tasks (
getDownloadUrl
andgetInfo
for example). Escpecially, you can't run asynchronous thinks in functions likeee.ImageCollection.map
etc.On the other hand, we have some openEO GEE driver tasks that run asynchronously (e.g. loading things from database, file system or network for validation or execution).
Problem is that you can't mix both worlds easily. Once something in GEE is synchronous like
ee.ImageCollection.map
, you can't run anything asynchronous in it and the other way round.Here's an example from the newly introduced
aggregate_temporal_frequency
:So the issue is that the execute functions need to be async for some use cases (see issue 2), which makes the process graph execution async in general. On the other hand, process graph execution need to be synchronous as otherwise we can't execute callbacks such as complex reducers in GEE functions such as map (see issue 1).
I don't see a solution as of now, but a big issue that will limit the usefulness of the GEE driver a lot. I can't implement
aggregate_temporal_frequency
at the moment due to the way the GEE JS API works (all sync). Maybe there's a way around it, but I couldn't figure it out from the documentation.