ESA-APEx / apex_algorithms

Hosted APEx algorithms
Apache License 2.0
0 stars 1 forks source link

Consistent directory structure for the openeo_udp #31

Closed rahmandawibowo-vito closed 1 month ago

rahmandawibowo-vito commented 1 month ago

At the moment, the openeo_udp directory here https://github.com/ESA-APEx/apex_algorithms/tree/main/openeo_udp doesn't have a consistent structure. The worldcereal_inference.json is being stored in the root folder, whereas the max_ndvi.json and the max_ndvi_composite.json are stored inside each own subfolder inside the examples folder. This situation makes the files hard to be referenced, especially for the algorithms catalogue website where it needs to consume the files directly for generating the detail pages (and probably for other use cases as well in the future).

Unless there is a reason behind the current structure, I think it's better if we can use a more consistent structure like:

openeo_udp/
  max_ndvi/
    max_ndvi.json
  max_ndvi_composite/
    max_ndvi_composite.json
  worldcereal_inference/
    worldcereal_inference.json

What do you think @soxofaan @jdries?

soxofaan commented 1 month ago

In what sense is the proposed structure easier to consume? You still have to list available entries of that openeo_udp folder? Why is more levels harder?

I'm not sure a flat structure will scale that well. For example even at this early point, it kind of makes sense to separate examples from more real use cases

rahmandawibowo-vito commented 1 month ago

On the algorithms catalogue web, the site is statically generated before it's dockerized. The process of resolving the json files during the build is much faster if we can simply use the algorithm catalogue id with a consistent directory structure.

If we depend on the openeo-process link like here https://github.com/ESA-APEx/apex_algorithms/blob/main/algorithm_catalog/max_ndvi_composite.json#L85, then the build process needs to always look at this link property and resolve the udp json file one by one.

rahmandawibowo-vito commented 1 month ago

However, I'm not aware about the planning on this repository. If the structure of openeo_udp folder is quite dynamic, then what about this directory https://github.com/ESA-APEx/apex_algorithms/tree/main/algorithm_catalog? Will the algorithm json files always be stored in the root folder?

jdries commented 1 month ago

@rahmandawibowo-vito in long term, when we have a large number of algorithm records, we may need to move the jsons to an actual rest api rather than github. In short term, the flat organization for algorithms might be fine and simple. For UDP: feel free to move the worldcereal_inference one, (or we can do it), but keep in mind that the udp is not guaranteed to be stored there. The idea is that the algorithm link is the normative reference to the UDP, which may or may not be found in this repo. It could also point to a specific git version.

rahmandawibowo-vito commented 1 month ago

Thanks for the clarification @jdries. Based on your info, I think restructuring the UDP folder is no longer necessary. I will use the algorithms definition (link rel openeo-process) as the source of truth for referencing the UDP. We can close this issue.