GEE tasks is a workflow manager for executing tasks and processing in Google Earth Engine and then getting back the result locally. It is a simple Django app that is using Channels for scheduling jobs asyncronously into a Celery application and monitoring their status through a web API. The status of each job can be monitored through the websocket channel in a dashboard page.
- Add "gee_tasks" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = (
...
'gee_tasks',
'jobs',
'api',
#etc
)
- In your settings.py or local_settings.py file, add a CELERYBEAT_SCHEDULE setting to specify when Celery should run jobs tasks:
from celery.schedules import crontab
CELERYBEAT_SCHEDULE = {
'mytask-every-1minute': {
'task': 'jobs.tasks.download',
'schedule': crontab(minute='*/1'),
},
}
- In your settings or local_settings file, add the configuration of Channels for using a REDIS back-end:
# Channels settings
CHANNEL_LAYERS = {
"default": {
"BACKEND": "asgi_redis.RedisChannelLayer", # use redis backend
"CONFIG": {
"hosts": [os.environ.get('REDIS_URL', 'redis://localhost:6379')], # set redis address
},
"ROUTING": "gee_tasks.routing.channel_routing", # load routing from our routing.py file
},
}
Start the Celery process with DEBUG logging:
celery worker -A gee_tasks -l debug -B
Start the Django application as usual in your virtual environment:
python manage.py runserver
Dashboard - Dashboard
API page: