Repository navigation
|
I've been running Airflow on distributed virtual machine environment and now I'm moving to OpenShift. Big chunk of my tasks are run using DockerOperator in the VM environment and I have switched those to be KubernetesPodOperator tasks. My processing is time sensitive so I can't use too strict pool sizes or other limiting conditions. Also, many of the pod runs are short lived, only few seconds. This leads to problems within the OpenShift cluster, since it can't handle too many pods too fast. One solution I was thinking, would be to build custom worker images that contain one or more applications. Since the workers would be always running and I could convert the KubernetesPodOperator tasks to regular tasks, the pod count would stay low. Is this possible and is there a better solution to this problem? So far it has been quite nice to have separate images for each application and building workers with multiple installations would also feel like a messy way to tackle this issue. |
Replies: 1 comment 2 replies
|
Hallo @karjaljo, Yes, this is possible with CeleryExecutor. You can keep separate worker images for different applications rather than install everything into one image. For example:
You can repeat that setup for another application and queue 😀 Those tasks execute on the existing Celery workers, avoiding a separate KubernetesPodOperator pod for each application invocation. Each image still needs Airflow and the appropriate configuration and DAG access; an application-only image isn't enough. The documented approach is here: Queue routing: The trade-off is maintaining multiple worker deployments. The docs warn about the extra configuration and resource-management complexity. Also, KubernetesExecutor still creates a pod per task, so changing operators alone wouldn't remove that overhead if you're using it. Which Airflow version and executor are you deploying? Hope this helps! |
Hallo @karjaljo,
Yes, this is possible with CeleryExecutor. You can keep separate worker images for different applications rather than install everything into one image.
For example:
airflow celery worker -q app_a.queue="app_a".You can repeat that setup for another application and queue 😀 Those tasks execute on the existing Celery workers, avoiding a separate KubernetesPodOperator pod for each application invocation.
Each image still needs Airflow and the appropriate c…