brazil-data-cube / bdc-collection-builder

BDC Collection Builder is a Python package for local server and AWS S3 bucket ingestion of satellite imagery
GNU General Public License v3.0
5 stars 5 forks source link

[celery] Investigate how to deal with several tasks chaining on multiple queues in cube generation #61

Closed raphaelrpl closed 4 years ago

raphaelrpl commented 4 years ago

Definition

The following tasks describes how to build a data cube:

Problem

In order to parallel cube generation using celery tasks, we flask view to dispatch cube generation. First of all, we search on STAC Service to get available collections.

The following pseudo-code describes how to dispatch cube generation:

for each band:
    for each blend:
        for each merge:
            warps = map(lambda asset: warp(asset)))
            merges.append(warps)
        blends.append(merges)
# wait all blends and then publish data cube
chain(group(blends), publish.s()).apply_async()

However, once we defined chain and group of tasks to deal with cube generation, we are facing wrong order execution on celery worker listening individual queues. It seems related with Celery Bug.

Links

raphaelrpl commented 4 years ago

Right now, the cube generation is using default celery queue (celery)